/* ============================================================
   RCM Booking App — Styles
   CSS custom properties used for per-instance branding
   ============================================================ */

:root {
  --color-primary: #a34836;
  /* Hover state defaults to the accent colour when set (themed per-instance via --color-accent),
     falling back to a slightly-darker primary if accent isn't configured. */
  --color-primary-hover: var(--color-accent, #a24935);
  --color-secondary: #484332;
  --color-text: #484332;
  --color-text-light: #7a6e60;
  --color-bg: #f8f2e6;
  --color-white: #ffffff;
  --color-border: #e2d4c1;
  --color-error: #c0392b;
  --color-success: #27ae60;
  --color-warning: #e67e22;
  --radius: 6px;
  --shadow: 0 2px 8px rgba(72,67,50,0.10);
  --max-width: 960px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 0;
}

.site-header img {
  max-height: 48px;
  width: auto;
}

/* Footer */
.site-footer {
  margin-top: 48px;
  padding: 24px 0;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-light);
  font-size: 13px;
}
.footer-admin {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
}
.footer-admin a {
  color: var(--color-text-light);
  text-decoration: none;
  opacity: 0.6;
}
.footer-admin a:hover {
  opacity: 1;
}

/* Step indicator */
.steps {
  margin: 24px 0;
}

.steps ol {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.steps .step {
  flex: 1;
  text-align: center;
  padding: 10px 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-light);
  border-bottom: 3px solid rgba(0,0,0,0.12);
  position: relative;
}

.steps .step.active {
  color: var(--color-accent, var(--color-primary));
  font-weight: 700;
  border-bottom-color: var(--color-accent, var(--color-primary));
}

.steps .step.done {
  color: var(--color-success);
  border-bottom-color: var(--color-success);
}

/* Step anchors (clickable steps, e.g. "Search") inherit the step's colour
   and stretch to fill the cell so the whole step area is the click target. */
.steps .step a {
  color: inherit;
  text-decoration: none;
  display: block;
  cursor: pointer;
  font-weight: inherit;
}

.steps .step a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Cards */
.card {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.required-mark {
  color: var(--color-error, #c0392b);
  font-weight: 700;
  margin-left: 2px;
}

.summary-vehicle-img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
  margin-bottom: 12px;
  padding: 4px;
}

@media (max-width: 600px) {
  .summary-vehicle-img { height: 220px; }
}

/* Booking summary details tile (above Driver Details) */
.booking-details-card { padding: 16px 20px; margin-bottom: 16px; }
.booking-details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: 14px;
}
.booking-details dt {
  font-weight: 600;
  color: var(--color-text-light);
  margin: 0;
}
.booking-details dd {
  margin: 0;
  color: var(--color-text);
}
.booking-details dd.text-limited {
  color: #c87500;
  font-weight: 600;
}

@media (max-width: 600px) {
  .booking-details { grid-template-columns: 1fr; gap: 2px 0; }
  .booking-details dt { margin-top: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
  .booking-details dt:first-child { margin-top: 0; }
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  color: var(--color-text);
  background: var(--color-white);
  appearance: auto;
}

.form-group input[type="date"],
.form-group input[type="time"] {
  cursor: pointer;
}

/* iOS fix: grid/flex children default to min-width: auto which lets native
   date inputs overflow their container. Force them to honour their width. */
.form-group,
.form-row > * {
  min-width: 0;
}

.form-group input:focus,
.form-group select:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: -1px;
  border-color: transparent;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-block {
  width: 100%;
}

/* Vehicle cards */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 16px;
  margin-top: 16px;
}

.vehicle-card {
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.vehicle-card:hover {
  border-color: var(--color-primary-hover);
  box-shadow: var(--shadow);
}

.vehicle-card.unavailable {
  opacity: 0.5;
  cursor: not-allowed;
}

.vehicle-card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: var(--color-white, #fff);
  padding: 8px;
}

@media (max-width: 600px) {
  .vehicle-card img {
    height: 200px;
  }
}

.vehicle-card-body {
  padding: 16px;
}

.vehicle-card-name {
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 4px;
}

.vehicle-card-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-primary);
  margin: 8px 0;
}

.vehicle-card-per {
  font-size: 13px;
  color: var(--color-text-light);
  font-weight: 400;
}

/* RCM description HTML — normalise injected markup */
.vehicle-card-desc {
  font-size: 13px;
  color: var(--color-text-light);
  margin: 8px 0;
  line-height: 1.5;
}
.vehicle-card-desc h1, .vehicle-card-desc h2, .vehicle-card-desc h3,
.vehicle-card-desc h4, .vehicle-card-desc h5, .vehicle-card-desc h6 {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin: 8px 0 2px;
}
.vehicle-card-desc p { margin: 2px 0 6px; }
.vehicle-card-desc ul, .vehicle-card-desc ol { margin: 4px 0; padding-left: 18px; }
.vehicle-card-desc li { margin-bottom: 2px; }
.vehicle-card-desc br { display: block; content: ''; margin: 1px 0; }

/* Capacity icons row */
.vehicle-card-capacity {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 8px 0 10px;
  color: var(--color-text-light);
  font-size: 13px;
}
.capacity-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.capacity-item svg { flex-shrink: 0; }

/* Rental days / daily rate line */
.vehicle-card-rate {
  font-size: 14px;
  margin: 6px 0 8px;
  color: var(--color-text);
}
.vehicle-card-rate-sep {
  margin: 0 8px;
  color: var(--color-border);
}

/* Feature list ($0.00 inclusions with + sign) */
.vehicle-card-features {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  font-size: 13px;
  color: var(--color-text-light);
}
.vehicle-card-features li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 3px;
  line-height: 1.4;
}
.vehicle-card-features li::before {
  content: '+';
  position: absolute;
  left: 2px;
  top: 0;
  color: var(--color-success);
  font-weight: 700;
  font-size: 14px;
}
.vehicle-card-feature-price {
  font-weight: 700;
  color: var(--color-text);
}

/* Non-zero mandatory fees */
.vehicle-card-fees {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  font-size: 12px;
  color: var(--color-text-light);
}
.vehicle-card-fees li { margin-bottom: 2px; }

/* Availability messages */
.vehicle-card-limited {
  color: #c87500;
  font-weight: 600;
  font-size: 13px;
  margin: 8px 0 0;
}
.vehicle-card-unavailable {
  color: var(--color-error, #c0392b);
  font-weight: 600;
  font-size: 13px;
  margin: 8px 0 0;
}

/* Footer with total + select */
.vehicle-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.vehicle-card-total-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-text-light);
  text-transform: uppercase;
}
.vehicle-card-total-value {
  font-size: 20px;
  color: var(--color-primary);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.badge-limited {
  background: #fef9c3;
  color: #854d0e;
}

.badge-unavailable {
  background: #fee2e2;
  color: #991b1b;
}

/* Price breakdown */
.price-breakdown {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
}

.price-line {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 4px 0;
  color: var(--color-text-light);
}

.price-line.total {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  border-top: 1px solid var(--color-border);
  margin-top: 8px;
  padding-top: 8px;
}

/* Extras */
.extras-group {
  margin-bottom: 24px;
}

.extras-group h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-border);
}

.extra-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.extra-item:last-child { border-bottom: none; }

.extra-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}

.extra-item-info {
  flex: 1;
}

.extra-item-name {
  font-weight: 500;
  font-size: 14px;
}

.extra-item-price {
  font-size: 13px;
  color: var(--color-text-light);
}

.extra-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-white);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-value {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
}

/* Insurance options */
.insurance-options {
  display: grid;
  gap: 12px;
}

.insurance-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.insurance-card.selected {
  border-color: var(--color-primary);
  background: #fdf4ef;
}

.insurance-card input[type="radio"] {
  margin: 3px 0 0;
  flex-shrink: 0;
}

.insurance-card-body {
  flex: 1;
  min-width: 0;
}

.insurance-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.insurance-card-name {
  font-weight: 700;
  font-size: 15px;
}

.insurance-card-rate {
  font-weight: 500;
  color: var(--color-text-light);
  margin-left: 4px;
}

.insurance-card-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}

.insurance-card-desc {
  font-size: 13px;
  color: var(--color-text-light);
  line-height: 1.45;
  margin: 6px 0 0;
}

.insurance-card-excess {
  font-size: 13px;
  color: var(--color-error);
  margin: 4px 0 0;
}

/* Typed date field — text input with calendar button + hidden picker */
.date-field-wrap {
  position: relative;
  display: block;
}

.date-field-wrap input[type="text"] {
  width: 100%;
  padding-right: 40px; /* room for the calendar button */
}

.date-field-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--color-text);
  opacity: 0.7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.date-field-btn:hover {
  opacity: 1;
  color: var(--color-primary-hover);
  background: rgba(0, 0, 0, 0.04);
}

.date-field-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  opacity: 1;
}

/* Inline checkbox-with-text label inside a form-group (e.g. "My licence has no expiry date") */
.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: normal;
  text-transform: none;
  color: var(--color-text);
  opacity: 0.85;
  cursor: pointer;
  margin: 0;
}

.inline-check input[type="checkbox"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}

/* Hidden native date input — used purely as a picker source via showPicker() */
.date-field-wrap input[type="date"] {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  opacity: 0;
  pointer-events: none;
  border: none;
  padding: 0;
  background: transparent;
}

/* Payment iframe */
.payment-iframe-wrap {
  background: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 500px;
}

.payment-iframe-wrap iframe {
  width: 100%;
  min-height: 500px;
  border: none;
  display: block;
}

/* Generic confirm modal (e.g. Limited Availability prompt on vehicle select) */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.confirm-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.confirm-overlay-dialog {
  position: relative;
  z-index: 1;
  background: var(--color-white, #fff);
  border-radius: var(--radius, 8px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  width: min(480px, 100%);
  padding: 24px;
}

.confirm-overlay-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text, #484332);
}

.confirm-overlay-body {
  margin: 0 0 20px;
  line-height: 1.55;
  color: var(--color-text, #484332);
}

.confirm-overlay-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

/* `body[data-btn-align="full-width"]` (specificity 0,2,1) forces all .btn-primary to
   100% width on the page. The modal needs Cancel + Continue side-by-side, so we beat
   that selector with an attribute-prefixed rule (specificity 0,3,1). */
.confirm-overlay-actions .btn,
body[data-btn-align] .confirm-overlay-actions .btn {
  min-width: 110px;
  width: auto;
  flex: 0 0 auto;
}

@media (max-width: 480px) {
  .confirm-overlay-actions { flex-direction: column-reverse; }
  .confirm-overlay-actions .btn { width: 100%; flex: 1 1 auto; }
}

/* Payment overlay — modal on desktop, full-screen on mobile */
.payment-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.payment-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.payment-overlay-dialog {
  position: relative;
  z-index: 1;
  background: var(--color-white, #fff);
  border-radius: var(--radius, 8px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  width: min(720px, calc(100% - 32px));
  height: min(820px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.payment-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border, #e2d4c1);
  flex: 0 0 auto;
}

.payment-overlay-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text, #484332);
  padding: 0 8px;
  border-radius: 4px;
}

.payment-overlay-close:hover {
  background: var(--color-border, #e2d4c1);
}

.payment-overlay .payment-iframe-wrap {
  flex: 1 1 auto;
  min-height: 0; /* allow flex to shrink instead of forcing a nested scrollbar */
  border-radius: 0;
  overflow: hidden; /* iframe owns its own scroll context */
}

.payment-overlay .payment-iframe-wrap iframe {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: none;
  display: block;
}

body.payment-open {
  overflow: hidden;
}

/* Mobile: full-screen takeover — iframe needs the whole viewport for card/CVV fields */
@media (max-width: 768px) {
  .payment-overlay-dialog {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  .payment-overlay .payment-iframe-wrap iframe {
    height: 100%;
    min-height: 0;
  }
}

/* Utility */
.loading {
  text-align: center;
  padding: 48px 0;
  color: var(--color-text-light);
  font-size: 15px;
}

.error-msg {
  background: #fee2e2;
  color: var(--color-error);
  padding: 16px;
  border-radius: var(--radius);
  margin: 16px 0;
}

.success-msg {
  background: #d1fae5;
  color: var(--color-success);
  padding: 16px;
  border-radius: var(--radius);
  margin: 16px 0;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 16px;
}

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.text-small { font-size: 13px; color: var(--color-text-light); }
.text-right { text-align: right; }

/* ============================================================
   THEME VARIANTS — driven by data attributes set by applyTheme()
   ============================================================ */

/* --- Hero / Header ----------------------------------------- */

.site-hero {
  position: relative;
  min-height: 240px;
  background: var(--color-secondary, #484332);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.site-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.site-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  transition: opacity 0.2s;
}

.site-hero-content {
  position: relative;
  z-index: 1;
  padding: 32px 16px;
  width: 100%;
}

.site-hero-content img {
  max-height: 80px;
  width: auto;
  display: block;
}

.site-hero-title {
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  margin: 12px 0 4px;
  line-height: 1.2;
}

.site-hero-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  margin: 0;
}

/* Hero display modes */
body[data-hero-mode="plain"] .site-hero { display: none; }
body[data-hero-mode="plain"] #site-header-plain { display: block !important; }
body[data-hero-mode="image-only"] .site-hero-overlay { display: none; }

/* Overlay strength */
body[data-hero-overlay="none"] .site-hero-overlay { opacity: 0; }
body[data-hero-overlay="light"] .site-hero-overlay { opacity: 0.2; }
body[data-hero-overlay="medium"] .site-hero-overlay { opacity: 0.45; }
body[data-hero-overlay="dark"] .site-hero-overlay { opacity: 0.68; }

/* Logo position */
body[data-logo-pos="center"] .site-hero-content { text-align: center; }
body[data-logo-pos="center"] .site-hero-content img { margin: 0 auto; }
body[data-logo-pos="left"] .site-hero-content { text-align: left; }

/* --- Page width -------------------------------------------- */
body[data-page-width="narrow"] .container { max-width: 720px; }
body[data-page-width="standard"] .container { max-width: 960px; }
body[data-page-width="wide"] .container { max-width: 1200px; }

/* --- Density ----------------------------------------------- */
body[data-density="compact"] .card { padding: 16px; }
body[data-density="compact"] .form-group { margin-bottom: 10px; }
body[data-density="spacious"] .card { padding: 36px; }
body[data-density="spacious"] .form-group { margin-bottom: 24px; }

/* --- Section style ----------------------------------------- */
body[data-section-style="flat"] .card {
  box-shadow: none;
  border-radius: 0;
  border-bottom: 1px solid var(--color-border);
}
body[data-section-style="bordered"] .card {
  box-shadow: none;
  border: 1px solid var(--color-border);
}

/* --- Step navigation --------------------------------------- */

/* Pills */
body[data-step-nav="numbered-pills"] .steps ol {
  justify-content: center;
  gap: 6px;
}
body[data-step-nav="numbered-pills"] .steps .step {
  border: none;
  border-radius: 100px;
  padding: 6px 16px 6px 10px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
body[data-step-nav="numbered-pills"] .steps .step::before {
  content: attr(data-step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0,0,0,0.08);
  color: inherit;
}
body[data-step-nav="numbered-pills"] .steps .step.active {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}
body[data-step-nav="numbered-pills"] .steps .step.active::before {
  background: rgba(255,255,255,0.25);
}
body[data-step-nav="numbered-pills"] .steps .step.done {
  background: var(--color-success);
  color: var(--color-white);
  border-color: var(--color-success);
}
body[data-step-nav="numbered-pills"] .steps .step.done::before {
  background: rgba(255,255,255,0.25);
}

/* Progress bar */
body[data-step-nav="progress-bar"] .steps ol {
  position: relative;
  align-items: center;
}
body[data-step-nav="progress-bar"] .steps ol::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 12%;
  right: 12%;
  height: 2px;
  background: var(--color-border);
  transform: translateY(-50%);
}

/* Active emphasis variants */
body[data-step-emphasis="underline"] .steps .step.active {
  border-bottom: 3px solid var(--color-accent, var(--color-primary));
  color: var(--color-accent, var(--color-primary));
}
body[data-step-emphasis="bordered"] .steps .step.active {
  color: var(--color-accent, var(--color-primary));
  border-bottom-color: var(--color-accent, var(--color-primary));
  outline: 2px solid var(--color-accent, var(--color-primary));
  outline-offset: -2px;
  border-radius: 4px;
}
/* Re-assert pill text — extra [data-step] attr raises specificity above emphasis rules.
   Only applies to pills (which have a filled background); tabs use the default active color. */
body[data-step-nav="numbered-pills"] .steps .step.active[data-step] { color: var(--color-white); }

/* --- Input style ------------------------------------------- */
body[data-input-style="filled"] .form-group input,
body[data-input-style="filled"] .form-group select {
  background: rgba(0, 0, 0, 0.06);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius);
}
body[data-input-style="filled"] .form-group input:focus,
body[data-input-style="filled"] .form-group select:focus {
  background: rgba(0, 0, 0, 0.09);
  border-bottom-color: var(--color-primary);
  outline: none;
}
body[data-input-style="minimal"] .form-group input,
body[data-input-style="minimal"] .form-group select {
  border: none;
  border-bottom: 2px solid var(--color-border);
  border-radius: 0;
  padding-left: 0;
  background: transparent;
}
body[data-input-style="minimal"] .form-group input:focus,
body[data-input-style="minimal"] .form-group select:focus {
  border-bottom-color: var(--color-primary);
  outline: none;
}

/* --- Input shape ------------------------------------------- */
body[data-input-shape="square"] .form-group input,
body[data-input-shape="square"] .form-group select {
  border-radius: 0;
}
body[data-input-shape="pill"] .form-group input,
body[data-input-shape="pill"] .form-group select {
  border-radius: 100px;
  padding-left: 18px;
}

/* --- Button style ------------------------------------------ */
body[data-btn-style="outline"] .btn-primary {
  background: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
}
body[data-btn-style="outline"] .btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: var(--color-white);
}

/* --- Button shape ------------------------------------------ */
body[data-btn-shape="square"] .btn { border-radius: 0; }
body[data-btn-shape="pill"] .btn { border-radius: 100px; }

/* --- Button size ------------------------------------------- */
body[data-btn-size="large"] .btn {
  padding: 14px 28px;
  font-size: 17px;
}

/* --- Button alignment -------------------------------------- */
body[data-btn-align="full-width"] .btn-primary { width: 100%; }

/* --- Vehicle card layouts ---------------------------------- */

/* Compact list */
body[data-card-layout="compact-list"] .vehicle-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
body[data-card-layout="compact-list"] .vehicle-card {
  display: flex;
  align-items: center;
  gap: 0;
}
body[data-card-layout="compact-list"] .vehicle-card img {
  width: 120px;
  height: 80px;
  flex-shrink: 0;
}
body[data-card-layout="compact-list"] .vehicle-card-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Image left (default horizontal card layout) */
body[data-card-layout="image-left"] .vehicle-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
body[data-card-layout="image-left"] .vehicle-card {
  display: flex;
}
body[data-card-layout="image-left"] .vehicle-card img {
  width: 200px;
  height: 140px;
  flex-shrink: 0;
}
body[data-card-layout="image-left"] .vehicle-card-body {
  flex: 1;
  padding: 16px;
}

/* Image top (default grid) */
body[data-card-layout="image-top"] .vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 16px;
}
body[data-card-layout="image-top"] .vehicle-card img {
  width: 100%;
  height: 180px;
}

/* Price emphasis */
body[data-card-price="subtle"] .vehicle-card-price {
  font-size: 16px;
  font-weight: 600;
}
body[data-card-price="strong"] .vehicle-card-price {
  font-size: 26px;
  font-weight: 900;
}

/* --- Two-column layout base -------------------------------- */
.booking-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

body[data-structure="two-column"] .booking-main {
  grid-template-columns: 1fr 320px;
}

body[data-structure="two-column"] .booking-summary-wrap {
  position: sticky;
  top: 16px;
}

@media (max-width: 768px) {
  .booking-main { grid-template-columns: 1fr !important; }
  .booking-summary-wrap { position: static !important; }
}

/* --- Summary page action selector (Email Quote / Make Request / Book Now) -- */
.action-selector {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 16px 0;
  flex-wrap: wrap;
}

.action-selector .action-tab {
  flex: 1 1 auto;
  min-width: 140px;
  max-width: 240px;
  padding: 10px 18px;
  background: #fff;
  color: var(--color-text, #484332);
  border: 2px solid var(--color-border, #e2d4c1);
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.action-selector .action-tab:hover {
  border-color: var(--color-primary-hover);
  color: var(--color-primary-hover);
}

.action-selector .action-tab.active,
.action-selector .action-tab.action-tab-primary {
  background: var(--color-primary, #a34836);
  color: #fff;
  border-color: var(--color-primary, #a34836);
}

.action-selector .action-tab.action-tab-primary:hover,
.action-selector .action-tab.active:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: #fff;
}

@media (max-width: 480px) {
  .action-selector { flex-direction: column; }
  .action-selector .action-tab { max-width: none; }
}

/* --- Card CTA style ---------------------------------------- */
body[data-card-cta="outline"] .btn-card-cta {
  background: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
}
body[data-card-cta="outline"] .btn-card-cta:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: var(--color-white);
}

/* --- Summary emphasis -------------------------------------- */
body[data-summary-emphasis="highlighted"] .booking-summary {
  border: 2px solid var(--color-primary);
}
body[data-summary-emphasis="accent-top"] .booking-summary {
  border-top: 4px solid var(--color-accent, var(--color-primary));
}

/* --- Extras layout ----------------------------------------- */
body[data-extras-layout="two-column"] .extras-group .extra-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Extras group style: cards */
body[data-extras-group="cards"] .extras-group {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

/* --- Search summary (shown on Select Vehicle page) --------- */
.search-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 4px 0 16px;
  font-size: 13px;
  color: var(--color-text);
}
.search-summary-item {
  display: inline-flex;
  align-items: center;
}
.search-summary-item:not(:last-child)::after {
  content: '\2022';
  margin-left: 16px;
  color: var(--color-border);
}

/* --- Trust bar --------------------------------------------- */
.trust-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
  border-top: 1px solid var(--color-border);
  margin-top: 24px;
  font-size: 13px;
  color: var(--color-text-light);
}
.trust-item {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  text-align: left;
}
.trust-item::before {
  content: '\2713';
  color: var(--color-success);
  font-weight: 700;
  flex-shrink: 0;
  line-height: inherit;
}
.trust-icons::before, .trust-icon-item::before { content: none; }
.trust-icons, .trust-icon-item { align-items: center; }
.trust-payment-img { height: 24px; width: auto; }
.trust-secure-img { height: 36px; width: auto; }

@media (max-width: 600px) {
  .trust-bar { flex-direction: column; gap: 10px; text-align: center; }
  .trust-item {
    display: block;
    max-width: 100%;
    text-align: center;
  }
  .trust-item::before {
    display: inline;
    margin-right: 4px;
  }
}

/* --- Responsive -------------------------------------------- */
@media (max-width: 768px) {
  .site-hero { min-height: 160px; }
  .site-hero-title { font-size: 20px; }
  body[data-card-layout="image-left"] .vehicle-card { flex-direction: column; }
  body[data-card-layout="image-left"] .vehicle-card img { width: 100%; height: 180px; }
  body[data-step-nav="numbered-pills"] .steps .step { padding: 5px 10px; font-size: 12px; }
}

@media (max-width: 600px) {
  /* Tighter container on small phones */
  .container { padding: 0 12px; }

  /* Reduce card padding */
  .card { padding: 16px; }

  /* Vehicle card Select button — cap at 60% width on mobile */
  .vehicle-card-footer .btn-card-cta {
    max-width: 60%;
    margin-left: auto;
  }

  /* Override spacious density — too much padding on mobile */
  body[data-density="spacious"] .card { padding: 20px; }
  body[data-density="spacious"] .form-group { margin-bottom: 16px; }

  /* Step bar — compact */
  .steps { margin: 12px 0; }
  .steps .step {
    font-size: 11px;
    padding: 8px 2px;
    line-height: 1.3;
  }

  /* Section title row already flex-wraps; just tighten spacing */
  .section-title { font-size: 17px; margin-bottom: 12px; }

  /* Vehicle grid — force single column on small phones */
  .vehicle-grid { grid-template-columns: 1fr; }

  /* Compact-list card — smaller image on very narrow screens */
  body[data-card-layout="compact-list"] .vehicle-card img { width: 90px; height: 64px; }

  /* Larger touch targets for qty steppers */
  .qty-btn { width: 36px; height: 36px; }

  /* Insurance cards — tighten padding */
  .insurance-card { padding: 12px; }

  /* Price breakdown */
  .price-breakdown { padding: 12px; }

  /* Footer */
  .site-footer { margin-top: 24px; }

  /* Hero */
  .site-hero { min-height: 120px; }
  .site-hero-title { font-size: 18px; }
  .site-hero-subtitle { font-size: 14px; }
  .site-hero-content { padding: 20px 12px; }
}
