/* =============================================================================
   main.css — shared stylesheet for all 12 static pages
   (Home, Pricing, FAQ) × (EN, ES, FR, CA)
   Matches the visual vocabulary of classic-rental-barcelona.com:
   dark editorial automotive aesthetic, Roboto, BMW-blue accent.
============================================================================= */

/* ---------- 1. Design tokens ---------- */

:root {
  /* colour */
  --color-bg: #121212;
  --color-bg-deep: #0a0a0a;
  --color-surface: rgba(255, 255, 255, 0.05);
  --color-surface-strong: rgba(255, 255, 255, 0.1);
  --color-border: rgba(255, 255, 255, 0.2);
  --color-divider: rgba(255, 255, 255, 0.1);
  --color-text: #f0f0f0;
  --color-text-muted: #aaaaaa;
  --color-accent: #0166B1;
  --color-accent-hover: #014d87;
  --color-accent-text: #4aa3df;    /* lighter BMW-blue for text on dark bg; WCAG AA ≥ 4.5:1 on all surfaces */
  --color-primary: #3498db;
  --color-secondary: #2980b9;
  --color-whatsapp: #0c7a22;       /* darkened from #10992B so white text hits WCAG AA */
  --color-whatsapp-hover: #086b1c;
  --color-error: #ff3860;
  --color-success: #48bb78;

  /* typography */
  --font-sans: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-base: 1rem;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.125rem;
  --font-size-h1: 3rem;        /* 48px */
  --font-size-h2: 2.25rem;     /* 36px */
  --font-size-h3: 1.5rem;      /* 24px */
  --font-size-h4: 1.25rem;     /* 20px */
  --line-height-body: 1.6;
  --line-height-tight: 1.2;

  /* spacing */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-section: 6.25rem;    /* 100px — matches live site section padding */

  /* layout */
  --container-max: 1200px;
  --container-pad: 1.25rem;    /* 20px */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-pill: 999px;

  /* motion */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;

  /* hero text glow from live site */
  --hero-text-shadow:
    0 0 1px #041d2b,
    0 0 2px #092d40,
    0 0 3px #0a2f42,
    0 0 5px #06212f,
    0 0 10px #062331;
}

/* ---------- 2. Reset ---------- */

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

body {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
}

img, picture, source, video {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font: inherit;
  cursor: pointer;
}

input, textarea, select {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Skip-to-content link — visible on keyboard focus only */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-accent);
  color: #ffffff;
  padding: var(--space-xs) var(--space-md);
  z-index: 1100;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  top: 0;
}

/* ---------- 3. Base typography ---------- */

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  line-height: var(--line-height-tight);
  font-weight: 600;
}

h1 {
  font-size: var(--font-size-h1);
  font-weight: 200;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: var(--font-size-h2);
  font-weight: 400;
  margin-bottom: var(--space-xl);
}

h3 {
  font-size: var(--font-size-h3);
  font-weight: 500;
  margin-bottom: var(--space-sm);
}

h4 {
  font-size: var(--font-size-h4);
  font-weight: 500;
  margin-bottom: var(--space-sm);
}

p {
  margin-bottom: var(--space-md);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-accent-text);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-accent);
}

strong, b {
  font-weight: 700;
}

/* section title pattern from live site */
.section-title {
  text-align: center;
  font-size: var(--font-size-h2);
  margin-bottom: var(--space-3xl);
  position: relative;
  padding-bottom: var(--space-lg);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: var(--color-accent);
}

/* ---------- 4. Layout utilities ---------- */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* Breadcrumb — inline horizontal list rendered above page <h1> */
.breadcrumb {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs);
  padding: 0;
  margin: 0 0 var(--space-md) 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
}

.breadcrumb li[aria-hidden="true"] {
  color: var(--color-border);
  user-select: none;
}

.breadcrumb a {
  color: var(--color-accent-text);
  text-decoration: none;
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
  color: var(--color-text);
  font-weight: 500;
}

.section {
  padding: var(--space-section) 0;
}

.section--deep {
  background-color: var(--color-bg-deep);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 5. Buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.75rem 1.875rem;      /* 12px 30px */
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: var(--font-size-base);
  letter-spacing: 0.0625em;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  transition:
    background-color var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base),
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

.btn--primary {
  background-color: var(--color-accent);
  color: #ffffff;
  border-color: var(--color-accent);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background-color: var(--color-accent-hover);
  color: #ffffff;
  border-color: var(--color-accent-hover);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.btn--secondary {
  background-color: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn--secondary:hover,
.btn--secondary:focus-visible {
  background-color: var(--color-surface-strong);
  border-color: var(--color-accent);
  color: #ffffff;
  transform: translateY(-3px);
}

.btn--whatsapp {
  background-color: var(--color-whatsapp);
  color: #ffffff;
  border-color: var(--color-whatsapp);
}

.btn--whatsapp:hover,
.btn--whatsapp:focus-visible {
  background-color: var(--color-whatsapp-hover);
  color: #ffffff;
  border-color: var(--color-whatsapp-hover);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.btn--block {
  display: block;
  width: 100%;
}

/* ---------- 6. Header + navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background-color: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-divider);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.0625em;
  color: var(--color-text);
}

.site-logo span {
  color: var(--color-accent-text);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-xl);
  align-items: center;
}

.nav-links a {
  color: var(--color-text);
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-accent-text);
}

/* Language switcher — compact pill group on the right */
.lang-switcher {
  display: flex;
  list-style: none;
  gap: var(--space-xs);
  margin-left: var(--space-md);
}

.lang-switcher a,
.lang-switcher span {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.0625em;
}

.lang-switcher a:hover,
.lang-switcher [aria-current="page"] {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: #ffffff;
}

/* ---------- 7. Hero ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 80vh;
  background-color: var(--color-bg-deep);
  overflow: hidden;
  padding: var(--space-3xl) 0;
}

/*
 * Hero media usage (WebP with JPG fallback):
 *   <picture class="hero__media">
 *     <source srcset="/assets/images/bmw-e21-stratosblau-hero-barcelona.webp" type="image/webp">
 *     <img src="/assets/images/bmw-e21-stratosblau-hero-barcelona.jpg" alt="…" width="1600" height="900">
 *   </picture>
 */
.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  display: block;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero h1,
.hero p {
  text-shadow: var(--hero-text-shadow);
}

.hero h1 {
  font-size: var(--font-size-h1);
  font-weight: 200;
}

.hero p {
  font-size: var(--font-size-lg);
  max-width: 600px;
  margin-bottom: var(--space-xl);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

/* ---------- 8. Use-case / feature cards grid ---------- */

.use-case-grid,
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
}

.use-case-card,
.feature-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

.use-case-card:hover,
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.use-case-card h3,
.feature-card h3 {
  color: var(--color-accent-text);
}

.use-case-card p,
.feature-card p {
  color: var(--color-text-muted);
}

/*
 * Use-case card thumbnail usage (WebP with JPG fallback):
 *   <picture class="use-case-card__img">
 *     <source srcset="/assets/images/bmw-e21-stratosblau-front-three-quarter-a.webp" type="image/webp">
 *     <img src="/assets/images/bmw-e21-stratosblau-front-three-quarter-a.jpg" alt="…" width="800" height="450">
 *   </picture>
 */
.use-case-card__img,
.feature-card__img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
  background-color: var(--color-surface);
}

.use-case-card__img img,
.feature-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- 9. Tables (Pricing rate grid) ---------- */

.rate-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: var(--font-size-base);
}

.rate-table caption {
  text-align: left;
  padding: var(--space-md) var(--space-lg);
  color: var(--color-text-muted);
  font-style: italic;
  caption-side: bottom;
}

.rate-table th,
.rate-table td {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  border-bottom: 1px solid var(--color-divider);
}

.rate-table thead th {
  background-color: rgba(255, 255, 255, 0.08);
  text-transform: uppercase;
  letter-spacing: 0.0625em;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  font-weight: 700;
}

.rate-table tbody tr:last-child th,
.rate-table tbody tr:last-child td {
  border-bottom: 0;
}

.rate-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.rate-table td.is-price,
.rate-table th.is-price {
  color: var(--color-accent-text);
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

/* ---------- 10. Description lists (FAQ + Specs) ---------- */

dl {
  display: block;
}

dl.faq-list dt,
dl.specs-list dt {
  font-weight: 700;
  color: var(--color-text);
  padding-top: var(--space-lg);
  padding-bottom: var(--space-xs);
  border-top: 1px solid var(--color-divider);
}

dl.faq-list dt:first-of-type,
dl.specs-list dt:first-of-type {
  border-top: 0;
  padding-top: 0;
}

dl.faq-list dd,
dl.specs-list dd {
  margin: 0 0 var(--space-lg) 0;
  color: var(--color-text-muted);
}

dl.faq-list dd:last-of-type,
dl.specs-list dd:last-of-type {
  margin-bottom: 0;
}

/* Specs variant: 2-column "label / value" pairs on wider screens */
dl.specs-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (min-width: 640px) {
  dl.specs-list {
    grid-template-columns: minmax(140px, 1fr) 2fr;
    column-gap: var(--space-lg);
  }

  dl.specs-list dt,
  dl.specs-list dd {
    padding: var(--space-md) 0;
    margin: 0;
    border-top: 1px solid var(--color-divider);
  }

  dl.specs-list dt:first-of-type,
  dl.specs-list dd:first-of-type {
    border-top: 0;
  }

  dl.specs-list dd {
    color: var(--color-accent-text);
    text-align: right;
  }
}

/* ---------- 11. Footer ---------- */

.site-footer {
  background-color: var(--color-bg-deep);
  padding: var(--space-2xl) 0 var(--space-lg);
  color: var(--color-text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-2xl);
}

.footer-col h3 {
  position: relative;
  color: var(--color-text);
  font-size: var(--font-size-h4);
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-md);
}

.footer-col h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background-color: var(--color-accent);
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: var(--space-xs);
}

.footer-col ul li a {
  color: var(--color-text-muted);
}

.footer-col ul li a:hover {
  color: var(--color-accent-text);
  padding-left: var(--space-2xs);
}

.site-footer__copyright {
  text-align: center;
  padding-top: var(--space-xl);
  margin-top: var(--space-xl);
  border-top: 1px solid var(--color-divider);
  font-size: var(--font-size-sm);
}

/* ---------- 12. Responsive breakpoints ---------- */

/* Mobile-first defaults sized for <640px. Scale up below. */
@media (max-width: 639.98px) {
  :root {
    --font-size-h1: 1.875rem;   /* 30px */
    --font-size-h2: 1.5rem;     /* 24px */
    --font-size-h3: 1.25rem;    /* 20px */
    --space-section: 3.75rem;   /* 60px */
  }

  .hero {
    min-height: 70vh;
    padding: var(--space-xl) 0;
  }

  .btn {
    padding: 0.625rem 1.25rem;
    font-size: var(--font-size-sm);
  }

  .site-nav {
    justify-content: center;
  }

  .nav-links {
    gap: var(--space-md);
    flex-wrap: wrap;
    justify-content: center;
  }

  .lang-switcher {
    margin-left: 0;
  }
}

@media (min-width: 640px) and (max-width: 959.98px) {
  :root {
    --font-size-h1: 2.25rem;    /* 36px */
    --font-size-h2: 1.875rem;   /* 30px */
    --space-section: 5rem;      /* 80px */
  }
}

@media (min-width: 960px) {
  :root {
    --font-size-h1: 3rem;
    --font-size-h2: 2.25rem;
  }
}

@media (min-width: 1200px) {
  :root {
    --font-size-h1: 3.5rem;     /* 56px — slightly larger on wide screens */
  }
}

/* ---------- 13. Reduced motion ---------- */

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

  .btn:hover,
  .use-case-card:hover,
  .feature-card:hover {
    transform: none;
  }
}

/* ---------- 14. Booking section — visual gap between contact list and mini-FAQ ---------- */

#booking ul + h3 {
  margin-top: var(--space-3xl);
}

/* ---------- 15. Lightbox (fullscreen gallery viewer) ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.93);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover,
.lightbox__close:focus-visible,
.lightbox__prev:focus-visible,
.lightbox__next:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  transform: scale(1.05);
}

.lightbox__close {
  top: 1rem;
  right: 1rem;
}

.lightbox__prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__prev:hover,
.lightbox__prev:focus-visible {
  transform: translateY(-50%) scale(1.05);
}

.lightbox__next:hover,
.lightbox__next:focus-visible {
  transform: translateY(-50%) scale(1.05);
}

.lightbox__figure {
  margin: 0;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox__media {
  display: block;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: 4px;
}

.lightbox__caption {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.875rem;
  padding: 1rem 0 0;
  text-align: center;
  max-width: 600px;
  line-height: 1.5;
}

.lightbox__counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  letter-spacing: 0.05em;
}

@media (max-width: 640px) {
  .lightbox {
    padding: 1rem;
  }

  .lightbox__prev,
  .lightbox__next {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }

  .lightbox__close {
    width: 40px;
    height: 40px;
    top: 0.5rem;
    right: 0.5rem;
  }
}
