/**
 * Nix Pure Lab™ - Clinical Veterinary Storefront Stylesheet (v28)
 * Canonical visual spec documented in DESIGN.md
 */

:root {
  --nix-navy: #082567;
  --nix-navy-deep: #051944;
  --nix-navy-tint: rgba(8, 37, 103, 0.04);
  --nix-emblem-terracotta: #C9682B;
  --nix-emblem-gold: #DE9B35;
  --nix-emblem-sage: #A2B08C;
  --nix-border: #E4E4E7;
  --nix-bg-subtle: #F8FAFC;
  --nix-text-main: #0F172A;
  --nix-text-secondary: #3F3F46;
  --nix-text-muted: #52525B;
  --ease-nix: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-layout: 400ms;
  --duration-hover: 250ms;
}

/* Base typography & browser surface polish */
html {
  scrollbar-gutter: stable;
}

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #FFFFFF;
  color: var(--nix-text-main);
}

::selection {
  background-color: var(--nix-navy);
  color: #FFFFFF;
}

h1, h2, h3, h4, .heading-balanced {
  text-wrap: balance;
}

p, li, .text-pretty {
  text-wrap: pretty;
}

/* Accessible visible focus rings */
:focus-visible {
  outline: 2px solid var(--nix-navy);
  outline-offset: 2px;
}

/* Prevent accidental image drag while keeping all text selectable */
img {
  -webkit-user-drag: none;
}

/* Tabular numerals for zero layout jitter on live countdown & dynamic pricing */
.product-price-display,
#atc-price-display,
#sticky-price-display,
#bump-price,
#bump-regular,
#cd-hours,
#cd-mins,
#cd-secs,
#countdown-timer {
  font-variant-numeric: tabular-nums;
}

/* Product gallery & horizontal strip utilities */
.carousel-container {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.carousel-container::-webkit-scrollbar,
#reviewsCarouselTrack::-webkit-scrollbar,
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

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

.carousel-slide {
  scroll-snap-align: start;
  flex-shrink: 0;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Bundle selection cards */
.deal-bar {
  padding: 0.875rem 1rem;
  transition: border-color var(--duration-hover) var(--ease-nix), background-color var(--duration-hover) var(--ease-nix), box-shadow var(--duration-hover) var(--ease-nix);
}

.deal-bar.is-selected {
  border-color: var(--nix-navy);
  background-color: var(--nix-bg-subtle);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

/* Sticky bottom mobile CTA bar with notch safe-area support */
.sticky-atc-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--nix-border);
  padding-top: 0.625rem;
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
  padding-bottom: max(0.75rem, calc(0.625rem + env(safe-area-inset-bottom, 0px)));
  box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.05);
  transition: transform var(--duration-layout) var(--ease-nix), opacity var(--duration-hover) ease;
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.sticky-atc-bar.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Tagline word reveal */
.reveal-word {
  transition: opacity 0.45s var(--ease-nix), transform 0.45s var(--ease-nix);
  display: inline-block;
}

/* FAQ accordions (no marker, smooth rotation) */
details > summary {
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

details > summary::-moz-list-bullet {
  list-style-type: none;
}

details[open] summary .faq-icon {
  transform: rotate(180deg);
}

.nix-accordion-item details[open] summary .acc-icon {
  transform: rotate(45deg);
}

/* Reviews horizontal carousel & multi-device fluid sizing */
#reviewsCarouselTrack {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 1.5rem;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

@media (min-width: 640px) {
  #reviewsCarouselTrack {
    gap: 1.5rem;
  }
}

.review-card {
  flex: 0 0 auto;
  width: min(85vw, 350px);
  scroll-snap-align: start;
  border-radius: 16px;
  border: 1px solid var(--nix-border);
  background-color: #FFFFFF;
  transition: transform var(--duration-hover) var(--ease-nix), box-shadow var(--duration-hover) var(--ease-nix);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

@media (min-width: 640px) {
  .review-card {
    width: 370px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .review-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.03);
  }
}

/* Coarse pointer touch targets >= 44x44px */
@media (pointer: coarse) {
  .thumb-btn,
  #menu-toggle-btn,
  #close-drawer-btn,
  #currency-selector-btn,
  #reviewsPrevBtn,
  #reviewsNextBtn,
  #sticky-atc-btn {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Two-column desktop product layout */
.product-main-container {
  max-width: 1060px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 1024px) {
  .product-gallery-col {
    width: 53%;
    flex: 0 0 53%;
    max-width: 53%;
  }

  .product-order-col {
    width: 44%;
    flex: 0 0 44%;
    max-width: 44%;
  }

  .product-title-h1 {
    font-size: 1.875rem;
    line-height: 2.125rem;
    letter-spacing: -0.025em;
  }
}

/* Reduced motion: disable spatial transforms & smooth scrolling while keeping crisp state feedback */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal-word,
  .review-card,
  .sticky-atc-bar,
  .faq-icon,
  .acc-icon,
  #nav-drawer-panel {
    transition-property: opacity, border-color, background-color;
    transition-duration: 150ms;
    transform: none;
  }
}
