/* ==========================================================================
   AV Fashion — global stylesheet
   Tailwind (CDN) handles layout utilities; this file owns the design tokens,
   reusable component classes and animations.
   ========================================================================== */

:root {
  --av-cream: #fdf8f3;
  --av-blush: #f7d9e1;
  --av-blush-deep: #e79fb4;
  --av-beige: #efe3d3;
  --av-lavender: #ded4f1;
  --av-sky: #cfe4f5;
  --av-ink: #3d3436;
  --av-muted: #8b7f81;
  --av-line: #efe6de;
  --av-shadow: 0 10px 30px -12px rgba(126, 92, 100, 0.25);
  --av-shadow-lg: 0 24px 60px -24px rgba(126, 92, 100, 0.38);
  --av-header-h: 76px;
}

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--av-header-h) + 16px); }

body {
  background: var(--av-cream);
  color: var(--av-ink);
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-display { font-family: 'Fraunces', 'Plus Jakarta Sans', Georgia, serif; }

::selection { background: var(--av-blush); color: var(--av-ink); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--av-cream); }
::-webkit-scrollbar-thumb { background: #e3d4c9; border-radius: 999px; border: 3px solid var(--av-cream); }
::-webkit-scrollbar-thumb:hover { background: var(--av-blush-deep); }

/* ---------- Focus visibility (a11y) ---------- */
:focus-visible {
  outline: 2px solid var(--av-blush-deep);
  outline-offset: 3px;
  border-radius: 8px;
}

.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 200;
  background: #fff; color: var(--av-ink); padding: 12px 20px; border-radius: 999px;
  box-shadow: var(--av-shadow); transition: top .25s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  border-radius: 999px; font-weight: 600; font-size: .92rem; line-height: 1;
  padding: .92rem 1.7rem; border: 1px solid transparent; cursor: pointer;
  transition: transform .25s cubic-bezier(.2,.8,.3,1), box-shadow .25s ease, background-color .25s ease, color .25s ease, border-color .25s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--av-ink); color: #fff; box-shadow: var(--av-shadow); }
.btn-primary:hover:not(:disabled) { background: #56484b; transform: translateY(-2px); box-shadow: var(--av-shadow-lg); }

.btn-pink { background: var(--av-blush-deep); color: #fff; box-shadow: 0 12px 26px -14px rgba(231,159,180,.9); }
.btn-pink:hover:not(:disabled) { background: #dc8ba4; transform: translateY(-2px); }

.btn-outline { background: transparent; color: var(--av-ink); border-color: #e0d2c6; }
.btn-outline:hover:not(:disabled) { background: #fff; border-color: var(--av-blush-deep); color: #a35d74; transform: translateY(-2px); }

.btn-soft { background: #fff; color: var(--av-ink); box-shadow: var(--av-shadow); }
.btn-soft:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--av-shadow-lg); }

.btn-sm { padding: .65rem 1.15rem; font-size: .82rem; }
.btn-block { width: 100%; }

/* ---------- Surfaces ---------- */
.card {
  background: #fff; border-radius: 24px; border: 1px solid var(--av-line);
  box-shadow: 0 6px 20px -14px rgba(126,92,100,.35);
  transition: transform .35s cubic-bezier(.2,.8,.3,1), box-shadow .35s ease;
}
.card-hover:hover { transform: translateY(-6px); box-shadow: var(--av-shadow-lg); }

.chip {
  display: inline-flex; align-items: center; gap: .4rem; border-radius: 999px;
  padding: .45rem 1rem; font-size: .78rem; font-weight: 600; letter-spacing: .01em;
  background: #fff; border: 1px solid var(--av-line); color: var(--av-muted);
  cursor: pointer; transition: all .22s ease;
}
.chip:hover { border-color: var(--av-blush-deep); color: #a35d74; }
.chip[aria-pressed="true"], .chip.is-active { background: var(--av-ink); border-color: var(--av-ink); color: #fff; }

.badge {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: .3rem .7rem; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.badge-sale { background: #f6c6d2; color: #8d3f57; }
.badge-new { background: var(--av-sky); color: #2f5a7a; }
.badge-out { background: #eae4e0; color: #7a6d6d; }

.input {
  width: 100%; border-radius: 16px; border: 1px solid #e6dbd2; background: #fff;
  padding: .85rem 1.1rem; font-size: .92rem; color: var(--av-ink);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.input::placeholder { color: #b7aaa9; }
.input:focus { outline: none; border-color: var(--av-blush-deep); box-shadow: 0 0 0 4px rgba(231,159,180,.18); }
.input[aria-invalid="true"] { border-color: #d97a86; box-shadow: 0 0 0 4px rgba(217,122,134,.15); }
.field-error { color: #b5495a; font-size: .78rem; margin-top: .35rem; display: none; }
.field-error.show { display: block; }

.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--av-line), transparent); }

/* ---------- Product card media ---------- */
.media {
  position: relative; overflow: hidden; border-radius: 20px; background: #f3ece6;
  aspect-ratio: 4 / 5;
}
.media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .7s cubic-bezier(.2,.8,.3,1), opacity .5s ease;
}
.card-hover:hover .media img,
.media:hover img { transform: scale(1.07); }

.media-swap img.media-alt { position: absolute; inset: 0; opacity: 0; }
.media-swap:hover img.media-alt { opacity: 1; }

img.lazy-img { opacity: 0; }
img.lazy-img.is-loaded { opacity: 1; }

.quick-actions {
  position: absolute; right: 12px; top: 12px; display: grid; gap: .5rem;
  opacity: 0; transform: translateX(10px); transition: all .3s ease;
}
.card-hover:hover .quick-actions, .quick-actions:focus-within { opacity: 1; transform: none; }
@media (hover: none) { .quick-actions { opacity: 1; transform: none; } }

.icon-btn {
  width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center;
  background: rgba(255,255,255,.92); color: var(--av-ink); border: 1px solid var(--av-line);
  backdrop-filter: blur(6px); transition: all .22s ease; cursor: pointer;
}
.icon-btn:hover { background: var(--av-ink); color: #fff; }
.icon-btn.is-active { background: var(--av-blush-deep); border-color: var(--av-blush-deep); color: #fff; }

/* The header/footer partials are injected into a wrapper div; `display: contents`
   keeps that wrapper out of the box tree so `position: sticky` resolves against
   the page instead of the (short) wrapper. */
[data-include] { display: contents; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60; background: rgba(253,248,243,.82);
  backdrop-filter: blur(14px); border-bottom: 1px solid transparent;
  transition: box-shadow .3s ease, border-color .3s ease, background-color .3s ease;
}
.site-header.is-stuck { box-shadow: 0 10px 30px -22px rgba(126,92,100,.6); border-color: var(--av-line); background: rgba(253,248,243,.95); }

.nav-link { position: relative; font-size: .92rem; font-weight: 500; color: var(--av-ink); padding: .35rem 0; }
.nav-link::after {
  content: ''; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--av-blush-deep); border-radius: 2px; transition: width .28s ease;
}
.nav-link:hover::after, .nav-link[aria-current="page"]::after { width: 100%; }

.count-bubble {
  position: absolute; top: -6px; right: -8px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: var(--av-blush-deep); color: #fff;
  font-size: .66rem; font-weight: 700; display: grid; place-items: center;
}
.count-bubble[data-empty="true"] { display: none; }

/* ---------- Drawers / overlays ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(61,52,54,.42); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .3s ease; z-index: 80;
}
.overlay.is-open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; bottom: 0; width: min(88vw, 380px); background: var(--av-cream);
  z-index: 90; display: flex; flex-direction: column;
  transition: transform .38s cubic-bezier(.2,.8,.3,1); box-shadow: var(--av-shadow-lg);
}
.drawer-left { left: 0; transform: translateX(-102%); }
.drawer-right { right: 0; width: min(92vw, 430px); transform: translateX(102%); }
.drawer.is-open { transform: none; }

.search-panel {
  position: fixed; left: 0; right: 0; top: 0; z-index: 95; background: var(--av-cream);
  transform: translateY(-102%); transition: transform .35s cubic-bezier(.2,.8,.3,1);
  box-shadow: var(--av-shadow-lg); padding: 1.25rem 1rem 1.75rem;
}
.search-panel.is-open { transform: none; }

body.no-scroll { overflow: hidden; }

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed; z-index: 120; right: 1rem; bottom: 1rem;
  display: flex; flex-direction: column; gap: .6rem; width: min(92vw, 340px);
}
.toast {
  display: flex; gap: .75rem; align-items: flex-start; background: #fff; color: var(--av-ink);
  border: 1px solid var(--av-line); border-left: 4px solid var(--av-blush-deep);
  border-radius: 16px; padding: .85rem 1rem; box-shadow: var(--av-shadow-lg);
  animation: toast-in .35s cubic-bezier(.2,.8,.3,1);
  font-size: .88rem;
}
.toast.is-out { animation: toast-out .3s ease forwards; }
.toast-success { border-left-color: #86b58c; }
.toast-error { border-left-color: #d97a86; }
.toast-info { border-left-color: var(--av-sky); }

@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.3,1); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: .08s; }
.reveal-delay-2 { transition-delay: .16s; }
.reveal-delay-3 { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Skeletons ---------- */
.skeleton { position: relative; overflow: hidden; background: #f0e8e1; border-radius: 18px; }
.skeleton::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ---------- Marquee announcement ---------- */
.announce { background: var(--av-ink); color: #fff8f4; font-size: .78rem; letter-spacing: .02em; }

/* ---------- Hero ---------- */
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease; }
.hero-slide.is-active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }

/* Copy sits over the photo: veil vertically on phones, horizontally from md up. */
.hero-veil {
  background: linear-gradient(180deg, rgba(253,248,243,.97) 0%, rgba(253,248,243,.92) 55%, rgba(253,248,243,.55) 100%);
}
@media (min-width: 768px) {
  .hero-veil {
    background: linear-gradient(100deg, rgba(253,248,243,.96) 0%, rgba(253,248,243,.86) 38%, rgba(253,248,243,.15) 68%, rgba(253,248,243,0) 100%);
  }
}
.hero-dot { width: 8px; height: 8px; border-radius: 999px; background: rgba(61,52,54,.28); transition: all .3s ease; }
.hero-dot.is-active { width: 26px; background: var(--av-ink); }

/* ---------- Misc helpers ---------- */
.scroll-x { overflow-x: auto; scroll-snap-type: x mandatory; -ms-overflow-style: none; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x > * { scroll-snap-align: start; }

.stars { display: inline-flex; gap: 1px; color: #e8b04b; }

.prose-page p { color: var(--av-muted); line-height: 1.85; margin-bottom: 1rem; }
.prose-page h2 { font-size: 1.4rem; margin: 2rem 0 .75rem; }
.prose-page h3 { font-size: 1.08rem; margin: 1.5rem 0 .5rem; font-weight: 600; }
.prose-page ul { list-style: disc; padding-left: 1.35rem; margin-bottom: 1rem; color: var(--av-muted); line-height: 1.85; }

.accordion-body { max-height: 0; overflow: hidden; transition: max-height .38s cubic-bezier(.2,.8,.3,1); }

.zoom-frame { overflow: hidden; border-radius: 26px; }
.zoom-frame img { transition: transform .8s cubic-bezier(.2,.8,.3,1); }
.zoom-frame:hover img { transform: scale(1.06); }

.thumb.is-active { outline: 2px solid var(--av-blush-deep); outline-offset: 2px; }

.qty {
  display: inline-flex; align-items: center; border: 1px solid #e6dbd2; border-radius: 999px;
  background: #fff; overflow: hidden;
}
.qty button { width: 40px; height: 42px; display: grid; place-items: center; transition: background .2s ease; }
.qty button:hover { background: #f7efe9; }
.qty input { width: 46px; text-align: center; border: 0; background: transparent; font-weight: 600; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input[type=number] { -moz-appearance: textfield; }

.swatch { width: 30px; height: 30px; border-radius: 999px; border: 1px solid #e0d2c6; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.swatch:hover { transform: scale(1.1); }
.swatch.is-active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--av-blush-deep); }

.size-pill {
  min-width: 58px; padding: .55rem .8rem; border-radius: 12px; border: 1px solid #e6dbd2;
  background: #fff; font-size: .82rem; font-weight: 600; cursor: pointer; transition: all .2s ease;
}
.size-pill:hover { border-color: var(--av-blush-deep); }
.size-pill.is-active { background: var(--av-ink); color: #fff; border-color: var(--av-ink); }

.footer-link { color: var(--av-muted); font-size: .9rem; transition: color .2s ease, padding-left .2s ease; }
.footer-link:hover { color: var(--av-ink); padding-left: 4px; }

.social-btn {
  width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center;
  background: #fff; border: 1px solid var(--av-line); color: var(--av-ink); transition: all .25s ease;
}
.social-btn:hover { background: var(--av-blush-deep); color: #fff; transform: translateY(-3px); border-color: var(--av-blush-deep); }

.ig-tile { position: relative; overflow: hidden; border-radius: 18px; aspect-ratio: 1; }
.ig-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.ig-tile::after {
  content: ''; position: absolute; inset: 0; background: rgba(61,52,54,.35);
  opacity: 0; transition: opacity .3s ease;
}
.ig-tile:hover img { transform: scale(1.08); }
.ig-tile:hover::after { opacity: 1; }
.ig-tile .ig-icon { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; opacity: 0; transition: opacity .3s ease; z-index: 2; }
.ig-tile:hover .ig-icon { opacity: 1; }

.empty-state { text-align: center; padding: 4rem 1rem; }

.back-to-top {
  position: fixed; right: 1rem; bottom: 5.2rem; z-index: 70;
  width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center;
  background: var(--av-ink); color: #fff; box-shadow: var(--av-shadow-lg);
  opacity: 0; pointer-events: none; transform: translateY(10px); transition: all .3s ease;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }
