/* ==========================================================================
   Design tokens
   ========================================================================== */

:root {
  /* Color — black/white/greyscale, plus a single dedicated error red for
     validation states (client demo requirement). Everything else on the
     site still stays within the greyscale palette. */
  --color-error: #dc2626;
  --color-black: #000000;
  --color-grey-900: #121212;
  --color-grey-800: #1e1e1e;
  --color-grey-700: #2e2e2e;
  --color-grey-600: #4a4a4a;
  --color-grey-500: #6b6b6b;
  --color-grey-400: #8f8f8f;
  --color-grey-300: #b5b5b5;
  --color-grey-200: #d4d4d4;
  --color-grey-100: #e8e8e8;
  --color-grey-50: #f5f5f5;
  --color-white: #ffffff;
  --color-bg-light: var(--color-white);

  /* Typography */
  --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-md: 1.125rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 2.5rem;
  --font-size-4xl: 3rem;

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  --line-height-tight: 1.2;
  --line-height-base: 1.5;
  --line-height-loose: 1.75;

  /* Spacing */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* Z-index */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  /* Fine-grained sub-layers for the store page's stack of sticky bars —
     header, then toolbar, then active-filter pills — each needing to sit
     above the one beneath it as the page scrolls, all still under
     --z-overlay. */
  --z-sticky-2: 280;
  --z-sticky-3: 290;
  --z-overlay: 300;
  --z-drawer: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-toast: 700;

  /* Breakpoints — documented here as the single source of truth, but
     media queries can't consume custom properties directly, so every
     @media (min-width: ...) literal across the codebase must still
     hardcode the matching pixel value below; update both together. */
  --bp-tablet: 700px;
  --bp-desktop: 1100px;
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

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

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-base);
  color: var(--color-black);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ==========================================================================
   Site footer
   ========================================================================== */

.site-footer {
  background-color: var(--color-black);
  color: var(--color-white);
  /* index.html's .scroll-container is a mandatory scroll-snap track (see
     hero.css) with .hero and .store-section as its only stops — without
     its own snap-align the footer would sit past the last stop and the
     browser could snap back up to .store-section before a user ever rests
     on it. On product.html there's no snap-type ancestor, so this is
     inert there. */
  scroll-snap-align: start;
  /* .hero stays position: sticky for the full height of .scroll-container
     and is only ever visually covered by a later sibling with its own
     stacking context — .store-section does this via z-index: 10, and the
     footer needs the same treatment or the still-stuck hero paints over
     it once scrolled into view. Inert on product.html (no sticky ancestor
     there to cover). */
  position: relative;
  z-index: 10;
}

.site-footer__inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--space-9) var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  text-align: center;
}

.site-footer__brand {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.2em;
}

.site-footer__social {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.site-footer__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.site-footer__link:hover {
  opacity: 1;
}

.site-footer__link:focus-visible {
  opacity: 1;
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

.site-footer__link svg {
  width: var(--space-5);
  height: var(--space-5);
}

.site-footer__copyright {
  font-size: var(--font-size-xs);
  color: var(--color-grey-500);
}

/* ==========================================================================
   Shared loading / error / empty state primitives
   Reused across the store grid, PDP, cart drawer, and checkout so every
   async view speaks the same visual language instead of each page
   inventing its own spinner/icon/button.
   ========================================================================== */

.skeleton-pulse {
  background-color: var(--color-grey-100);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-pulse {
    animation: none;
  }
}

.skeleton-line {
  height: 0.875em;
  border-radius: 2px;
}

.skeleton-line--wide {
  width: 70%;
}

.skeleton-line--narrow {
  width: 40%;
}

.skeleton-line--lg {
  height: 1.25em;
}

.state-icon {
  width: var(--space-7);
  height: var(--space-7);
  color: var(--color-grey-300);
}

.state-icon svg {
  width: 100%;
  height: 100%;
}

.state-retry {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-black);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-black);
  background-color: var(--color-white);
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.state-retry:hover:not(:disabled) {
  background-color: var(--color-black);
  color: var(--color-white);
}

.state-retry:active:not(:disabled) {
  transform: scale(0.97);
}

.state-retry:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 2px;
}

/* ==========================================================================
   Custom scrollbars
   Applied via class (thin everywhere it stays visible; hidden entirely on
   the horizontal drag-carousels, which already have their own scroll-snap
   + dot/peek affordance).
   ========================================================================== */

.thin-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: var(--color-grey-300) transparent;
}

.thin-scrollbar::-webkit-scrollbar {
  width: var(--space-2);
  height: var(--space-2);
}

.thin-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.thin-scrollbar::-webkit-scrollbar-thumb {
  background-color: var(--color-grey-300);
  border-radius: var(--space-1);
}

.thin-scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-grey-400);
}

.no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* ==========================================================================
   Validation shake
   Reusable attention-getter for a field/group that failed validation —
   removed and re-added by JS (not just left as a permanent class) so it
   can re-trigger on repeated failed attempts.
   ========================================================================== */

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.shake {
  animation: shake 0.4s ease;
}

@media (prefers-reduced-motion: reduce) {
  .shake {
    animation: none;
  }
}
