/* WST template styles — Tourfic car pages (single + archive).
 * Pairs with tourfic/car/single-car.php, tourfic/car/archive-cars.php and
 * assets/js/single-car.js. Built on the design tokens + shared components
 * (page-hero, card, section) — homepage visual language: warm paper,
 * serif headlines, mono eyebrows, terracotta accent. */

/* ============================================================
 * Single car — hero
 * ============================================================ */
.wst-single-car {
  padding-bottom: clamp(56px, 8vw, 110px);
}

.car-hero {
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
  padding: clamp(28px, 4vw, 48px) 0 clamp(32px, 5vw, 56px);
}
.car-hero .breadcrumbs { margin-bottom: 20px; }

.car-hero-top { margin-bottom: clamp(20px, 3vw, 32px); }
.car-hero .eyebrow { margin: 0 0 14px; }
.car-hero-title {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.01em;
  line-height: 1;
  font-size: clamp(38px, 5vw, 70px);
  margin: 0;
  color: var(--ink);
}
.car-hero-loc {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--ink-2);
}
.car-hero-loc svg { width: 16px; height: 16px; color: var(--terra); }

/* Gallery */
.car-gallery {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 14px;
}
.car-gallery-main,
.car-gallery-thumb {
  display: block;
  margin: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--teal-deep);
  cursor: pointer;
  transition: transform .25s ease;
}
.car-gallery-main:hover,
.car-gallery-thumb:hover { transform: scale(1.01); }

/* Screen-reader-only — hides the Fancybox "extras" links visually while
 * leaving them in the DOM so the lightbox set includes every photo. */
.wst-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.car-gallery-main { aspect-ratio: 16 / 10; }
.car-gallery-main img,
.car-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.car-gallery-thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.car-gallery-thumb { aspect-ratio: 4 / 3; }

/* Spec row */
.car-spec-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: clamp(20px, 3vw, 32px) 0 0;
  padding: 0;
  list-style: none;
}
.car-spec {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 99px;
  padding: 8px 14px;
}

/* ============================================================
 * Single car — body layout
 * ============================================================ */
.car-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: clamp(32px, 5vw, 64px);
  padding-top: clamp(36px, 5vw, 64px);
  align-items: start;
}

.car-main { min-width: 0; }

.car-section {
  padding-bottom: clamp(28px, 4vw, 44px);
  margin-bottom: clamp(28px, 4vw, 44px);
  border-bottom: 1px solid var(--rule);
}
.car-section:last-child { border-bottom: 0; margin-bottom: 0; }
.car-section-title {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.01em;
  line-height: 1.1;
  font-size: clamp(26px, 3vw, 38px);
  margin: 0 0 20px;
  color: var(--ink);
}

/* Feature lists (benefits / includes / excludes) */
.car-feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.car-feature {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
}
.car-feature-mark {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  background: var(--paper-2);
  color: var(--teal);
}
.car-feature-mark--yes { background: rgba(12, 74, 74, .12); color: var(--teal); }
.car-feature-mark--no { background: rgba(184, 90, 60, .14); color: var(--terra); }

.car-incexc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 4vw, 48px);
}
.car-incexc-head {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}

/* Map */
.car-map {
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--rule);
}
.car-map iframe { display: block; max-width: 100%; }
.car-map-addr {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* Tourfic injects a Leaflet map into our #car-location section. Leaflet's
 * internal panes use z-index up to ~700 — without a stacking context on the
 * container, those z-indexes leak into the document and render ABOVE the
 * fixed booking bar (z-60) and sheet. Isolate the container so its internal
 * stacking can't escape, and clip its overflow so the .leaflet-proxy / tiles
 * never widen the page. */
.leaflet-container {
  isolation: isolate;
  overflow: hidden;
  max-width: 100%;
}

/* WordPress comment textarea defaults to cols="45" which is wider than a
 * 390px phone viewport — clamp it so the page never gets a horizontal
 * scrollbar / right-side gap. */
#comments textarea,
#commentform textarea,
textarea#comment {
  max-width: 100%;
  box-sizing: border-box;
}

/* FAQ */
.car-faq {
  display: grid;
  gap: 10px;
}
.car-faq-item {
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--white);
  overflow: hidden;
}
.car-faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
}
.car-faq-q::-webkit-details-marker { display: none; }
.car-faq-icon {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 18px;
  color: var(--terra);
  transition: transform .2s ease;
}
.car-faq-item[open] .car-faq-icon { transform: rotate(45deg); }
.car-faq-a {
  padding: 0 18px 18px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}
.car-faq-a > * { margin: 0 0 .8em; }
.car-faq-a > *:last-child { margin-bottom: 0; }

/* Reviews */
.car-reviews {
  display: grid;
  gap: 22px;
  margin-bottom: 28px;
}
.car-review {
  display: flex;
  gap: 14px;
}
.car-review-avatar img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: block;
}
.car-review-meta {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
}
.car-review-meta strong {
  color: var(--ink);
  margin-right: 8px;
  font-size: 14px;
}
.car-review-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}
.car-reviews-empty {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 24px;
}
.car-review-form-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(20px, 2.2vw, 26px);
  margin: 0 0 8px;
  color: var(--ink);
}

/* ============================================================
 * Single car — booking widget
 * ============================================================ */
.car-booking {
  position: sticky;
  top: 96px;
}
.car-booking-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: clamp(20px, 2.4vw, 28px);
  box-shadow: 0 30px 60px -40px rgba(10, 40, 40, .35);
  /* Cap to the viewport so a tall widget scrolls inside itself instead of
     running off-screen under the sticky offset. */
  max-height: calc(100vh - 96px - 24px);
  overflow-y: auto;
}

.car-booking-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.car-booking-price-amount {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 40px);
  line-height: 1;
  color: var(--ink);
}
.car-booking-price-amount del {
  font-size: .62em;
  color: var(--muted);
  margin-right: 4px;
}
.car-booking-price-unit {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.car-booking-price-note {
  margin: 8px 0 18px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.car-booking.is-pricing .car-booking-price,
.car-booking-card.is-pricing .car-booking-price {
  opacity: .5;
}
.is-pricing .car-booking-price { opacity: .5; transition: opacity .15s; }

/* Fields */
.car-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.car-field { display: flex; flex-direction: column; min-width: 0; }
.car-field-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.car-field-control {
  width: 100%;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  transition: border-color .15s ease;
}
.car-field-control:focus {
  outline: none;
  border-color: var(--teal);
}
select.car-field-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2375726a' stroke-width='1.6' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}

/* Add-ons + protection */
.car-addons {
  border: 0;
  margin: 4px 0 12px;
  padding: 0;
}
.car-addons-legend {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0;
  margin-bottom: 8px;
}
.car-addon {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.car-addon:last-child { margin-bottom: 0; }
.car-addon:hover { border-color: var(--teal); }
.car-addon-check {
  margin: 2px 0 0;
  accent-color: var(--teal);
  flex-shrink: 0;
}
.car-addon-body { flex: 1; min-width: 0; }
.car-addon-title {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.car-addon-desc {
  display: block;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  margin-top: 2px;
}
.car-addon-price {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
}
.car-addon-per {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--muted);
}

/* Error + actions */
.car-booking-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--terra);
  background: rgba(184, 90, 60, .1);
  border: 1px solid rgba(184, 90, 60, .3);
  border-radius: var(--r-sm);
}

.car-booking-actions {
  display: flex;
  gap: 10px;
}
.car-booking-actions--split { display: grid; grid-template-columns: 1fr 1fr; }
.car-booking-submit {
  justify-content: center;
  width: 100%;
}
.car-booking-submit.is-busy {
  opacity: .6;
  pointer-events: none;
}
.car-booking-submit:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.car-booking-reassure {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
/* WhatsApp enquiry link below the car booking form */
.car-booking-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .05em;
  color: var(--muted);
  text-decoration: none;
  margin: 14px 0 0;
  transition: color .15s ease;
}
.car-booking-wa:hover { color: #25d366; }
.car-booking-wa svg { width: 16px; height: 16px; flex-shrink: 0; fill: currentColor; }

.car-booking-disabled {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* ============================================================
 * Single car — mobile booking bar + sheet chrome
 * Hidden on desktop; revealed inside the ≤1080px media query.
 * ============================================================ */
.car-sheet-head { display: none; }
.car-sheet-backdrop { display: none; }

.car-mobilebar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 20px;
  background: var(--paper);
  border-top: 1px solid var(--rule);
  box-shadow: 0 -10px 30px -12px rgba(0, 0, 0, .2);
}
.car-mobilebar-price { display: flex; flex-direction: column; }
.car-mobilebar-from {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.car-mobilebar-amt {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--ink);
}
.car-mobilebar-cta { white-space: nowrap; }

/* ============================================================
 * Car archive — card extras (built on the global .wst-card)
 * ============================================================ */
.wst-car-card__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.wst-car-card__specs li {
  position: relative;
  padding-right: 14px;
}
.wst-car-card__specs li::after {
  content: "·";
  position: absolute;
  right: 4px;
  opacity: .6;
}
.wst-car-card__specs li:last-child { padding-right: 0; }
.wst-car-card__specs li:last-child::after { content: ""; }

.wst-car-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.wst-car-card__price { display: flex; align-items: baseline; gap: 5px; }
.wst-car-card__price-amount {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
}
.wst-car-card__price-unit {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.wst-car-card__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--teal);
  text-decoration: none;
  transition: color .15s ease;
}
.wst-car-card__link:hover { color: var(--terra); }

/* ============================================================
 * Responsive
 * ============================================================ */
@media (max-width: 1080px) {
  .car-layout {
    grid-template-columns: 1fr;
  }

  /* Mobile bar shown for the whole ≤1080px range; clear it with padding. */
  .car-mobilebar { display: flex; }
  .wst-single-car { padding-bottom: 96px; }

  /* Booking widget becomes a slide-up bottom-sheet. */
  .car-booking {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    top: auto;
    z-index: 80;                 /* above .car-mobilebar (60) */
    display: flex;
    flex-direction: column;
    max-height: 88vh;
    background: var(--white);
    border-top: 1px solid var(--rule);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    box-shadow: 0 -24px 50px -20px rgba(10, 40, 40, .4);
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.32, .72, 0, 1);
    will-change: transform;
  }
  .car-booking.is-open { transform: translateY(0); }

  /* Sheet header: drag-handle + close, sticky at the sheet top. */
  .car-sheet-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 10px 16px 4px;
    background: var(--white);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
  .car-sheet-handle {
    width: 40px; height: 4px;
    border-radius: 99px;
    background: var(--rule);
  }
  .car-sheet-close {
    position: absolute;
    top: 6px; right: 10px;
    width: 34px; height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    color: var(--ink-2);
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 50%;
    cursor: pointer;
  }
  .car-sheet-close:hover { border-color: var(--ink); color: var(--ink); }

  /* Inner card scrolls within the sheet; drop sticky cap + desktop framing. */
  .car-booking-card {
    max-width: none;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 4px 20px calc(20px + env(safe-area-inset-bottom));
  }

  /* Full-screen dimmed backdrop — below the sheet, above the page.
     pointer-events:none when closed so it never eats taps on the mobile bar. */
  .car-sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(10, 30, 30, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s ease;
  }
  .car-sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }
}

@media (max-width: 720px) {
  .car-gallery {
    grid-template-columns: 1fr;
  }
  .car-gallery-thumbs {
    grid-template-columns: repeat(4, 1fr);
  }
  .car-gallery-thumb { aspect-ratio: 1 / 1; }
  .car-incexc {
    grid-template-columns: 1fr;
  }
  .car-field-grid {
    grid-template-columns: 1fr;
  }
  .car-booking-actions--split {
    grid-template-columns: 1fr;
  }
}

/* ---- Booking summary block (per-day, savings, total, deposit) ---- */
.car-booking-summary[hidden] { display: none; }
.car-booking-summary {
  margin: 18px 0 6px;
  padding: 16px 18px 18px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.car-booking-summary__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.car-booking-summary__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.car-booking-summary__value {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--ink);
}
.car-booking-summary__row--breakdown .car-booking-summary__label {
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--sans);
  font-size: 13.5px;
}
.car-booking-summary__row--total {
  padding-top: 10px;
  border-top: 1px solid var(--rule);
}
.car-booking-summary__row--total .car-booking-summary__label,
.car-booking-summary__row--total .car-booking-summary__value {
  font-size: 16px;
  color: var(--ink);
  font-weight: 600;
}
.car-booking-summary__row--total .car-booking-summary__value {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -.01em;
}
.car-booking-summary__row--deposit {
  margin-top: -2px;
}
.car-booking-summary__row--deposit .car-booking-summary__value {
  color: var(--terra);
  font-weight: 600;
}
.car-booking-summary__hint {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--terra);
}
.car-booking-summary__hint[hidden] { display: none; }
.car-booking-summary__note {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
.car-booking-summary__note[hidden] { display: none; }
