/* ==========================================================================
   mmorse — design system v3  ("Obsidian & Gold", 2026)
   Premium dark catalog UI with refined gold accents, glass surfaces and a full
   set of smooth, modern motion (entrance, scroll-reveal, hover in/out, page
   transitions). Light theme is a warm gold-on-paper variant.
   All pages reuse these tokens/components — do not invent parallel styles.
   ========================================================================== */

/* --- Tokens: dark is the default ------------------------------------------ */
:root {
    color-scheme: dark;

    --bg:            #0a0a0c;
    --bg-elev:       #0e0e12;
    --surface:       #131317;
    --surface-2:     #181820;
    --surface-3:     #20212b;
    --glass:         rgba(18, 18, 24, .55);
    --text:          #f5f4f2;
    --muted:         #a2a1ab;
    --faint:         #8e8c9a;
    --border:        rgba(255, 255, 255, .07);
    --border-2:      rgba(255, 255, 255, .14);

    --gold:          #e9b949;
    --gold-2:        #ffd877;
    --gold-deep:     #b98e2e;
    --on-gold:       #1a1407;
    --gold-soft:     rgba(233, 185, 73, .12);
    --gold-glow:     rgba(233, 185, 73, .45);

    --success:       #34d399;   --success-soft: rgba(52, 211, 153, .14);
    --danger:        #fb7185;   --danger-soft:  rgba(251, 113, 133, .14);
    --warning:       #f5a524;   --warning-soft: rgba(245, 165, 36, .14);

    --alert-success-text: #4ade80;
    --alert-danger-text:  #fb7185;
    --alert-info-text:    #ffd877;

    --ring:          rgba(233, 185, 73, .32);
    --shadow-sm:     0 1px 2px rgba(0, 0, 0, .5);
    --shadow:        0 32px 80px -40px rgba(0, 0, 0, .92);
    --shadow-gold:   0 24px 60px -28px rgba(233, 185, 73, .35);

    --gradient-text: linear-gradient(96deg, #ffd877, #e9b949 55%, #d49a2c);

    --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-display:  'Space Grotesk', var(--font);

    --r:             18px;
    --r-sm:          11px;
    --r-lg:          26px;
    --pill:          999px;

    --ease:          cubic-bezier(.22, .61, .36, 1);
    --ease-spring:   cubic-bezier(.34, 1.4, .5, 1);

    --sidebar-w:     258px;
    --topbar-h:      72px;
    --content-max:   1320px;
}

:root[data-theme="light"] {
    color-scheme: light;

    --bg:            #e8e9ef;
    --bg-elev:       #e1e2ea;
    --surface:       #ffffff;
    --surface-2:     #f4f5f9;
    --surface-3:     #e5e6ee;
    --glass:         rgba(255, 255, 255, .78);
    --text:          #1a1a1f;
    --muted:         #555562;
    --faint:         #84848d;
    --border:        rgba(22, 24, 45, .14);
    --border-2:      rgba(22, 24, 45, .22);

    --gold:          #a8791b;
    --gold-2:        #c79321;
    --gold-deep:     #8a6212;
    --on-gold:       #ffffff;
    --gold-soft:     rgba(168, 121, 27, .12);
    --gold-glow:     rgba(168, 121, 27, .28);

    --success:       #16a34a;   --success-soft: rgba(22, 163, 74, .12);
    --danger:        #dc2626;   --danger-soft:  rgba(220, 38, 38, .10);
    --warning:       #c2710c;   --warning-soft: rgba(194, 113, 12, .12);

    --alert-success-text: #15803d;
    --alert-danger-text:  #b91c1c;
    --alert-info-text:    #8a6212;

    --ring:          rgba(168, 121, 27, .28);
    --shadow-sm:     0 1px 2px rgba(22, 24, 45, .09), 0 6px 16px -8px rgba(22, 24, 45, .10);
    --shadow:        0 30px 70px -38px rgba(27, 24, 16, .35);
    --shadow-gold:   0 22px 50px -26px rgba(168, 121, 27, .30);

    --gradient-text: linear-gradient(96deg, #c79321, #a8791b 60%, #8a6212);
}

/* --- Page transitions (Chromium cross-document) --------------------------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut .32s var(--ease) both; }
::view-transition-new(root) { animation: vtIn .42s var(--ease) both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vtIn  { from { opacity: 0; transform: translateY(10px); } }

/* --- Reset / base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    transition: background-color .4s var(--ease), color .4s var(--ease);
}

/* Developer code texture: two theme-specific SVGs tiled as a background image
   (light glyphs on dark, dark glyphs on light). Soft glow orbs sit behind it. */
.dev-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: url('/assets/dev-bg.svg') 0 0 / 560px 560px repeat;
    opacity: .14;
}
:root[data-theme="light"] .dev-bg { background-image: url('/assets/dev-bg-light.svg'); opacity: .1; }

/* Soft drifting glows for depth, behind the texture. */
body::before, body::after {
    content: "";
    position: fixed;
    z-index: 0;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(80px);
    opacity: .4;
}
body::before { width: 52vw; height: 52vw; top: -16vw; left: -10vw; background: radial-gradient(circle, var(--gold-glow), transparent 70%); animation: driftA 28s ease-in-out infinite; }
body::after  { width: 44vw; height: 44vw; bottom: -16vw; right: -10vw; background: radial-gradient(circle, rgba(120, 90, 220, .18), transparent 70%); animation: driftB 34s ease-in-out infinite; }
@keyframes driftA { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(6vw, 5vw) scale(1.12); } }
@keyframes driftB { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-5vw, -4vw) scale(1.1); } }

::selection { background: var(--gold-soft); color: var(--text); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-deep); background-clip: padding-box; }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.2rem); }
p  { margin: 0 0 1rem; }
a  { color: var(--gold); text-decoration: none; transition: color .25s var(--ease); }
a:hover { color: var(--gold-2); }
img { max-width: 100%; display: block; }

/* --- App layout: sidebar + content ---------------------------------------- */
.layout { position: relative; z-index: 1; display: flex; min-height: 100vh; }

.sidebar {
    position: sticky; top: 0; align-self: flex-start;
    width: var(--sidebar-w); height: 100vh; flex-shrink: 0;
    display: flex; flex-direction: column;
    padding: 24px 18px;
    background: linear-gradient(180deg, var(--bg-elev), var(--bg));
    border-right: 1px solid var(--border);
    overflow-y: auto; z-index: 40;
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 1.32rem; color: var(--text); letter-spacing: .02em; padding: 6px 8px 20px; }
.brand:hover { color: var(--text); }
.brand-logo { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(140deg, var(--gold-2), var(--gold-deep)); color: var(--on-gold); font-weight: 800; box-shadow: 0 8px 22px -8px var(--gold-glow); transition: transform .5s var(--ease-spring); }
.brand:hover .brand-logo { transform: rotate(-8deg) scale(1.06); }
.brand-name b { color: var(--gold); }

.side-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.side-heading { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); padding: 18px 12px 8px; }
.side-link {
    position: relative; display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 12px; color: var(--muted); font-weight: 500;
    transition: color .3s var(--ease), background-color .3s var(--ease), transform .25s var(--ease);
}
.side-link svg { width: 19px; height: 19px; flex-shrink: 0; transition: transform .3s var(--ease); }
.side-link:hover { color: var(--text); background: var(--surface-2); transform: translateX(4px); }
.side-link:hover svg { transform: scale(1.12); }
.side-link.is-active { color: var(--gold); background: var(--gold-soft); }
.side-link.is-active::before { content: ""; position: absolute; left: -18px; top: 50%; width: 4px; height: 60%; border-radius: 0 4px 4px 0; background: var(--gold); box-shadow: 0 0 14px var(--gold-glow); transform: translateY(-50%) scaleY(0); transform-origin: center; animation: barIn .4s var(--ease-spring) forwards; }
@keyframes barIn { to { transform: translateY(-50%) scaleY(1); } }
.side-sub { padding-left: 12px; font-size: .92rem; }
.side-sep { height: 1px; background: var(--border); margin: 14px 8px; }

.sidebar-foot { padding-top: 14px; }
.sidebar-meta { display: flex; align-items: center; justify-content: space-between; font-size: .8rem; color: var(--faint); }
.sidebar-views { display: inline-flex; align-items: center; gap: 6px; }
.sidebar-views svg { width: 14px; height: 14px; }

/* --- Content column ------------------------------------------------------- */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
    display: flex; align-items: center; gap: 16px;
    padding: 0 clamp(16px, 3vw, 38px);
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    backdrop-filter: saturate(160%) blur(16px);
    border-bottom: 1px solid var(--border);
}
.sidebar-toggle { display: none; width: 42px; height: 42px; flex-shrink: 0; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); cursor: pointer; }
.sidebar-toggle svg { width: 20px; height: 20px; }
.search { position: relative; flex: 1; max-width: 540px; display: flex; align-items: center; }
.search-icon { position: absolute; left: 16px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; transition: color .3s var(--ease); }
.search:focus-within .search-icon { color: var(--gold); }
.search-input { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--pill); padding: 12px 18px 12px 44px; transition: border-color .3s var(--ease), box-shadow .3s var(--ease); }
.search-input::placeholder { color: var(--faint); }
.search-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px var(--ring); }
.search-hint { position: absolute; right: 14px; font-size: .72rem; color: var(--faint); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; pointer-events: none; }
@media (max-width: 600px) { .search-hint { display: none; } .search-input { padding-right: 16px; } }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.main { flex: 1; padding: 32px clamp(16px, 3vw, 40px) 64px; }
.container { width: 100%; max-width: var(--content-max); margin-inline: auto; }

/* --- Sidebar drawer (mobile) ---------------------------------------------- */
.scrim { display: none; position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, .6); backdrop-filter: blur(2px); opacity: 0; transition: opacity .3s var(--ease); }
@media (max-width: 980px) {
    .sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-104%); visibility: hidden; transition: transform .4s var(--ease), visibility 0s .4s; box-shadow: var(--shadow); }
    .layout.nav-open .sidebar { transform: translateX(0); visibility: visible; transition: transform .4s var(--ease), visibility 0s 0s; }
    .layout.nav-open .scrim { display: block; opacity: 1; }
    .sidebar-toggle { display: inline-flex; }
}

/* --- Helpers -------------------------------------------------------------- */
.section { padding: 44px 0; }
.section-sm { padding: 24px 0; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 1rem; }
.section-head { max-width: 640px; margin: 0 0 30px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head p { color: var(--muted); margin: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .74rem; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; color: var(--gold); padding: 6px 13px; border: 1px solid var(--border-2); border-radius: var(--pill); margin-bottom: 16px; }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold-glow); }
.gradient-text { background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* --- Buttons -------------------------------------------------------------- */
.btn {
    position: relative; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: inherit; font-weight: 600; line-height: 1; padding: 12px 22px;
    border-radius: 12px; border: 1px solid transparent; cursor: pointer;
    transition: transform .25s var(--ease), box-shadow .35s var(--ease), background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
    white-space: nowrap;
}
.btn::after { content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-18deg); transition: left .6s var(--ease); }
.btn:hover::after { left: 130%; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--gold-2), var(--gold-deep)); color: var(--on-gold); }
.btn-primary:hover { box-shadow: var(--shadow-gold); color: var(--on-gold); }
.btn-outline { background: transparent; color: var(--gold); border-color: var(--border-2); }
.btn-outline:hover { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-2); }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger::after { display: none; }
.btn-danger:hover { filter: brightness(1.05); color: #fff; }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; border-radius: 14px; }
.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* --- Hero (editorial, no banner) ------------------------------------------ */
.hero { position: relative; padding: 48px 0 28px; }
.hero-inner { max-width: 760px; }
.hero-title { font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -.03em; margin-bottom: 18px; }
.hero-lead { font-size: 1.2rem; color: var(--muted); max-width: 560px; margin: 0 0 28px; }

.home-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 22px;
    max-width: 760px;
}
.home-category-chip {
    flex-wrap: wrap;
    row-gap: 6px;
    box-shadow: 0 14px 34px -24px var(--gold);
}
.home-category-chip:hover {
    box-shadow: var(--shadow-gold);
    color: var(--on-gold);
}
.home-category-name {
    font-weight: 700;
    color: inherit;
}
.home-category-count {
    color: inherit;
    font-size: .84rem;
    font-weight: 600;
    opacity: .82;
    white-space: nowrap;
}
.hero-stats { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 40px; }
.stat-chip { padding: 16px 22px; border: 1px solid var(--border); border-radius: var(--r); background: var(--glass); backdrop-filter: blur(10px); min-width: 120px; }
.stat-chip .stat-value { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--gold); }
.stat-chip .stat-label { color: var(--muted); font-size: .85rem; }

/* --- Filter chips --------------------------------------------------------- */
/* Filter chips — a segmented "track" (one unified pill bar) holding plain,
   borderless labels with a single filled gold pill for the active item.
   A blend of a segmented control + our gold identity (unlike either reference). */
.filter-bar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    margin: 6px 0 28px;
    padding: 6px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--pill);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), var(--shadow-sm);
    backdrop-filter: blur(10px);
    overflow-x: auto;
    scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.chip {
    font: inherit; font-weight: 600; font-size: .9rem;
    padding: 9px 18px; border-radius: var(--pill);
    color: var(--muted); background: transparent; border: 0;
    white-space: nowrap; cursor: pointer;
    transition: color .3s var(--ease), background .3s var(--ease), transform .2s var(--ease);
}
.chip:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.chip.is-active, .chip.is-active:hover {
    color: var(--on-gold);
    background: linear-gradient(135deg, var(--gold-2), var(--gold-deep));
    box-shadow: 0 6px 18px -7px var(--gold-glow);
}

/* --- Cards ---------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.card-body { padding: 24px; }
.feature { padding: 26px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); transition: transform .4s var(--ease), border-color .4s var(--ease), box-shadow .4s var(--ease); }
.feature:hover { transform: translateY(-6px); border-color: var(--border-2); box-shadow: var(--shadow); }
.feature-icon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; font-size: 1.4rem; color: var(--on-gold); background: linear-gradient(140deg, var(--gold-2), var(--gold-deep)); margin-bottom: 18px; box-shadow: 0 12px 26px -10px var(--gold-glow); transition: transform .5s var(--ease-spring); }
.feature:hover .feature-icon { transform: translateY(-3px) rotate(-6deg); }
.feature h3 { font-size: 1.12rem; margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; }

/* --- Product cards -------------------------------------------------------- */
.product-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; transition: transform .45s var(--ease), border-color .4s var(--ease), box-shadow .45s var(--ease); }
.product-card:hover { transform: translateY(-8px); border-color: color-mix(in srgb, var(--gold) 45%, transparent); box-shadow: var(--shadow); }
.product-media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.product-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .7s var(--ease); }
.product-card:hover .product-img { transform: scale(1.08); }
.product-img-fallback { display: grid; place-items: center; background-size: cover; background-position: center; font-family: var(--font-display); font-size: 3rem; font-weight: 700; color: rgba(255, 255, 255, .92); text-shadow: 0 4px 18px rgba(0, 0, 0, .35); }
.product-media-grad { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.55)); opacity: .6; transition: opacity .4s var(--ease); }
.product-card:hover .product-media-grad { opacity: .85; }
/* Glint that sweeps across the artwork on hover. */
.product-media::after { content: ""; position: absolute; top: 0; left: 0; width: 60%; height: 100%; z-index: 1; pointer-events: none; background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, .28) 50%, transparent 100%); transform: translateX(-180%) skewX(-14deg); transition: transform .85s var(--ease); }
.product-card:hover .product-media::after { transform: translateX(300%) skewX(-14deg); }
.product-badge { position: absolute; top: 12px; left: 12px; z-index: 2; }
.product-hover { position: absolute; left: 12px; bottom: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--on-gold); background: linear-gradient(135deg, var(--gold-2), var(--gold-deep)); padding: 7px 13px; border-radius: var(--pill); opacity: 0; transform: translateY(10px); box-shadow: 0 10px 24px -8px var(--gold-glow); transition: opacity .4s var(--ease), transform .4s var(--ease-spring); }
.product-card:hover .product-hover { opacity: 1; transform: translateY(0); }
.product-hover .arrow { display: inline-block; transition: transform .4s var(--ease-spring); }
.product-card:hover .product-hover .arrow { transform: translateX(4px); }
.product-body { display: flex; flex-direction: column; gap: 10px; padding: 18px; flex: 1; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: .72rem; font-weight: 600; padding: 4px 10px; border-radius: 7px; color: var(--tc, var(--muted)); background: color-mix(in srgb, var(--tc, var(--muted)) 14%, transparent); border: 1px solid color-mix(in srgb, var(--tc, var(--muted)) 30%, transparent); }
.product-title { font-size: 1.12rem; margin: 0; }
.product-title a { color: var(--text); }
.product-title a:hover { color: var(--gold); }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 6px; }
.price { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--gold); }
.views { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; font-weight: 500; }
.views svg { width: 15px; height: 15px; }

/* --- Badges --------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 600; padding: 5px 11px; border-radius: var(--pill); line-height: 1; background: var(--glass); backdrop-filter: blur(6px); border: 1px solid var(--border); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.badge-online { color: var(--success); }
.badge-offline { color: var(--danger); }
.badge-maintenance { color: var(--warning); }
.badge-featured { color: var(--gold); }
.badge-featured::before { box-shadow: none; }

/* --- Page header ---------------------------------------------------------- */
.page-header { padding: 8px 0 6px; }
.page-header h1 { margin-bottom: 8px; }
.page-header p { color: var(--muted); font-size: 1.05rem; margin: 0; }

/* --- Forms ---------------------------------------------------------------- */
.auth-wrap { display: grid; place-items: center; padding: 36px 0 64px; }
.auth-card { width: 100%; max-width: 444px; }
.form { display: flex; flex-direction: column; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-label { font-size: .9rem; font-weight: 600; }
.form-input, .form-textarea, .form-select { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px; width: 100%; transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background .3s var(--ease); }
.form-input:focus, .form-textarea:focus, .form-select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px var(--ring); }
.form-textarea { min-height: 130px; resize: vertical; }
.form-hint { font-size: .82rem; color: var(--muted); }
.auth-switch { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: .95rem; }
.auth-switch a { color: var(--gold); font-weight: 700; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* File drop / upload control */
.file-field { border: 1.5px dashed var(--border-2); border-radius: var(--r-sm); padding: 18px; text-align: center; color: var(--muted); transition: border-color .3s var(--ease), background .3s var(--ease); cursor: pointer; }
.file-field:hover { border-color: var(--gold); background: var(--gold-soft); color: var(--text); }

/* --- Custom animated select (enhances <select class="fancy"> via JS) ------ */
.fsel { position: relative; }
.fsel .fsel-native { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; } /* kept in the form for submit + no-JS fallback */
.fsel-trigger { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; font: inherit; text-align: left; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px; cursor: pointer; transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background .3s var(--ease); }
.fsel-trigger:hover { border-color: var(--border-2); }
.fsel.open .fsel-trigger, .fsel-trigger:focus-visible { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px var(--ring); }
.fsel-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsel-chev { flex: none; width: 18px; height: 18px; color: var(--muted); transition: transform .35s var(--ease-spring), color .25s var(--ease); }
.fsel.open .fsel-chev { transform: rotate(180deg); color: var(--gold); }
.fsel-menu { position: absolute; top: calc(100% + 7px); left: 0; right: 0; z-index: 50; padding: 6px; max-height: 264px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-sm); box-shadow: var(--shadow); transform-origin: top center; opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.97); transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s .2s; }
.fsel.open .fsel-menu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); transition: opacity .22s var(--ease), transform .28s var(--ease-spring), visibility 0s 0s; }
.fsel-option { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-xs, 8px); color: var(--text); font-size: .95rem; cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease); }
.fsel-option:hover { background: var(--surface-3); }
.fsel-option.is-selected { color: var(--gold); font-weight: 600; background: var(--gold-soft); }
.fsel-option .fsel-check { width: 16px; height: 16px; flex: none; opacity: 0; transition: opacity .15s var(--ease); }
.fsel-option.is-selected .fsel-check { opacity: 1; }

/* --- Alerts --------------------------------------------------------------- */
.alert { padding: 14px 16px; border-radius: var(--r-sm); margin: 18px 0; border: 1px solid transparent; font-size: .95rem; }
.alert-success { background: var(--success-soft); color: var(--alert-success-text); border-color: color-mix(in srgb, var(--success) 28%, transparent); }
.alert-error { background: var(--danger-soft); color: var(--alert-danger-text); border-color: color-mix(in srgb, var(--danger) 28%, transparent); }
.alert-info { background: var(--gold-soft); color: var(--alert-info-text); border-color: color-mix(in srgb, var(--gold) 28%, transparent); }

/* --- Tables (admin) ------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm); }
.table { width: 100%; border-collapse: collapse; min-width: 680px; }
.table th, .table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }
.table tbody tr { transition: background .25s var(--ease); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table-thumb { width: 46px; height: 34px; border-radius: 8px; object-fit: cover; background: var(--surface-3); }

/* --- Admin ---------------------------------------------------------------- */
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.stat-card { padding: 22px 24px; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--gold); }
.stat-card .stat-label { color: var(--muted); font-size: .9rem; }

/* Admin panel tabs */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 26px; border-bottom: 1px solid var(--border); }
.admin-tab { display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .25s var(--ease), border-color .25s var(--ease); }
.admin-tab:hover { color: var(--text); }
.admin-tab.is-active { color: var(--gold); border-bottom-color: var(--gold); }
.admin-tab-ico { width: 17px; height: 17px; flex: none; }

/* Settings: form + live preview */
.settings-layout { display: grid; grid-template-columns: minmax(340px, 460px) 1fr; gap: 26px; align-items: start; }
@media (max-width: 1000px) { .settings-layout { grid-template-columns: 1fr; } }
.preview-pane { position: sticky; top: 90px; }
.preview-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.preview-frame { width: 100%; height: 620px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.settings-layout .form h3 { margin: 6px 0 -6px; font-size: 1rem; color: var(--gold); }
.cat-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); flex-wrap: wrap; }

/* --- Product detail: gallery + video -------------------------------------- */
.product-media-column { display: flex; flex-direction: column; gap: 20px; }
.product-info-column { position: sticky; top: 90px; align-self: start; }
.product-video-list { display: flex; flex-direction: column; gap: 12px; }
.product-video-list h3 { margin: 0; }
.product-description-box { padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--r-sm); background: color-mix(in srgb, var(--surface) 62%, transparent); box-shadow: var(--shadow-sm); }
.product-description-wide { width: 100%; margin-top: 22px; min-height: 150px; }
.product-description-label { margin: 0 0 9px; color: var(--faint); font-size: .72rem; font-weight: 800; letter-spacing: .12em; line-height: 1; text-transform: uppercase; }
.product-description-box .product-description { color: color-mix(in srgb, var(--text) 88%, var(--muted)); font-size: .94rem; line-height: 1.68; }
.product-description-box .product-description > :last-child { margin-bottom: 0; }
.gallery { display: flex; flex-direction: column; gap: 12px; }
.gallery-main { position: relative; aspect-ratio: 16 / 10; border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.gallery-thumb { width: 84px; height: 60px; padding: 0; background: none; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); cursor: pointer; opacity: .65; transition: opacity .3s var(--ease), border-color .3s var(--ease), transform .25s var(--ease); }
.gallery-thumb:hover { opacity: 1; transform: translateY(-2px); }
.gallery-thumb.is-active { opacity: 1; border-color: var(--gold); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); background: #000; margin-bottom: 0; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mm-video-player { color: #fff; }
.mm-video-player video { object-fit: contain; background: #000; }
.mm-video-bigplay { position: absolute; left: 50%; top: 50%; z-index: 3; transform: translate(-50%, -50%); width: 72px; height: 72px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.62); color: #fff; font-size: 1.65rem; line-height: 1; cursor: pointer; display: grid; place-items: center; backdrop-filter: blur(8px); transition: opacity .2s var(--ease), transform .2s var(--ease), background-color .2s var(--ease); }
.mm-video-bigplay:hover { background: rgba(0,0,0,.82); transform: translate(-50%, -50%) scale(1.06); }
.mm-video-player.is-playing .mm-video-bigplay { opacity: 0; pointer-events: none; }
.mm-video-controls { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 4; display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; background: rgba(0,0,0,.68); backdrop-filter: blur(10px); opacity: 0; transform: translateY(8px); transition: opacity .2s var(--ease), transform .2s var(--ease); }
.mm-video-player:hover .mm-video-controls, .mm-video-player:focus-within .mm-video-controls, .mm-video-player.is-paused .mm-video-controls { opacity: 1; transform: translateY(0); }
.mm-video-btn { flex: 0 0 auto; min-width: 38px; height: 34px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; cursor: pointer; display: grid; place-items: center; font-weight: 800; }
.mm-video-btn:hover { border-color: var(--gold); background: rgba(255,255,255,.14); }
.mm-video-progress { flex: 1 1 auto; min-width: 80px; accent-color: var(--gold); cursor: pointer; }
.mm-video-time { flex: 0 0 auto; min-width: 96px; color: rgba(255,255,255,.86); font-size: .78rem; text-align: center; font-variant-numeric: tabular-nums; }
.mm-video-fallback { position: absolute; left: 14px; right: 14px; bottom: 60px; z-index: 5; display: none; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.76); color: #fff; font-size: .88rem; text-align: center; }
.mm-video-fallback a { color: var(--gold); font-weight: 800; }
.mm-video-player.is-error .mm-video-fallback { display: block; }
@media (max-width: 640px) { .mm-video-controls { left: 8px; right: 8px; bottom: 8px; gap: 6px; padding: 6px; } .mm-video-time { display: none; } .mm-video-bigplay { width: 58px; height: 58px; } .mm-video-btn { min-width: 34px; height: 32px; } }

/* --- Comments / reviews --------------------------------------------------- */
.reviews-grid { display: grid; grid-template-columns: 360px 1fr; gap: 24px; align-items: start; }
@media (max-width: 880px) { .reviews-grid { grid-template-columns: 1fr; } .product-info-column { position: static; } }
.review-list { display: flex; flex-direction: column; gap: 16px; }
.review { padding: 20px 22px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: var(--r); box-shadow: var(--shadow-sm); transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.review:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.review-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.review-name { font-family: var(--font-display); font-weight: 700; color: var(--gold); }
.review-date { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.review-msg { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.review-del { margin-top: 10px; }

/* --- Terms & FAQ ---------------------------------------------------------- */
.terms-grid { gap: 18px 34px; }
.term-title { font-size: 1.04rem; color: var(--gold); margin: 0 0 6px; }
.term-body p { margin: 0 0 6px; }
.term-body ul { margin: 4px 0 0; padding-left: 20px; }
.term-body li { margin: 3px 0; }
.faq-intro p { margin: 0 0 6px; }
.faq-intro ul { margin: 4px 0 0; padding-left: 20px; }

.faq-list { display: flex; flex-direction: column; gap: 12px; max-width: 1000px; margin: 0 auto; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; transition: border-color .3s var(--ease), box-shadow .3s var(--ease); }
.faq-item.open { border-color: color-mix(in srgb, var(--gold) 55%, transparent); box-shadow: var(--shadow-sm); }
.faq-q { width: 100%; text-align: left; background: transparent; border: 0; color: var(--text); font-family: var(--font-display); font-weight: 600; font-size: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; cursor: pointer; transition: color .25s var(--ease); }
.faq-q:hover { color: var(--gold); }
.faq-item.open .faq-q { color: var(--gold); }
.faq-chevron { width: 20px; height: 20px; flex-shrink: 0; transition: transform .4s var(--ease-spring); }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-a-wrap { display: grid; grid-template-rows: 1fr; }
.faq-list.accordion-ready .faq-a-wrap { grid-template-rows: 0fr; }
.faq-list.accordion-ready .faq-item.open .faq-a-wrap { grid-template-rows: 1fr; }
.faq-list.accordion-animated .faq-a-wrap { transition: grid-template-rows .4s var(--ease); }
.faq-a { overflow: hidden; min-height: 0; }
.faq-a-body { padding: 2px 22px 20px; }
.faq-a-body p { margin: 0 0 8px; }
.faq-a-body p:last-child, .faq-a-body ul:last-child { margin-bottom: 0; }
.faq-a-body ul { margin: 4px 0; padding-left: 20px; }

/* --- CTA band ------------------------------------------------------------- */
.cta { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 54px 40px; text-align: center; border: 1px solid var(--border-2); background: linear-gradient(135deg, var(--surface-2), var(--bg-elev)); box-shadow: var(--shadow); }
.cta::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 78% at 50% 0%, var(--gold-glow), transparent 62%); opacity: .35; pointer-events: none; }
.cta > * { position: relative; }
.cta h2 { color: var(--gold); }
.cta p { color: var(--muted); max-width: 540px; margin: 0 auto 24px; }

/* --- Content footer ------------------------------------------------------- */
.content-foot { border-top: 1px solid var(--border); margin-top: 24px; padding: 28px clamp(16px, 3vw, 40px); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.content-foot a { color: var(--muted); }
.content-foot a:hover { color: var(--gold); }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a { display: inline-flex; align-items: center; gap: 7px; }
.foot-links a svg { width: 16px; height: 16px; flex: none; }

/* --- Theme toggle --------------------------------------------------------- */
.theme-toggle { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 12px; cursor: pointer; transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease); }
.theme-toggle:hover { border-color: var(--gold); color: var(--gold); }
.theme-toggle svg { width: 19px; height: 19px; transition: transform .5s var(--ease-spring); }
.theme-toggle:hover svg { transform: rotate(35deg); }
.theme-icon { display: none; }
.theme-icon-sun { display: block; }
:root[data-theme="light"] .theme-icon-sun { display: none; }
:root[data-theme="light"] .theme-icon-moon { display: block; }

/* --- Back-to-top button --------------------------------------------------- */
.to-top {
    position: fixed;
    right: clamp(16px, 3vw, 30px);
    bottom: clamp(16px, 3vw, 28px);
    z-index: 60;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    color: var(--on-gold);
    background: linear-gradient(135deg, var(--gold-2), var(--gold-deep));
    box-shadow: var(--shadow-gold);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s .3s, box-shadow .3s var(--ease);
}
.to-top.show {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s 0s, box-shadow .3s var(--ease);
}
.to-top:hover { transform: translateY(-3px); box-shadow: 0 16px 40px -10px var(--gold-glow); }
.to-top:active { transform: translateY(0); }
.to-top svg { width: 22px; height: 22px; }

/* --- Motion: scroll reveal + entrance ------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .65s var(--ease), transform .8s var(--ease); }

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

/* --- Product rich text editor -------------------------------------------- */
.rich-editor { border: 1px solid var(--border); border-radius: var(--r-sm); overflow: visible; background: var(--surface-2); }
.rich-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 76%, transparent); border-radius: var(--r-sm) var(--r-sm) 0 0; }
.rich-toolbar button, .rich-control, .rich-color { appearance: none; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 9px; padding: 7px 10px; font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; transition: border-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease); }
.rich-control { min-width: 118px; cursor: pointer; }
.rich-control-sm { min-width: 88px; }
.rich-color { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; }
.rich-color input { width: 28px; height: 24px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.rich-toolbar button:hover, .rich-toolbar button:focus, .rich-control:hover, .rich-control:focus, .rich-color:hover { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--ring); }
.rich-toolbar button:active { transform: translateY(1px); }
.rich-toolbar button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.rich-sep { width: 1px; align-self: stretch; min-height: 30px; background: var(--border); margin: 0 3px; }
.rich-area { min-height: 320px; padding: 18px; color: var(--text); line-height: 1.75; outline: none; overflow: auto; background: color-mix(in srgb, var(--surface) 58%, transparent); border-radius: 0 0 var(--r-sm) var(--r-sm); }
.rich-area:focus { box-shadow: inset 0 0 0 3px var(--ring); }
.rich-area:empty::before { content: 'Write a detailed product description…'; color: var(--muted); }
.rich-source { display: none; min-height: 320px; border-radius: 0 0 var(--r-sm) var(--r-sm); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; line-height: 1.55; }

.product-description h1, .product-description h2, .product-description h3, .product-description h4,
.rich-area h1, .rich-area h2, .rich-area h3, .rich-area h4 { color: var(--text); margin: 1em 0 .45em; line-height: 1.22; }
.product-description p, .rich-area p { margin: 0 0 .85em; }
.product-description ul, .product-description ol, .rich-area ul, .rich-area ol { margin: .5em 0 1em 1.35em; padding: 0; }
.product-description blockquote, .rich-area blockquote { margin: 1em 0; padding: .75em 1em; border-left: 3px solid var(--gold); background: color-mix(in srgb, var(--gold) 8%, transparent); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.product-description pre, .rich-area pre { overflow: auto; padding: 1em; border: 1px solid var(--border); border-radius: var(--r-sm); background: color-mix(in srgb, #000 22%, transparent); white-space: pre-wrap; }
.product-description a, .rich-area a { color: var(--gold); font-weight: 700; text-decoration: none; }
.product-description a:hover, .rich-area a:hover { text-decoration: underline; }
.product-description table, .rich-area table { width: 100%; border-collapse: collapse; margin: 1em 0; overflow: hidden; border-radius: var(--r-sm); }
.product-description th, .product-description td, .rich-area th, .rich-area td { border: 1px solid var(--border); padding: .65em .75em; vertical-align: top; }
.product-description figure, .rich-area figure { margin: 1em 0; }
.product-description figcaption, .rich-area figcaption { color: var(--muted); font-size: .88rem; margin-top: .4em; }
.product-description img, .rich-area img { max-width: 100%; height: auto; border-radius: var(--r-sm); border: 1px solid var(--border); }
.product-description video, .rich-area video { max-width: 100%; border-radius: var(--r-sm); border: 1px solid var(--border); background: #000; }
.product-description hr, .rich-area hr { border: 0; border-top: 1px solid var(--border); margin: 1.25em 0; }


/* Product detail media carousel: images + videos on the left with controls under media */
.product-media-carousel { position: relative; border-radius: var(--r); overflow: visible; background: var(--surface-2); }
.media-carousel-stage { position: relative; aspect-ratio: 16 / 10; min-height: 280px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r); background: #000; box-shadow: var(--shadow-sm); }
.media-carousel-slide { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .28s var(--ease); }
.media-carousel-slide.is-active { opacity: 1; pointer-events: auto; z-index: 1; }
.media-carousel-slide > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-carousel-slide .video-frame { width: 100%; height: 100%; aspect-ratio: auto; border: 0; border-radius: 0; margin: 0; }
.media-carousel-controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.media-arrow { width: 46px; height: 46px; border-radius: 999px; border: 1px solid rgba(255,255,255,.24); background: rgba(0,0,0,.72); color: #fff; display: none; place-items: center; cursor: pointer; font-size: 1.35rem; line-height: 1; backdrop-filter: blur(8px); transition: background-color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease); }
.has-media-arrows .media-arrow { display: grid; }
.media-arrow:hover { background: rgba(0,0,0,.86); border-color: var(--gold); transform: scale(1.06); }
.media-counter { min-width: 54px; text-align: center; padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: rgba(0,0,0,.58); color: #fff; font-size: .86rem; backdrop-filter: blur(8px); }
@media (max-width: 640px) { .product-media-column { padding-inline: 18px; } .media-carousel-stage { min-height: 220px; } .media-arrow { width: 40px; height: 40px; } .media-carousel-controls { margin-top: 12px; gap: 12px; } }


/* --- Jodit external product editor ---------------------------------------- */
.jodit-container:not(.jodit_inline) {
    --jodit-bg: var(--surface-2);
    --jodit-bg-soft: var(--surface);
    --jodit-bg-strong: var(--surface-3);
    --jodit-text: var(--text);
    --jodit-muted: var(--muted);
    --jodit-border: var(--border);
    --jodit-accent: var(--gold);
    border-color: var(--jodit-border) !important;
    border-radius: var(--r-sm) !important;
    overflow: hidden;
    background: var(--jodit-bg) !important;
    color: var(--jodit-text) !important;
    box-shadow: var(--shadow-sm);
}

.jodit,
.jodit-container,
.jodit-container *,
.jodit-dialog,
.jodit-dialog *,
.jodit-popup,
.jodit-popup * {
    scrollbar-color: var(--border-2) var(--surface);
}

.jodit-toolbar__box,
.jodit-toolbar-editor-collection,
.jodit-toolbar-button,
.jodit-status-bar,
.jodit-status-bar__item,
.jodit-workplace,
.jodit-wysiwyg,
.jodit-source,
.jodit-ui-group,
.jodit-popup,
.jodit-popup__content,
.jodit-dialog__box,
.jodit-dialog__header,
.jodit-dialog__content,
.jodit-dialog__footer,
.jodit-dialog__panel,
.jodit-select,
.jodit-select__options,
.jodit-select__option,
.jodit-ui-block,
.jodit-ui-list,
.jodit-ui-list__box,
.jodit-color-picker,
.jodit-color-picker__box {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

.jodit-workplace,
.jodit-wysiwyg,
.jodit-source,
.jodit-container textarea,
.jodit-container .jodit-source__mirror,
.jodit-container .ace_editor,
.jodit-container .ace_scroller,
.jodit-container .ace_content {
    background: var(--surface-2) !important;
    color: var(--text) !important;
}

.jodit-wysiwyg {
    padding: 18px !important;
    line-height: 1.25 !important;
    caret-color: var(--gold);
}

.jodit-wysiwyg::before,
.jodit-placeholder,
.jodit-status-bar,
.jodit-status-bar a,
.jodit-status-bar span,
.jodit-toolbar-button__text,
.jodit-ui-label,
.jodit-ui-input__label,
.jodit-ui-checkbox__label {
    color: var(--muted) !important;
}

.jodit-toolbar-button__button,
.jodit-toolbar-button__trigger,
.jodit-ui-button,
.jodit-ui-input,
.jodit-ui-input__input,
.jodit-ui-select,
.jodit-ui-select__select,
.jodit-ui-textarea,
.jodit-ui-textarea__input,
.jodit-input,
.jodit-select__trigger,
.jodit-toolbar-button__list,
.jodit-toolbar-button__list * {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

.jodit-ui-input__input::placeholder,
.jodit-ui-textarea__input::placeholder,
.jodit-input::placeholder {
    color: var(--faint) !important;
    opacity: 1 !important;
}

.jodit-toolbar-button:hover:not([disabled]) .jodit-toolbar-button__button,
.jodit-toolbar-button:hover:not([disabled]) .jodit-toolbar-button__trigger,
.jodit-toolbar-button[aria-pressed="true"] .jodit-toolbar-button__button,
.jodit-toolbar-button__button:hover,
.jodit-toolbar-button__trigger:hover,
.jodit-select__option:hover,
.jodit-ui-button:hover,
.jodit-ui-button:focus {
    background: var(--gold-soft) !important;
    color: var(--gold-2) !important;
    border-color: var(--gold) !important;
}

.jodit-toolbar-button__button[disabled],
.jodit-toolbar-button__trigger[disabled],
.jodit-ui-button[disabled] {
    opacity: .45 !important;
}

.jodit-icon,
.jodit-toolbar-button__icon,
.jodit-toolbar-button__icon svg,
.jodit-toolbar-button__trigger svg,
.jodit-toolbar-button__trigger path,
.jodit-ui-button__icon,
.jodit-ui-button__text,
.jodit-popup svg,
.jodit-dialog svg {
    color: var(--text) !important;
    fill: currentColor !important;
    stroke: currentColor !important;
}

.jodit-toolbar-button:hover:not([disabled]) .jodit-toolbar-button__icon,
.jodit-toolbar-button:hover:not([disabled]) .jodit-toolbar-button__trigger,
.jodit-toolbar-button:hover:not([disabled]) svg,
.jodit-toolbar-button[aria-pressed="true"] svg {
    color: var(--gold-2) !important;
}

.jodit-wysiwyg a { color: var(--gold) !important; }
.jodit-wysiwyg table { border-collapse: collapse; width: 100%; }
.jodit-wysiwyg th,
.jodit-wysiwyg td { border: 1px solid var(--border); padding: .65em .75em; }
.jodit-wysiwyg hr { border: 0; border-top: 1px solid var(--border-2); }
.jodit-fallback { display: block !important; min-height: 360px; }

:root[data-theme="light"] .jodit-container:not(.jodit_inline),
:root[data-theme="light"] .jodit-workplace,
:root[data-theme="light"] .jodit-wysiwyg,
:root[data-theme="light"] .jodit-source,
:root[data-theme="light"] .jodit-container textarea,
:root[data-theme="light"] .jodit-container .jodit-source__mirror,
:root[data-theme="light"] .jodit-container .ace_editor,
:root[data-theme="light"] .jodit-container .ace_scroller,
:root[data-theme="light"] .jodit-container .ace_content {
    background: var(--surface) !important;
    color: var(--text) !important;
}

:root[data-theme="light"] .jodit-toolbar__box,
:root[data-theme="light"] .jodit-toolbar-editor-collection,
:root[data-theme="light"] .jodit-status-bar,
:root[data-theme="light"] .jodit-popup,
:root[data-theme="light"] .jodit-popup__content,
:root[data-theme="light"] .jodit-dialog__box,
:root[data-theme="light"] .jodit-dialog__header,
:root[data-theme="light"] .jodit-dialog__content,
:root[data-theme="light"] .jodit-dialog__footer,
:root[data-theme="light"] .jodit-dialog__panel,
:root[data-theme="light"] .jodit-toolbar-button__button,
:root[data-theme="light"] .jodit-toolbar-button__trigger,
:root[data-theme="light"] .jodit-ui-button,
:root[data-theme="light"] .jodit-ui-input,
:root[data-theme="light"] .jodit-ui-input__input,
:root[data-theme="light"] .jodit-ui-select,
:root[data-theme="light"] .jodit-ui-textarea,
:root[data-theme="light"] .jodit-input,
:root[data-theme="light"] .jodit-select__trigger,
:root[data-theme="light"] .jodit-select__options,
:root[data-theme="light"] .jodit-select__option {
    background: var(--surface-2) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

/* Compact editor/product text spacing: pressing Enter should create a tight new line, not a paragraph-sized gap. */
.rich-area,
.jodit-wysiwyg,
.jodit-wysiwyg[contenteditable="true"] {
    line-height: 1.25 !important;
}

.rich-area p,
.rich-area div,
.rich-area li,
.rich-area h1,
.rich-area h2,
.rich-area h3,
.rich-area h4,
.rich-area h5,
.rich-area h6,
.jodit-wysiwyg p,
.jodit-wysiwyg div,
.jodit-wysiwyg li,
.jodit-wysiwyg h1,
.jodit-wysiwyg h2,
.jodit-wysiwyg h3,
.jodit-wysiwyg h4,
.jodit-wysiwyg h5,
.jodit-wysiwyg h6 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1.25 !important;
    min-height: 0 !important;
}

.rich-area p:empty,
.rich-area div:empty,
.jodit-wysiwyg p:empty,
.jodit-wysiwyg div:empty {
    min-height: 1.25em !important;
    margin: 0 !important;
}

.jodit-wysiwyg br {
    line-height: 1.25 !important;
}

.product-description,
.product-description * {
    line-height: 1.35 !important;
}

.product-description p,
.product-description div,
.product-description h1,
.product-description h2,
.product-description h3,
.product-description h4,
.product-description h5,
.product-description h6 {
    margin-top: 0 !important;
    margin-bottom: .2em !important;
}
.mm-video-player:fullscreen,
.mm-video-player:-webkit-full-screen { width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; border: 0; }
.mm-video-player:fullscreen video,
.mm-video-player:-webkit-full-screen video { object-fit: contain; }


/* Product image fullscreen viewer */
.media-carousel-slide > [data-fullscreenable-image] { cursor: zoom-in; }
.media-fullscreen-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 6;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.26);
    background: rgba(0,0,0,.64);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1;
    backdrop-filter: blur(8px);
    opacity: .86;
    transition: opacity .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease);
}
.media-fullscreen-btn:hover,
.media-fullscreen-btn:focus-visible {
    opacity: 1;
    transform: scale(1.06);
    border-color: var(--gold);
    background: rgba(0,0,0,.82);
}
.product-description img[data-fullscreenable-image] { cursor: zoom-in; }
.image-fullscreen-open { overflow: hidden; }
.mm-image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 28px;
    background: rgba(0,0,0,.96);
    opacity: 0;
    transition: opacity .15s var(--ease);
}
.mm-image-lightbox.is-open { opacity: 1; }
.mm-image-lightbox-img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 22px 80px rgba(0,0,0,.55);
}
.mm-image-lightbox-close {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 10001;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(0,0,0,.68);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
    backdrop-filter: blur(8px);
}
.mm-image-lightbox-close:hover,
.mm-image-lightbox-close:focus-visible { border-color: var(--gold); background: rgba(0,0,0,.86); }
.mm-image-lightbox:fullscreen,
.mm-image-lightbox:-webkit-full-screen { width: 100vw; height: 100vh; }
@media (max-width: 640px) {
    .media-fullscreen-btn { width: 38px; height: 38px; top: 10px; right: 10px; }
    .mm-image-lightbox { padding: 14px; }
    .mm-image-lightbox-close { width: 42px; height: 42px; top: 12px; right: 12px; }
}

/* --- Code blocks + syntax highlighting ----------------------------------- */
.product-description pre.mm-code-block,
.jodit-wysiwyg pre.mm-code-block,
.rich-area pre.mm-code-block {
    position: relative;
    margin: .85em 0 !important;
    padding: 2.35rem 1rem 1rem !important;
    border: 1px solid rgba(212,175,55,.28) !important;
    border-radius: var(--r-sm) !important;
    background: #0d1117 !important;
    color: #e6edf3 !important;
    box-shadow: 0 16px 40px rgba(0,0,0,.24);
    overflow: auto;
    max-width: 100%;
    line-height: 1.45 !important;
    white-space: pre;
    tab-size: 4;
}

.product-description pre.mm-code-block::before,
.jodit-wysiwyg pre.mm-code-block::before,
.rich-area pre.mm-code-block::before {
    content: attr(data-language);
    position: absolute;
    top: .55rem;
    left: .75rem;
    padding: .18rem .55rem;
    border-radius: 999px;
    border: 1px solid rgba(212,175,55,.38);
    background: rgba(212,175,55,.14);
    color: var(--gold-2);
    font: 700 .72rem/1 var(--font-main);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.product-description pre.mm-code-block code,
.jodit-wysiwyg pre.mm-code-block code,
.rich-area pre.mm-code-block code {
    display: block;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: inherit;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
    font-size: .92rem;
    line-height: 1.45 !important;
    white-space: pre;
}

.product-description :not(pre) > code,
.jodit-wysiwyg :not(pre) > code,
.rich-area :not(pre) > code {
    padding: .14em .38em;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-3);
    color: var(--gold-2);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
    font-size: .92em;
}

.product-description pre.mm-code-block .hljs,
.jodit-wysiwyg pre.mm-code-block .hljs,
.rich-area pre.mm-code-block .hljs {
    background: transparent !important;
    padding: 0 !important;
}

.mm-code-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    place-items: center;
    padding: 20px;
    background: rgba(0,0,0,.68);
    backdrop-filter: blur(10px);
}
.mm-code-modal.is-open { display: grid; }
.mm-code-dialog {
    width: min(760px, 100%);
    border: 1px solid var(--border-2);
    border-radius: var(--r-lg);
    background: var(--surface-2);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.mm-code-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(212,175,55,.12), transparent);
}
.mm-code-dialog-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.05rem;
}
.mm-code-close {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}
.mm-code-dialog-body { padding: 18px; }
.mm-code-dialog-body label { display: block; margin-bottom: 8px; color: var(--muted); font-weight: 700; }
.mm-code-language {
    width: 100%;
    margin-bottom: 14px;
}
.mm-code-textarea {
    width: 100%;
    min-height: 280px;
    resize: vertical;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: #0d1117;
    color: #e6edf3;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: .92rem;
    line-height: 1.45;
    tab-size: 4;
}
.mm-code-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 18px 18px;
    flex-wrap: wrap;
}


/* --- Admin upload progress ------------------------------------------------ */
.upload-file-summary { display: block; margin-top: 8px; word-break: break-word; }
.upload-progress-panel {
    display: grid;
    gap: 10px;
    margin: 4px 0 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface-2);
}
.upload-progress-panel[hidden] { display: none; }
.upload-progress-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text); }
.upload-progress-top span { color: var(--gold); font-weight: 700; }
.upload-progress-bar { width: 100%; height: 14px; accent-color: var(--gold); }
.upload-progress-meta { color: var(--muted); font-size: .92rem; }
.upload-progress-panel.is-error { border-color: color-mix(in srgb, var(--danger) 55%, var(--border)); }
.upload-progress-panel.is-done { border-color: color-mix(in srgb, var(--success, #22c55e) 55%, var(--border)); }
.btn.is-uploading { pointer-events: none; opacity: .78; }
