/* =====================================================
   CrissCross — Design Tokens & Core Styles
   ===================================================== */
:root {
    --ink: #111110;
    --paper: #f7f5f1;
    --stone: #eae5d9;
    --graphite: #6b6b64;
    --accent: #8a7048;
    --accent-dark: #6a5636;
    --line: #ddd6c6;
    --white: #ffffff;
    --danger: #a13b2f;
    --success: #3f6b4a;
    --shadow-soft: 0 8px 30px rgba(17,17,16,0.06);
    --shadow-strong: 0 20px 60px rgba(17,17,16,0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background: var(--paper);
    color: var(--ink);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.font-display { font-family: 'Instrument Serif', serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }

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

/* Focus visibility for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------------- Signature: CrissCross Lines divider ---------------- */
.cc-lines { display: flex; flex-direction: column; gap: 4px; width: 64px; margin: 0 auto 18px; }
.cc-lines span { display: block; height: 2px; background: var(--accent); }
.cc-lines span:nth-child(1) { width: 100%; opacity: 1; }
.cc-lines span:nth-child(2) { width: 68%; opacity: 0.65; }
.cc-lines span:nth-child(3) { width: 38%; opacity: 0.4; }
.cc-lines.left { margin: 0 0 18px; }

.section-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.72rem;
    color: var(--accent);
}

/* ---------------- Announcement bar ---------------- */
.announcement-bar {
    background: var(--ink);
    color: var(--paper);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-align: center;
    padding: 8px 12px;
}

/* ---------------- Header ---------------- */
#siteHeader { background: rgba(247,245,241,0.92); backdrop-filter: blur(10px); transition: box-shadow .3s ease, padding .3s ease; }
#siteHeader.scrolled { box-shadow: var(--shadow-soft); }
.logo-word { font-family: 'Instrument Serif', serif; font-size: 1.9rem; letter-spacing: 0.02em; }

.nav-link { position: relative; font-size: 0.92rem; }
.nav-link::after {
    content: ''; position: absolute; left: 0; bottom: -4px; width: 0; height: 1px; background: var(--ink);
    transition: width .25s ease;
}
.nav-link:hover::after { width: 100%; }

.icon-btn { position: relative; color: var(--ink); transition: opacity .2s ease; }
.icon-btn:hover { opacity: 0.6; }
.badge-count {
    position: absolute; top: -7px; right: -9px; background: var(--ink); color: var(--paper);
    font-size: 0.62rem; width: 17px; height: 17px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-family: 'JetBrains Mono', monospace;
}

/* Mega menu */
.mega-menu {
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
}
.nav-item:hover .mega-menu, .mega-menu:hover { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 28px; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase;
    font-weight: 500; transition: all .25s ease; cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: var(--accent-dark); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------------- Product Card ---------------- */
.product-card { position: relative; }
.product-card .img-wrap { position: relative; overflow: hidden; background: var(--stone); aspect-ratio: 3/4; }
.product-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.8,.2,1), opacity .4s ease; }
.product-card .img-secondary { position: absolute; inset: 0; opacity: 0; }
.product-card:hover .img-primary { transform: scale(1.04); opacity: 0; }
.product-card:hover .img-secondary { opacity: 1; }
.badge { font-family: 'JetBrains Mono', monospace; font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 9px; }
.badge-new { background: var(--ink); color: var(--paper); }
.badge-sale { background: var(--danger); color: #fff; }
.badge-limited { background: var(--accent); color: #fff; }
.badge-oos { background: var(--graphite); color: #fff; }

.quick-actions { transform: translateY(8px); opacity: 0; transition: all .25s ease; }
.product-card:hover .quick-actions { transform: translateY(0); opacity: 1; }

.wishlist-toggle.active svg { fill: var(--danger); stroke: var(--danger); }

/* ---------------- Skeleton loader ---------------- */
.skeleton { background: linear-gradient(90deg, var(--stone) 25%, #f2eee2 37%, var(--stone) 63%); background-size: 400% 100%; animation: skeleton-loading 1.4s ease infinite; }
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------------- Toast ---------------- */
#toastContainer { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--ink); color: var(--paper); padding: 14px 18px; font-size: 0.85rem; box-shadow: var(--shadow-strong); display: flex; align-items: center; gap: 10px; min-width: 260px; animation: toast-in .3s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

/* ---------------- Back to top ---------------- */
#backToTop {
    position: fixed; bottom: 24px; left: 24px; width: 44px; height: 44px; background: var(--ink); color: var(--paper);
    display: flex; align-items: center; justify-content: center; z-index: 150; opacity: 0; visibility: hidden;
    transition: all .3s ease; cursor: pointer;
}
#backToTop.show { opacity: 1; visibility: visible; }

/* ---------------- Countdown ---------------- */
.countdown-box { background: var(--ink); color: var(--paper); min-width: 58px; text-align: center; padding: 10px 6px; }
.countdown-box .num { font-family: 'JetBrains Mono', monospace; font-size: 1.4rem; }
.countdown-box .lbl { font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.7; }

/* ---------------- Forms ---------------- */
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 13px 16px; background: var(--white); border: 1px solid var(--line); font-size: 0.92rem;
    transition: border-color .2s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--ink); outline: none; }
.form-label { font-size: 0.78rem; letter-spacing: 0.03em; color: var(--graphite); margin-bottom: 6px; display: block; }

/* Color swatch */
.color-swatch { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer; position: relative; }
.color-swatch.selected::after { content: ''; position: absolute; inset: -4px; border: 1px solid var(--ink); border-radius: 50%; }
.size-box { min-width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); cursor: pointer; font-size: 0.85rem; transition: all .2s ease; }
.size-box:hover:not(.disabled) { border-color: var(--ink); }
.size-box.selected { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.size-box.disabled { opacity: 0.3; text-decoration: line-through; cursor: not-allowed; }

/* Glass effect */
.glass { background: rgba(255,255,255,0.55); backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,0.4); }

/* Hairline divider */
.hairline { border-top: 1px solid var(--line); }

/* Marquee */
.marquee-track { display: flex; white-space: nowrap; animation: marquee 28s linear infinite; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Utility */
.tracking-wide-plus { letter-spacing: 0.14em; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Scrollbar (subtle, webkit) */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--line); }
::-webkit-scrollbar-thumb:hover { background: var(--graphite); }
