/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --color-bg: #ffffff;
  --color-surface: #f7f6f3;
  --color-border: #e6e3dc;
  --color-text: #1c1b19;
  --color-text-muted: #6b6a63;
  --color-primary: #14532d;
  --color-primary-dark: #0f3d22;
  --color-primary-contrast: #ffffff;
  --color-accent: #c99b4a;
  --color-danger: #b91c1c;
  --color-success: #15803d;

  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 15, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 20, 15, 0.08);
  --container-width: 1180px;
}

* { box-sizing: border-box; }

/* The `hidden` HTML attribute sets display:none via a very low-specificity
   UA rule — any author rule that sets `display` on the same element (e.g.
   `.lightbox { display: flex; }` for when it's shown) silently wins over it
   otherwise, leaving a "hidden" element fixed-position over the whole page
   intercepting clicks. Always let the attribute win. */
[hidden] { display: none !important; }

/* Visually hidden but still announced by screen readers — for labels that
   would be visually redundant next to an already-clear control. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.container {
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: 20px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
}
.skip-link:focus { left: 10px; top: 10px; }

/* ==========================================================================
   Buttons & forms
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--color-primary); color: var(--color-primary-contrast); }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-outline { background: transparent; border-color: var(--color-primary); color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
  color: var(--color-text);
}
.form-control:focus {
  /* Not removing focus indication — replacing the native outline with a
     more visible ring that also works on rounded corners (WCAG 2.4.7). */
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(20, 83, 45, 0.35);
}
/* Any other focusable control (links, buttons, calendar days, etc.) keeps
   the browser's native focus outline — never suppressed anywhere else. */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.form-errors { color: var(--color-danger); font-size: 0.85rem; margin-top: 4px; }
.form-radio-group { display: flex; flex-direction: column; gap: 8px; }
.form-radio-group label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.form-check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.form-check input { margin-top: 4px; }

/* ==========================================================================
   Header / nav
   ========================================================================== */
.site-header {
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  /* Deliberately no backdrop-filter here: it creates a new containing block
     for position:fixed descendants (the mobile nav panel below), which
     collapses that panel's height. Opaque-enough background instead. */
  background: rgba(255, 255, 255, 0.97);
  z-index: 100;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}
.brand { display: flex; align-items: center; }
.brand__logo { max-height: 44px; }
.brand__name { font-weight: 800; font-size: 1.25rem; color: var(--color-text); }

.primary-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
}
.primary-nav a {
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.95rem;
}
.primary-nav a:hover { color: var(--color-primary); text-decoration: none; }
.cart-badge {
  background: var(--color-accent);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.75rem;
  font-weight: 700;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--color-text); border-radius: 2px; }

/* ==========================================================================
   Messages
   ========================================================================== */
.messages { list-style: none; padding: 0; margin: 16px 0 0; }
.message {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-weight: 500;
}
.message--success { background: #ecfdf3; color: var(--color-success); border: 1px solid #bbf7d0; }
.message--error { background: #fef2f2; color: var(--color-danger); border: 1px solid #fecaca; }
.message--info, .message--warning { background: var(--color-surface); border: 1px solid var(--color-border); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  padding: 90px 0;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(201, 155, 74, 0.35), transparent 55%);
  /* Purely decorative — without this it sits on top of .hero-inner (later
     in paint order despite being visually "behind" the content) and
     silently swallows every click in the hero area, including the CTA
     buttons. */
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero h1 { color: #fff; margin-bottom: 0.4em; }
.hero p { color: rgba(255,255,255,0.85); font-size: 1.1rem; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-image img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  aspect-ratio: 4/3;
  object-fit: cover;
  width: 100%;
}

/* ==========================================================================
   Sections / cards
   ========================================================================== */
.section { padding: 72px 0; }
.section--muted { background: var(--color-surface); }
.section-heading { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-heading p { color: var(--color-text-muted); }

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.highlight-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
}
.highlight-card .icon { font-size: 2rem; margin-bottom: 12px; }
/* Semantic level is h2 (right after the h1 hero, no skipped levels) but it
   should look like a small card title, not a full section heading. */
.highlight-card h2 { font-size: 1.2rem; margin: 0 0 0.5em; }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.about-grid img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.gallery-grid img { border-radius: var(--radius-md); aspect-ratio: 1; object-fit: cover; width: 100%; }

.cta-banner {
  background: var(--color-accent);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  /* Not a hardcoded brown — every theme's accent is checked to stay light
     enough for var(--color-text) to keep >=4.5:1 contrast on top of it. */
  color: var(--color-text);
}
.cta-banner h2 { color: inherit; }

/* ==========================================================================
   Booking
   ========================================================================== */
.booking-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 36px;
  align-items: start;
}
.service-list { display: flex; flex-direction: column; gap: 10px; }
.service-category-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin: 18px 0 6px;
}
.service-card {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
}
.service-card.is-active { border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(20,83,45,0.12); }
.service-card__name { font-weight: 700; }
.service-card__meta { color: var(--color-text-muted); font-size: 0.85rem; margin-top: 2px; }
.service-card__price { color: var(--color-primary); font-weight: 700; float: right; }

.booking-panel {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  /* Grid items default to min-width:auto, so without this the panel would
     grow to fit the date strip's full (non-wrapping) content width instead
     of respecting the 1fr track — breaking the strip's own horizontal
     scrolling. */
  min-width: 0;
}
.calendar { margin-top: 4px; }
.calendar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.calendar__title {
  font-weight: 700;
  font-size: 1.05rem;
  text-transform: capitalize;
}
.calendar__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.calendar__weekdays span {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
}
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
  font-family: inherit;
  color: var(--color-text);
}
.calendar-day:hover:not(.is-disabled) { border-color: var(--color-primary); }
.calendar-day.is-selected { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.calendar-day.is-today:not(.is-selected) { border-color: var(--color-primary); color: var(--color-primary); }
.calendar-day.is-disabled {
  background: transparent;
  border-color: transparent;
  color: var(--color-border);
  cursor: not-allowed;
}
.calendar-day.is-empty { visibility: hidden; cursor: default; }

/* Date-range picker (Service.is_date_range) states */
.calendar-day.is-range-start,
.calendar-day.is-range-end {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.calendar-day.is-in-range {
  background: rgba(20, 83, 45, 0.12);
  border-color: transparent;
  border-radius: 0;
}

.date-nav {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text);
}
.date-nav:hover:not(:disabled) { border-color: var(--color-primary); color: var(--color-primary); }
.date-nav:disabled { opacity: 0.35; cursor: not-allowed; }

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.slot-btn {
  padding: 10px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  text-align: center;
}
.slot-btn:hover { border-color: var(--color-primary); }
.slot-btn.is-selected { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.booking-empty { color: var(--color-text-muted); padding: 16px 0; }
.booking-summary {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 20px 0;
}

/* ==========================================================================
   Shop
   ========================================================================== */
.category-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.category-chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.9rem;
}
.category-chip.is-active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}
.product-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.product-card__image { aspect-ratio: 1; object-fit: cover; background: var(--color-surface); width: 100%; }
.product-card__body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card__title { font-weight: 700; }
.product-card__price { color: var(--color-primary); font-weight: 800; font-size: 1.1rem; margin-top: auto; }
.product-card__price small { color: var(--color-text-muted); font-weight: 500; font-size: 0.75rem; }
.badge-outofstock { color: var(--color-danger); font-weight: 700; font-size: 0.85rem; }

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.product-gallery__main { border-radius: var(--radius-lg); aspect-ratio: 1; object-fit: cover; width: 100%; }
.product-gallery__thumbs { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.product-gallery__thumbs img { width: 70px; height: 70px; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer; border: 2px solid transparent; }
.product-gallery__thumbs img.is-active { border-color: var(--color-primary); }
.price-block { font-size: 1.6rem; font-weight: 800; color: var(--color-primary); margin: 12px 0; }
.price-block small { display: block; font-size: 0.9rem; font-weight: 500; color: var(--color-text-muted); }

.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.cart-table th, .cart-table td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--color-border); }
.cart-table input[type="number"] { width: 64px; padding: 6px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
.cart-total-row td { font-weight: 800; font-size: 1.1rem; }
.cart-line-options { color: var(--color-text-muted); font-size: 0.82rem; margin-top: 2px; }

.product-options { margin: 18px 0; display: flex; flex-direction: column; gap: 14px; }
.product-options select { min-width: 180px; }
.product-options select[multiple] { min-height: 88px; }

.checkout-layout { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: start; }
.order-summary { background: var(--color-surface); border-radius: var(--radius-lg); padding: 24px; }
.order-summary-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--color-border); }
.order-summary-total { display: flex; justify-content: space-between; padding-top: 14px; font-weight: 800; font-size: 1.1rem; }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.contact-info-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.contact-info-card p { margin-bottom: 10px; }
.contact-info-card h2 { font-size: 1.2rem; margin: 0 0 0.6em; }
.map-embed { border-radius: var(--radius-lg); overflow: hidden; margin-top: 20px; border: 1px solid var(--color-border); }
.map-embed iframe { width: 100%; height: 260px; border: 0; display: block; }

/* ==========================================================================
   Simple pages
   ========================================================================== */
.prose { max-width: 760px; margin: 0 auto; }
.prose h2, .prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }

/* ==========================================================================
   Pricing
   ========================================================================== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  align-items: stretch;
}
.pricing-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  text-align: center;
}
.pricing-card.is-featured {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-6px);
}
.pricing-card__badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 14px;
  border-radius: 999px;
}
.pricing-card__name { font-size: 1.2rem; margin-bottom: 4px; }
.pricing-card__tagline { color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: 16px; }
.pricing-card__price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 20px;
}
.pricing-card__price small { display: block; font-size: 0.85rem; font-weight: 500; color: var(--color-text-muted); }
.pricing-card__features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  flex: 1;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pricing-card__features li {
  padding-left: 26px;
  position: relative;
  font-size: 0.92rem;
}
.pricing-card__features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-weight: 700;
}

/* ==========================================================================
   Gallery / lightbox
   ========================================================================== */
.gallery-grid--lightbox img { cursor: pointer; }
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 12, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: 1000;
}
.lightbox__image { max-width: 100%; max-height: 100%; border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--color-text); color: #d8d6ce; margin-top: 80px; padding-top: 56px; }
.site-footer h2 { color: #fff; font-size: 1rem; margin: 0 0 0.5em; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding-bottom: 32px; }
.footer-col a { color: #d8d6ce; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-social { display: flex; gap: 14px; margin-top: 12px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding: 18px 0; font-size: 0.85rem; }

/* ==========================================================================
   Utility screens (maintenance / disabled module)
   ========================================================================== */
.state-screen {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .hero-inner, .about-grid, .product-detail, .checkout-layout, .contact-layout {
    grid-template-columns: 1fr;
  }
  .hero-image { order: -1; }
  .booking-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Switches to the hamburger menu well above the 720px content breakpoint —
   with the full nav (6+ links plus the cart) a ~768px tablet still has the
   "desktop" nav here, which was cramped enough to wrap the brand name onto
   two lines. */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: fixed;
    inset: 72px 0 0 0;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.2s ease;
    padding: 20px;
    overflow-y: auto;
  }
  .primary-nav.is-open { transform: translateX(0); }
  .primary-nav ul { flex-direction: column; align-items: flex-start; gap: 4px; }
  .primary-nav li { width: 100%; }
  .primary-nav a { display: block; padding: 14px 4px; border-bottom: 1px solid var(--color-border); }
}

@media (max-width: 720px) {
  .hero { padding: 56px 0; }
  .section { padding: 48px 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .calendar__grid { gap: 6px; }
  .calendar-day { font-size: 0.95rem; border-radius: var(--radius-sm); }
  .calendar__weekdays { gap: 6px; }
  .date-nav { width: 34px; height: 34px; }
}
