/* ============================================================
   Active Wear — custom styles
   Supplements the Tailwind CDN (theme lives in js/tailwind.config.js)
   ============================================================ */

:root {
    --aw-ink: #0a0a0b;
    --aw-ink-2: #17181a;
    --aw-soft: #f5f5f6;
    --aw-line: #e4e4e7;
    --aw-muted: #71717a;
    --aw-accent: #16a34a;
    --aw-accent-soft: #dcfce7;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, .font-display {
    font-family: Archivo, Inter, ui-sans-serif, system-ui, sans-serif;
}

::selection {
    background: var(--aw-accent);
    color: #fff;
}

/* ---- Scrollbars ---------------------------------------------------- */
.nice-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.nice-scroll::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 99px; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ---- Reveal on scroll --------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s cubic-bezier(0.16, 0.84, 0.44, 1),
        transform 0.7s cubic-bezier(0.16, 0.84, 0.44, 1);
}
.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* ---- Keyframes ----------------------------------------------------- */
@keyframes awFadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes awFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes awDrawerIn { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes awToastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes awMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes awPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.animate-fadeUp { animation: awFadeUp 0.5s ease both; }
.animate-fadeIn { animation: awFadeIn 0.3s ease both; }
.animate-drawer { animation: awDrawerIn 0.34s cubic-bezier(0.32, 0.72, 0, 1) both; }
.animate-toast { animation: awToastIn 0.3s ease both; }
.animate-marquee { animation: awMarquee 30s linear infinite; }
.animate-pulse-dot { animation: awPulse 1.6s ease-in-out infinite; }

/* ---- Hero slider --------------------------------------------------- */
.hero-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 900ms ease;
    will-change: opacity;
}
.hero-slide.is-active { opacity: 0.55; }

.hero-dot {
    width: 22px;
    height: 4px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.28);
    cursor: pointer;
    transition: width 300ms ease, background 300ms ease;
}
.hero-dot:hover { background: rgba(255, 255, 255, 0.55); }
.hero-dot.is-active { width: 44px; background: #ffffff; }

.hero-copy {
    transition: opacity 220ms ease, transform 220ms ease;
    will-change: opacity, transform;
}
.hero-copy.hero-copy-out {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}
.hero-copy-in {
    animation: awHeroCopyIn 540ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes awHeroCopyIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}

/* ---- Brand logo marquee -------------------------------------------- */
.brand-mask {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
}
.brand-marquee:hover .animate-marquee { animation-play-state: paused; }

/* ---- Admin panel --------------------------------------------------- */
.admin-nav {
    color: rgba(255, 255, 255, 0.62);
    transition: color 180ms ease, background-color 180ms ease;
}
.admin-nav:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.admin-nav.is-active { color: #fff; background: rgba(255, 255, 255, 0.1); }
.admin-nav.is-active svg { color: #16a34a; }

.badge {
    display: inline-flex; align-items: center; gap: 0.375rem;
    border-radius: 9999px; padding: 0.15rem 0.55rem;
    font-size: 11px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 9999px; background: currentColor; }
.badge-processing { color: #b45309; background: #fef3c7; }
.badge-packed { color: #1d4ed8; background: #dbeafe; }
.badge-shipped { color: #15803d; background: #dcfce7; }
.badge-delivered { color: #3f6212; background: #ecfccb; }
.badge-cancelled { color: #b91c1c; background: #fee2e2; }

/* ---- Mobile bottom navigation ------------------------------------- */
.bottom-link {
    color: #71717a;
    transition: color 200ms ease;
}
.bottom-link:hover { color: #0a0a0b; }
.bottom-link .bottom-icon { transition: background-color 200ms ease, color 200ms ease; }
.bottom-link.is-active { color: #15803d; }
.bottom-link.is-active .bottom-icon { background-color: #dcfce7; color: #16a34a; }
.bottom-link:focus-visible { outline: 2px solid #16a34a; outline-offset: 2px; }

@media (max-width: 1023px) {
    body { padding-bottom: calc(4.25rem + env(safe-area-inset-bottom)); }
}

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

/* ---- Nav link underline ------------------------------------------- */
.nav-link { position: relative; }
.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 1.5px;
    background: var(--aw-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.nav-link:hover::after,
.nav-link[aria-current="page"]::after { transform: scaleX(1); }

/* ---- Dual price-range slider -------------------------------------- */
.price-range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
}
.price-range::-webkit-slider-runnable-track { height: 100%; background: transparent; border: none; }
.price-range::-moz-range-track { height: 100%; background: transparent; border: none; }
.price-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: 9999px;
    border: 2px solid var(--aw-ink);
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}
.price-range::-moz-range-thumb {
    pointer-events: auto;
    width: 18px;
    height: 18px;
    border-radius: 9999px;
    border: 2px solid var(--aw-ink);
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}
.price-range:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--aw-accent); outline-offset: 2px; }
.price-range:focus-visible::-moz-range-thumb { outline: 2px solid var(--aw-accent); outline-offset: 2px; }

/* ---- Accordion ----------------------------------------------------- */
.acc-panel {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease;
}
.acc-panel.open { max-height: 480px; }

/* ---- Long-form copy ------------------------------------------------ */
.prose-custom > * + * { margin-top: 1rem; }
.prose-custom strong { color: var(--aw-ink); font-weight: 600; }
.prose-custom a { color: var(--aw-ink); text-decoration: underline; text-underline-offset: 4px; }

/* ---- Misc ---------------------------------------------------------- */
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

:where(a, button, input, select, textarea):focus-visible {
    outline: 2px solid var(--aw-ink);
    outline-offset: 2px;
}
