/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  /* Colors — KAN's General Store Design System */
  --color-primary: #2C1810;
  --color-secondary: #5C3A2E;
  --color-accent: #D4872C;
  --color-accent-hover: #B8711F;
  --color-accent-dark: #A65E10;
  --color-accent-light: #F0B86A;
  --color-background: #FAF6F1;
  --color-surface: #F0EAE0;
  --color-text: #1A1412;
  --color-text-muted: #6B5D54;
  --color-border: #D6CCC2;
  --color-muted-dark: #C4B8AC;

  /* Animation tokens */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --duration-micro: 150ms;
  --duration-small: 200ms;
  --duration-medium: 400ms;
  --duration-large: 500ms;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(44, 24, 16, 0.08);
  --shadow-md: 0 4px 12px rgba(44, 24, 16, 0.1);
  --shadow-lg: 0 8px 24px rgba(44, 24, 16, 0.12);

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* ===== BASE ===== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 400;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* ===== SKIP TO CONTENT ===== */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.75rem 1.5rem;
  background: var(--color-accent);
  color: var(--color-background);
  z-index: 100;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) 0;
  transition: top 0.2s ease;
}
.skip-to-content:focus {
  top: 0;
}

/* ===== SELECTION ===== */
::selection {
  background: var(--color-accent);
  color: var(--color-background);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-background); }
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: background-color 300ms var(--ease-standard),
              backdrop-filter 300ms var(--ease-standard),
              box-shadow 300ms var(--ease-standard);
}
.navbar-scrolled {
  background-color: rgba(44, 24, 16, 0.95) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 8px rgba(44, 24, 16, 0.3);
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  background-size: cover;
  background-position: center top;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(44, 24, 16, 1) 0%,
    rgba(44, 24, 16, 0.85) 25%,
    rgba(44, 24, 16, 0.4) 60%,
    rgba(44, 24, 16, 0.6) 100%
  );
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
}

/* Hero load sequence */
.hero-eyebrow { animation: fade-up var(--duration-large) var(--ease-out) 0.3s both; }
.hero-headline { animation: clip-reveal var(--duration-large) var(--ease-out) 0.45s both; }
.hero-subheadline { animation: fade-up var(--duration-large) var(--ease-out) 0.6s both; }
.hero-cta { animation: fade-up var(--duration-large) var(--ease-out) 0.75s both; }
.hero-badge { animation: fade-up var(--duration-large) var(--ease-out) 0.9s both; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes clip-reveal {
  from {
    clip-path: inset(0 100% 0 0);
    opacity: 0;
  }
  to {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}

/* Distance badge */
.distance-badge {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  z-index: 2;
}
@media (max-width: 767px) {
  .distance-badge {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    text-align: center;
  }
}

/* ===== GRAIN TEXTURE ===== */
.grain-texture::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
  z-index: 0;
}

/* ===== AMBER LANE MARKER ===== */
.lane-marker::before {
  content: '';
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
  margin-bottom: 12px;
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  background-color: var(--color-accent);
  color: var(--color-primary);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: var(--radius-sm);
  border: none;
  min-height: 48px;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--duration-small) var(--ease-out),
              box-shadow var(--duration-small) var(--ease-out),
              background-color var(--duration-small) var(--ease-out);
}
.btn-primary:hover {
  transform: translateY(-2px);
  background-color: var(--color-accent-hover);
  box-shadow: 0 4px 12px rgba(212, 135, 44, 0.25);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  background-color: transparent;
  color: var(--color-accent);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-accent);
  min-height: 48px;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--duration-small) var(--ease-out),
              background-color var(--duration-small) var(--ease-out),
              color var(--duration-small) var(--ease-out),
              border-color var(--duration-small) var(--ease-out);
}
.btn-secondary:hover {
  transform: translateY(-1px);
  background-color: var(--color-accent);
  color: var(--color-primary);
  border-color: var(--color-accent);
}
.btn-secondary:active {
  transform: translateY(0);
}
.btn-secondary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ===== CARDS ===== */
.card {
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  transition: transform var(--duration-small) var(--ease-out),
              box-shadow var(--duration-small) var(--ease-out),
              border-color var(--duration-small) var(--ease-out);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

.card-dark {
  background: var(--color-secondary);
  border: none;
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity var(--duration-medium) var(--ease-out),
              transform var(--duration-medium) var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-fade {
  opacity: 0;
  transition: opacity var(--duration-large) var(--ease-out);
}
.reveal-fade.visible {
  opacity: 1;
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.97);
  transition: opacity var(--duration-large) var(--ease-out),
              transform var(--duration-large) var(--ease-out);
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* ===== STAGGER ITEMS ===== */
.stagger-item {
  opacity: 0;
  transform: translateY(15px);
}
.stagger-item.visible {
  animation: stagger-in var(--duration-medium) var(--ease-out) forwards;
}
.stagger-item:nth-child(1) { animation-delay: 0ms; }
.stagger-item:nth-child(2) { animation-delay: 100ms; }
.stagger-item:nth-child(3) { animation-delay: 200ms; }
.stagger-item:nth-child(4) { animation-delay: 300ms; }
.stagger-item:nth-child(5) { animation-delay: 400ms; }
.stagger-item:nth-child(6) { animation-delay: 500ms; }
.stagger-item:nth-child(7) { animation-delay: 600ms; }
.stagger-item:nth-child(8) { animation-delay: 700ms; }

@keyframes stagger-in {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== NAV LINK HOVER ===== */
.nav-link {
  position: relative;
  transition: color var(--duration-small) var(--ease-out);
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--duration-small) var(--ease-out);
}
.nav-link:hover::after {
  width: 100%;
}

/* ===== FOOTER LINK ===== */
.footer-link {
  transition: color var(--duration-micro) var(--ease-out);
}
.footer-link:hover {
  color: var(--color-accent);
}

/* ===== FORM INPUTS ===== */
input, textarea, select {
  transition: border-color var(--duration-micro) var(--ease-standard),
              box-shadow var(--duration-micro) var(--ease-standard);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--color-accent) !important;
  box-shadow: 0 0 0 2px rgba(212, 135, 44, 0.3);
  outline: none;
}

/* Focus visible for all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ===== BENTO GRID ===== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto;
  gap: 1.5rem;
}
@media (min-width: 640px) and (max-width: 767px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 639px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== HIGHWAY STOP IMAGE BREAKOUT ===== */
.image-breakout {
  border-radius: 12px 0 0 12px;
  margin-right: -5vw;
  width: calc(100% + 5vw);
  object-fit: cover;
  box-shadow: -8px 0 24px rgba(44, 24, 16, 0.3);
}
@media (max-width: 767px) {
  .image-breakout {
    border-radius: 12px;
    margin-right: 0;
    width: 100%;
    box-shadow: none;
  }
}

/* ===== TESTIMONIAL HORIZONTAL SCROLL (mobile) ===== */
@media (max-width: 767px) {
  .testimonial-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding-bottom: 1rem;
  }
  .testimonial-scroll > * {
    scroll-snap-align: start;
    min-width: 85vw;
    flex-shrink: 0;
  }
}

/* ===== HOURS TABLE ===== */
.hours-table tr {
  border-bottom: 1px solid rgba(214, 204, 194, 0.15);
}
.hours-table .weekend {
  background: rgba(92, 58, 46, 0.5);
}

/* ===== COOKIE CONSENT BANNER ===== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--color-primary);
  border-top: 1px solid rgba(212, 135, 44, 0.3);
  padding: 1rem 1.5rem;
  transform: translateY(100%);
  transition: transform 400ms var(--ease-out);
}
.cookie-banner.show {
  transform: translateY(0);
}

/* ===== MOBILE CLICK-TO-CALL BAR ===== */
.mobile-call-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  height: 56px;
  background: rgba(44, 24, 16, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  transform: translateY(100%);
  transition: transform 300ms var(--ease-out);
}
.mobile-call-bar.show {
  transform: translateY(0);
}
@media (max-width: 767px) {
  .mobile-call-bar {
    display: flex;
  }
}

/* ===== MOBILE MENU ===== */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 24, 16, 0.6);
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms var(--ease-standard);
}
.mobile-menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 80%;
  max-width: 320px;
  background: var(--color-primary);
  z-index: 56;
  transform: translateX(100%);
  transition: transform 300ms var(--ease-out);
  overflow-y: auto;
}
.mobile-menu.active {
  transform: translateX(0);
}

/* ===== MAP FALLBACK ===== */
.map-fallback {
  background: var(--color-secondary);
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  aspect-ratio: 4/3;
  text-align: center;
  padding: 2rem;
}

/* ===== SMALL MOBILE (480px and below) ===== */
@media (max-width: 480px) {
  /* 1. Reduced section padding */
  section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  /* 2. Container padding tightened */
  .max-w-6xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* 3. Smaller heading font sizes */
  h1 {
    font-size: 1.75rem !important;
  }
  h2 {
    font-size: 1.5rem !important;
  }
  h3 {
    font-size: 1.05rem !important;
  }

  /* 4. Hero text sizing */
  .hero {
    min-height: 85vh;
  }
  .hero-content {
    padding-bottom: 4.5rem;
  }

  /* 5. Bento grid single column with reduced gap */
  .bento-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* 6. Card padding reduced */
  .card {
    padding: 16px;
  }

  /* 7. Trust bar / stats vertical stack */
  .trust-bar,
  .flex-wrap.gap-6,
  .flex-wrap.gap-8 {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  /* 8. Testimonial cards sizing */
  .testimonial-scroll > * {
    min-width: 90vw;
    padding: 1.25rem;
  }

  /* 9. Distance badge positioning */
  .distance-badge {
    bottom: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    font-size: 0.8rem;
  }

  /* 10. Button sizing */
  .btn-primary,
  .btn-secondary {
    padding: 12px 20px;
    font-size: 0.9rem;
    width: 100%;
  }

  /* 11. Contact form field sizing */
  input,
  textarea,
  select {
    font-size: 16px;
    padding: 10px 12px;
  }

  /* 12. Footer layout adjustments */
  footer .grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }
  footer .flex {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  /* 13. Image breakout reset */
  .image-breakout {
    border-radius: 8px;
    margin-right: 0;
    width: 100%;
  }

  /* 14. Hours table compact */
  .hours-table td {
    padding: 0.35rem 0.25rem;
    font-size: 0.9rem;
  }

  /* 15. Map aspect ratio taller for small screens */
  .map-fallback {
    aspect-ratio: 1/1;
    padding: 1rem;
  }

  /* 16. Cookie banner compact */
  .cookie-banner {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }

  /* 17. Mobile menu full-width */
  .mobile-menu {
    width: 100%;
    max-width: 100%;
  }

  /* 18. Reduce gap in grid layouts */
  .grid {
    gap: 1rem;
  }
}

/* ===== 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;
  }
  .reveal, .reveal-fade, .reveal-scale, .stagger-item {
    opacity: 1;
    transform: none;
    clip-path: none;
  }
  .hero-eyebrow, .hero-headline, .hero-subheadline, .hero-cta, .hero-badge {
    opacity: 1;
    transform: none;
    clip-path: none;
  }
  html {
    scroll-behavior: auto;
  }
  .cookie-banner {
    transform: none;
  }
  .mobile-call-bar {
    transform: none;
  }
}
