/* Hunza Taste — custom polish on top of Tailwind (CDN) */

:root {
  --grain-opacity: 0.035;
}

body {
  -webkit-font-smoothing: antialiased;
}

/* Subtle organic grain overlay (DESIGN.md: texture overlay ~3%) */
.grain::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.grain > * { position: relative; z-index: 1; }

/* Headings use the editorial serif */
h1, h2, h3, .font-serif { letter-spacing: -0.01em; }

/* Hide scrollbar on horizontal chip rows */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Product card image hover */
.card-img { transition: transform 0.5s ease; }
.group:hover .card-img { transform: scale(1.04); }

/* ---------------------------------------------------------------------------
   Modern interaction polish
   --------------------------------------------------------------------------- */

/* Smooth, consistent transitions on interactive elements */
a, button, .card-hover, input, textarea, select {
  transition: color .2s ease, background-color .2s ease, border-color .2s ease,
              box-shadow .25s ease, transform .2s ease;
}
button:active:not(:disabled) { transform: translateY(1px); }

/* Glass-blur sticky header (adds a soft shadow once scrolled) */
.site-header {
  background-color: rgba(250, 249, 245, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  transition: box-shadow .3s ease, background-color .3s ease, border-color .3s ease;
}
.site-header.scrolled {
  background-color: rgba(250, 249, 245, 0.86);
  box-shadow: 0 8px 30px -16px rgba(0, 101, 40, 0.30);
  border-color: transparent;
}

/* Animated underline for nav links */
.nav-link { position: relative; }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .25s cubic-bezier(.22,.61,.36,1);
}
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.active { color: #006528; }
.nav-link.active::after { transform: scaleX(1); }

/* Soft-lifting cards */
.card-hover {
  transition: transform .3s cubic-bezier(.22,.61,.36,1), box-shadow .3s ease, border-color .3s ease;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 45px -22px rgba(0, 101, 40, 0.32);
  border-color: #becabb;
}

/* CTA icon buttons get a gentle grow on hover */
.btn-pop:hover { transform: translateY(-1px) scale(1.05); }

/* Primary CTAs lift slightly with a deeper shadow */
.btn-lift:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -16px rgba(0, 101, 40, 0.45); }

/* Rotating announcement bar — horizontal slide (out left, in from right) */
#announceBar { overflow: hidden; }
.announce-track {
  position: relative;
  height: 1.4em;
  max-width: 1280px;
  margin: 0 auto;
  overflow: hidden;
}
.announce-item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  transform: translateX(100%);
  opacity: 0;
  transition: transform .65s cubic-bezier(.22,.61,.36,1), opacity .45s ease;
  pointer-events: none;
  will-change: transform, opacity;
}
.announce-item.is-active {
  transform: translateX(0);
  opacity: 1;
  z-index: 2;
  pointer-events: auto;
}
.announce-item.is-leaving {
  transform: translateX(-100%);
  opacity: 0;
  z-index: 1;
}
.announce-item.is-ready {
  transform: translateX(100%);
  opacity: 0;
  z-index: 0;
  transition: none; /* snap back off-screen without animating */
}

/* Product page delivery timeline connector */
.delivery-timeline::before {
  content: "";
  position: absolute;
  top: 0.4rem;
  left: 16.5%;
  right: 16.5%;
  height: 2px;
  background: #d4d4d4;
  z-index: 0;
}

/* Low stock urgency pulse */
.urgency-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  background: #dc2626;
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55);
  animation: urgencyPulse 1.6s ease-out infinite;
}
@keyframes urgencyPulse {
  0%   { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* SVG fallback size (prevents giant icons if utilities fail to load) */
svg[viewBox="0 0 24 24"] { display: inline-block; vertical-align: middle; flex-shrink: 0; max-width: 100%; }
svg.w-4, svg.h-4 { width: 1rem; height: 1rem; }
svg.w-5, svg.h-5 { width: 1.25rem; height: 1.25rem; }
svg.w-6, svg.h-6 { width: 1.5rem; height: 1.5rem; }

/* Category tabs: icon above the name */
.cat-tab .cat-ico   { transition: transform .25s cubic-bezier(.22,.61,.36,1), border-color .2s ease, box-shadow .25s ease; }
.cat-tab .cat-label { transition: color .2s ease; }
.cat-tab:hover .cat-ico   { transform: translateY(-3px); border-color: #1b803a; }
.cat-tab:hover .cat-label { color: #1b803a; }
.cat-tab.active .cat-ico  { border-color: #1b803a; box-shadow: 0 0 0 4px rgba(27, 128, 58, 0.16); }
.cat-tab.active .cat-label { color: #006528; }

/* Reveal-on-scroll: start hidden, .in when in view */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.22,.61,.36,1); }
.reveal.in { opacity: 1; transform: none; }

/* Respect users who prefer reduced motion — keep announcement ticker sliding */
@media (prefers-reduced-motion: reduce) {
  .card-hover,
  .card-hover:hover,
  .reveal,
  .btn-lift,
  .btn-pop,
  .nav-link::after,
  .fade-up,
  .cat-tab .cat-ico,
  .cat-tab .cat-label,
  .site-header {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  .card-hover:hover { transform: none; }
  .reveal { opacity: 1; transform: none; }
}

/* Fade-in on load */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.6s ease both; }

/* Line clamp helpers */
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Legal / long-form content styling */
.legal h2 {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1b1c1a;
  margin: 2rem 0 0.75rem;
}
.legal h3 {
  font-weight: 600;
  color: #1b1c1a;
  margin: 1.25rem 0 0.5rem;
}
.legal p,
.legal li {
  color: #3f493e;
  line-height: 1.75;
}
.legal p { margin-bottom: 1rem; }
.legal ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}
.legal li { margin-bottom: 0.375rem; }
.legal a { color: #006528; font-weight: 600; }
.legal a:hover { text-decoration: underline; }
.legal strong { color: #1b1c1a; }
