/* =============================================
   EuroCustomAutos — Main Stylesheet
   Design language: Concrete & Volt
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=Barlow:wght@400;500&display=swap');

/* --- Design tokens --- */
:root {
  --concrete:  #E8E4DC;
  --volt:      #D4FF00;
  --asphalt:   #1A1A1A;
  --graphite:  #5C5852;   /* secondary/body text on light — WCAG AA */
  --dust:      #7A7670;   /* captions/eyebrows/large text only (3.6:1 on concrete) */
  --offwhite:  #F5F1E8;

  /* Derived */
  --border:        rgba(26,26,26,0.12);
  --border-strong: rgba(26,26,26,0.25);
  --asphalt-2:     #2A2A2A;   /* card surface on dark mode */
  --asphalt-hover: #2E2E2E;
  --dust-dark:     #A8A39B;   /* secondary text on dark surfaces */

  /* Functional — feedback states only, never brand accents */
  --oxide: #8F3B2C;   /* error */
  --moss:  #3E5F3E;   /* success */
  --brass: #7A5A1E;   /* warning / low stock */

  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'Barlow', sans-serif;

  --radius:    6px;
  --radius-pill: 999px;
  --transition: 0.2s ease;

  --nav-height: 68px;
  --container:  1200px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--concrete);
  color: var(--asphalt);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* --- Layout utilities --- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section    { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.rule       { border: none; border-top: 1px solid var(--border); margin: 0; }

/* --- Section header --- */
.section-header { margin-bottom: 48px; }
.section-header.centered { text-align: center; }

.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dust);
  display: block;
  margin-bottom: 12px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  color: var(--asphalt);
}

.section-header p {
  margin-top: 16px;
  font-size: 18px;
  color: var(--graphite);
  max-width: 520px;
  line-height: 1.7;
}
.section-header.centered p { margin-left: auto; margin-right: auto; }

/* --- Tag / badge --- */
.tag-pill {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--asphalt);
  color: var(--concrete);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}
.tag-pill.volt {
  background: var(--volt);
  color: var(--asphalt);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  padding: 12px 28px;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.btn-primary {
  background: var(--asphalt);
  color: var(--concrete);
  border: 1px solid var(--asphalt);
}
.btn-primary:hover { background: var(--asphalt-hover); border-color: var(--asphalt-hover); }

.btn-ghost {
  background: transparent;
  color: var(--asphalt);
  border: 1px solid var(--asphalt);
}
.btn-ghost:hover { background: var(--concrete); }

/* Volt underline link — inline, no bg */
.volt-link {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  color: var(--asphalt);
  border-bottom: 2px solid var(--volt);
  padding-bottom: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color var(--transition);
}
.volt-link:hover { border-color: var(--asphalt); }

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: var(--concrete);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}
.nav.scrolled {
  background: var(--asphalt);
  border-color: transparent;
}
.nav.scrolled .nav-logo-main,
.nav.scrolled .nav-links a,
.nav.scrolled .nav-logo-sub { color: var(--concrete); }
.nav.scrolled .nav-links a:hover { color: var(--volt); }
.nav.scrolled .nav-links a.active { color: var(--volt); }
.nav.scrolled .nav-links a.active::after,
.nav.scrolled .nav-links a:hover::after { background: var(--volt); }
.nav.scrolled .nav-cart { border-color: rgba(255,255,255,0.2); color: var(--concrete); }
.nav.scrolled .nav-cart:hover { border-color: var(--volt); color: var(--volt); }
.nav.scrolled .btn-primary { background: var(--concrete); color: var(--asphalt); border-color: var(--concrete); }
.nav.scrolled .btn-primary:hover { background: var(--offwhite); }
.nav.scrolled .nav-menu-btn span { background: var(--concrete); }

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo { display: flex; flex-direction: column; line-height: 1; }
.nav-logo-main {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.01em;
  color: var(--asphalt);
  transition: color var(--transition);
}
.nav-logo-main .volt-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--volt);
  border-radius: 50%;
  margin-left: 2px;
  vertical-align: middle;
  position: relative;
  top: -2px;
}
.nav-logo-sub {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dust);
  margin-top: 3px;
  transition: color var(--transition);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--graphite);
  transition: color var(--transition);
  position: relative;
  padding-bottom: 3px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--volt);
  transform: scaleX(0);
  transition: transform var(--transition);
  transform-origin: left;
}
.nav-links a:hover,
.nav-links a.active { color: var(--asphalt); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

/* Currency selector (CAD / USD display toggle) */
.currency-select select {
  height: 40px;
  padding: 0 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--graphite);
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.currency-select select:hover { border-color: var(--asphalt); color: var(--asphalt); }
.nav.scrolled .currency-select select { border-color: rgba(255,255,255,0.2); color: var(--concrete); }
.currency-select select option { color: var(--asphalt); background: var(--offwhite); }

.nav-cart {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  color: var(--graphite);
  transition: border-color var(--transition), color var(--transition);
}
.nav-cart:hover { border-color: var(--asphalt); color: var(--asphalt); }

.cart-count {
  position: absolute;
  top: -6px; right: -6px;
  width: 17px; height: 17px;
  background: var(--volt);
  color: var(--asphalt);
  font-size: 9px;
  font-weight: 700;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}
.cart-count.visible { opacity: 1; }

.nav-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 26px;
  padding: 4px 0;
}
.nav-menu-btn span {
  display: block;
  height: 2px;
  background: var(--asphalt);
  border-radius: 1px;
  transition: var(--transition);
}

/* Mobile nav — full-screen asphalt overlay */
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-height); left: 0; right: 0; bottom: 0;
  background: var(--asphalt);
  z-index: 999;
  padding: 32px 24px;
  flex-direction: column;
  gap: 0;
}
.nav-mobile a {
  padding: 18px 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  color: var(--concrete);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: color var(--transition);
}
.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile a:hover { color: var(--volt); }
.nav-mobile.open { display: flex; }

/* --- Page hero (inner pages) --- */
.page-hero {
  margin-top: var(--nav-height);
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
  background: var(--offwhite);
}
.page-hero .eyebrow { margin-bottom: 12px; }
.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1;
  color: var(--asphalt);
}
.page-hero p {
  margin-top: 12px;
  font-size: 18px;
  color: var(--graphite);
  max-width: 480px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--graphite);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--graphite); transition: color var(--transition); }
.breadcrumb a:hover { color: var(--asphalt); }

/* --- Footer --- */
.footer {
  background: var(--asphalt);
  color: var(--concrete);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand .footer-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--concrete);
  margin-bottom: 16px;
  display: block;
}
.footer-brand .footer-logo .volt-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--volt);
  border-radius: 50%;
  margin-left: 2px;
  vertical-align: middle;
  position: relative;
  top: -2px;
}
.footer-brand p {
  font-size: 14px;
  color: rgba(232,228,220,0.6);
  line-height: 1.7;
  max-width: 260px;
}
.footer-socials { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.footer-social-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  color: rgba(232,228,220,0.6);
  transition: border-color var(--transition), color var(--transition);
}
.footer-social-link svg { flex-shrink: 0; }
.footer-social-label {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  line-height: 1;
}
.footer-social-link:hover { border-color: var(--volt); color: var(--volt); }
.footer-col h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dust-dark);
  margin-bottom: 20px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col ul a {
  font-size: 14px;
  color: rgba(232,228,220,0.7);
  transition: color var(--transition);
}
.footer-col ul a:hover { color: var(--concrete); }
.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.footer-bottom p { font-size: 13px; color: var(--dust-dark); }
.footer-bottom a { color: rgba(232,228,220,0.75); transition: color var(--transition); }
.footer-bottom a:hover { color: var(--volt); }

/* --- Fulfillment toggle (cart drawer: pickup vs ship) --- */
/* iOS-style segmented slider: a track with a highlight that slides between the
   two options. Position is driven by [data-active] (set in js/main.js). */
.fulfillment-toggle {
  position: relative;
  display: flex;
  width: 100%;
  margin-bottom: 18px;
  padding: 4px;
  background: rgba(26,26,26,0.08);
  border-radius: var(--radius-pill);
}
/* the sliding highlight */
.fulfillment-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: var(--asphalt);
  border-radius: var(--radius-pill);
  transition: transform 0.28s cubic-bezier(0.4, 0.0, 0.2, 1);
  pointer-events: none;
}
.fulfillment-toggle[data-active="pickup"] .fulfillment-thumb { transform: translateX(100%); }
.fulfillment-opt {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  padding: 11px 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--graphite);
  background: transparent;
  border-radius: var(--radius-pill);
  transition: color 0.2s ease;
}
.fulfillment-opt:hover { color: var(--asphalt); }
.fulfillment-opt.active,
.fulfillment-opt.active:hover { color: var(--concrete); }

/* --- Toast --- */
#toast-container {
  position: fixed; bottom: 32px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-links, .nav-actions .btn { display: none; }
  .nav-menu-btn { display: flex; }
  .section { padding: 48px 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Accessibility (DESIGN.md v2.0) --- */
:focus-visible {
  outline: 2px solid var(--asphalt);
  outline-offset: 2px;
}
.footer :focus-visible,
.cta-banner :focus-visible,
.nav-mobile :focus-visible,
.nav.scrolled :focus-visible {
  outline-color: var(--volt);
}

@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;
  }
}

/* Footer legal / compatibility disclaimer */
.footer-disclaimer {
  font-size: 11px !important;
  color: var(--dust-dark) !important;
  line-height: 1.6;
  max-width: 720px;
  margin-top: 12px;
}

/* <picture> wrappers must not create a box of their own — otherwise the
   width/height:100% and object-fit rules written for `img` inside .product-page-stage,
   .product-page-thumb, .tile-img etc. would resolve against the wrapper instead
   of the real container. */
picture { display: contents; }
