/* =====================================================================
   Studio theme. Loaded after default_v2's theme.css (inherited pages keep
   working) and restyles everything with the tokens the layout writes from
   the theme settings (--s-*). Keep colors / sizes as tokens - no fixed hex
   values for things the owner can change.
   ===================================================================== */

:root {
    --s-muted: color-mix(in srgb, var(--s-text) 60%, var(--s-bg));
    --s-line: color-mix(in srgb, var(--s-text) 12%, var(--s-bg));
    --s-accent-soft: color-mix(in srgb, var(--s-accent) 10%, var(--s-bg));
    --s-on-accent: #ffffff;
    --s-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 8px 24px rgb(0 0 0 / .06);
    --s-gap: clamp(12px, 2vw, 24px);
    --s-section: clamp(40px, 6vw, 80px);
    /* default_v2 tokens -> Studio values, so inherited pages match */
    --primary: var(--s-accent);
    --secondary: var(--s-muted);
    --text: var(--s-text);
    --border: var(--s-line);
    --light: var(--s-surface);
    --white: var(--s-bg);
    --bs-link-color: var(--s-accent);
    --bs-link-hover-color: var(--s-accent);
    --bs-border-radius: var(--s-radius);
    --bs-border-color: var(--s-line);
}

/* ---------- base ---------- */
body.studio {
    font-family: var(--s-font-body);
    color: var(--s-text);
    background: var(--s-bg);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
.studio h1, .studio h2, .studio h3, .studio h4, .studio h5, .studio h6,
.studio .h1, .studio .h2, .studio .h3, .studio .h4, .studio .h5 {
    font-family: var(--s-font-heading);
    color: var(--s-text);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.studio a { color: inherit; }
.studio a:hover { color: var(--s-accent); }
.studio main { min-height: 50vh; }
.s-container, .studio .container {
    width: 100%;
    max-width: var(--s-width);
    margin-inline: auto;
    padding-inline: clamp(16px, 4vw, 32px);
}
.s-skip { position: absolute; z-index: 2000; background: var(--s-accent); color: var(--s-on-accent); padding: 8px 16px; }

/* ---------- buttons & forms (also the inherited pages) ---------- */
.studio .btn {
    border-radius: var(--s-btn-radius);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
    font-size: .95rem;
    padding: .65rem 1.25rem;
    border-width: 1px;
}
.studio .btn-sm { padding: .4rem .85rem; font-size: .85rem; }
.studio .btn-lg { padding: .85rem 1.75rem; font-size: 1rem; }
.studio .btn-primary {
    background: var(--s-accent); border-color: var(--s-accent); color: var(--s-on-accent);
}
.studio .btn-primary:hover, .studio .btn-primary:focus-visible {
    background: color-mix(in srgb, var(--s-accent) 85%, black); border-color: color-mix(in srgb, var(--s-accent) 85%, black); color: var(--s-on-accent);
}
.studio .btn-outline-primary { color: var(--s-text); border-color: var(--s-line); background: transparent; }
.studio .btn-outline-primary:hover { background: var(--s-text); border-color: var(--s-text); color: var(--s-bg); }
.studio .btn-outline-secondary { color: var(--s-text); border-color: var(--s-line); }
.studio .btn-outline-secondary:hover { background: var(--s-surface); color: var(--s-text); border-color: var(--s-line); }
.studio .form-control, .studio .form-select {
    border-radius: calc(var(--s-radius) * .8);
    border-color: var(--s-line);
    padding: .6rem .85rem;
    font-size: .95rem;
    background-color: var(--s-bg);
    color: var(--s-text);
}
.studio .form-control-sm, .studio .form-select-sm { padding: .35rem .6rem; font-size: .875rem; }
.studio .form-control:focus, .studio .form-select:focus, .studio .form-check-input:focus {
    border-color: var(--s-accent);
    box-shadow: 0 0 0 3px var(--s-accent-soft);
}
.studio .form-check-input:checked { background-color: var(--s-accent); border-color: var(--s-accent); }
.studio .card, .studio .border-minimal, .studio .modal-content, .studio .alert, .studio .dropdown-menu, .studio .toast {
    border-radius: var(--s-radius);
}
.studio .card, .studio .border-minimal { border: 1px solid var(--s-line); background: var(--s-bg); }
.studio .bg-minimal, .studio .bg-light { background: var(--s-surface) !important; }
.studio .text-minimal, .studio .text-muted { color: var(--s-muted) !important; }
.studio .dropdown-menu { border-color: var(--s-line); box-shadow: var(--s-shadow); padding: .4rem; }
.studio .dropdown-item { border-radius: calc(var(--s-radius) * .6); padding: .45rem .75rem; }
.studio .dropdown-item.active, .studio .dropdown-item:active { background: var(--s-accent-soft); color: var(--s-text); }
.studio .section { padding: var(--s-section) 0; }
.studio .section-title { text-align: start; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; margin-bottom: 1.5rem; }
.studio .badge.bg-danger { background: var(--s-sale) !important; }
.studio .breadcrumb { font-size: .875rem; margin-bottom: 1rem; }
.studio .breadcrumb a { color: var(--s-muted); text-decoration: none; }

/* ---------- announcement + header ---------- */
.s-announcement {
    background: var(--s-text); color: var(--s-bg);
    text-align: center; font-size: .85rem; padding: .5rem 1rem;
}
.s-announcement a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.s-header {
    background: var(--s-header-bg);
    border-bottom: 1px solid var(--s-line);
    z-index: 1030;
    transition: box-shadow .2s ease;
}
.s-header--sticky { position: sticky; top: 0; }
.s-header.is-scrolled { box-shadow: 0 4px 16px rgb(0 0 0 / .06); }
.s-header-row { display: flex; align-items: center; gap: clamp(8px, 2vw, 24px); min-height: 68px; }
.s-logo {
    display: inline-flex; align-items: center; gap: .6rem;
    font-family: var(--s-font-heading); font-weight: 800; font-size: 1.25rem;
    letter-spacing: -0.03em; text-decoration: none; color: var(--s-text); white-space: nowrap;
}
.s-logo img { max-height: var(--s-logo-h); width: auto; }
.s-logo:hover { color: var(--s-text); }
.s-header--center .s-header-row { display: grid; grid-template-columns: 1fr auto 1fr; }
.s-header--center .s-logo { justify-self: center; grid-column: 2; }
.s-header--center .s-header-row > .s-icon-btn:first-child { grid-column: 1; justify-self: start; }
.s-header--center .s-actions { grid-column: 3; }
.s-nav { display: flex; align-items: center; gap: .25rem; flex: 1; min-width: 0; overflow: hidden; }
.s-nav--center { justify-content: center; border-top: 1px solid var(--s-line); padding: .35rem 0; }
.s-nav-link {
    padding: .5rem .75rem; border-radius: calc(var(--s-radius) * .6);
    font-weight: 500; font-size: .95rem; text-decoration: none; color: var(--s-text); white-space: nowrap;
}
.s-nav-link:hover { background: var(--s-surface); color: var(--s-text); }
.s-actions { display: flex; align-items: center; gap: .35rem; margin-inline-start: auto; justify-content: flex-end; }
.s-icon-btn {
    display: inline-grid; place-items: center; width: 42px; height: 42px;
    border-radius: 50%; border: 0; background: transparent; color: var(--s-text);
    font-size: 1.1rem; text-decoration: none;
}
.s-icon-btn:hover { background: var(--s-surface); color: var(--s-text); }
.s-chip {
    display: inline-flex; align-items: center; gap: .35rem;
    border: 1px solid var(--s-line); background: var(--s-bg); color: var(--s-text);
    border-radius: 999px; padding: .3rem .8rem; font-size: .85rem; font-weight: 500;
    text-decoration: none; white-space: nowrap;
}
.s-chip:hover, .s-chip.is-active { border-color: var(--s-text); color: var(--s-text); }
.s-badge {
    position: absolute; top: 2px; inset-inline-end: 0;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--s-accent); color: var(--s-on-accent);
    font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; pointer-events: none;
}
.s-badge.is-empty { display: none; }
.s-search {
    display: flex; align-items: center; gap: .5rem;
    background: var(--s-surface); border: 1px solid transparent; border-radius: 999px;
    padding: 0 .9rem; height: 40px; width: clamp(160px, 18vw, 260px); color: var(--s-muted);
}
.s-search:focus-within { border-color: var(--s-accent); background: var(--s-bg); }
.s-search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: .9rem; color: var(--s-text); }
.s-search--big { width: 100%; max-width: 520px; height: 48px; margin-top: 1rem; }
.s-scroll-menu { max-height: 320px; overflow-y: auto; }
.s-menu { --bs-offcanvas-width: min(340px, 88vw); }
.s-menu-links { display: flex; flex-direction: column; gap: .15rem; }
.s-menu-links .s-nav-link { font-size: 1.05rem; padding: .7rem .5rem; }
.s-menu-prefs { border-top: 1px solid var(--s-line); margin-top: 1rem; padding-top: 1rem; }

/* ---------- homepage ---------- */
.s-hero { background: var(--s-surface); }
.s-hero-inner { display: grid; gap: clamp(24px, 4vw, 56px); align-items: center; padding-block: clamp(40px, 7vw, 96px); }
.s-hero--split .s-hero-inner { grid-template-columns: 1fr; }
@media (min-width: 900px) { .s-hero--split .s-hero-inner { grid-template-columns: 1.05fr 1fr; } }
.s-hero h1 { font-size: clamp(2rem, 5vw, 3.6rem); margin-bottom: 1rem; letter-spacing: -0.035em; }
.s-hero p { font-size: clamp(1rem, 1.6vw, 1.15rem); color: var(--s-muted); max-width: 46ch; margin-bottom: 1.75rem; }
.s-hero-media { border-radius: calc(var(--s-radius) * 1.5); overflow: hidden; aspect-ratio: 4 / 3; background: var(--s-bg); }
.s-hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.s-hero--text .s-hero-inner { text-align: center; justify-items: center; }
.s-hero--text p { margin-inline: auto; }
.s-hero--full {
    background: linear-gradient(90deg, rgb(0 0 0 / .55), rgb(0 0 0 / .1)), var(--s-hero-img, none) center / cover no-repeat, var(--s-text);
    color: #fff;
}
.s-hero--full .s-hero-inner { min-height: clamp(360px, 60vh, 640px); }
.s-hero--full h1, .s-hero--full p { color: #fff; }
[dir="rtl"] .s-hero--full { background: linear-gradient(270deg, rgb(0 0 0 / .55), rgb(0 0 0 / .1)), var(--s-hero-img, none) center / cover no-repeat, var(--s-text); }

.s-benefits { border-bottom: 1px solid var(--s-line); }
.s-benefits-row { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem clamp(24px, 5vw, 64px); padding-block: 1rem; }
.s-benefit { display: flex; align-items: center; gap: .6rem; font-size: .9rem; font-weight: 500; }
.s-benefit i { color: var(--s-accent); }

.s-section { padding-block: var(--s-section) 0; }
.s-section:last-child { padding-bottom: var(--s-section); }
.s-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.s-section-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: 0; }
.s-link { font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; }
[dir="rtl"] .s-link i { transform: scaleX(-1); }

.s-cats { display: grid; gap: var(--s-gap); grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
@media (min-width: 768px) { .s-cats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.s-cat { display: flex; flex-direction: column; gap: .6rem; text-decoration: none; color: var(--s-text); }
.s-cat-media { display: block; aspect-ratio: 1; border-radius: var(--s-radius); overflow: hidden; background: var(--s-surface); }
.s-cat-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.s-cat:hover .s-cat-media img { transform: scale(1.04); }
.s-cat-name { font-weight: 600; }

/* ---------- product grid + card ---------- */
.s-grid { display: grid; gap: clamp(16px, 2.2vw, 28px) var(--s-gap); grid-template-columns: repeat(var(--s-cols-mobile), minmax(0, 1fr)); }
@media (min-width: 640px) { .s-grid { grid-template-columns: repeat(min(3, var(--s-cols)), minmax(0, 1fr)); } }
@media (min-width: 1024px) { .s-grid { grid-template-columns: repeat(var(--s-cols), minmax(0, 1fr)); } }
.s-card { display: flex; flex-direction: column; min-width: 0; }
.s-card-media {
    position: relative; display: block; aspect-ratio: var(--s-ratio);
    border-radius: var(--s-radius); overflow: hidden; background: var(--s-surface);
}
.s-card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: var(--s-fit); transition: opacity .35s ease, transform .5s ease; }
.s-card-alt { opacity: 0; }
@media (hover: hover) {
    .s-card:hover .s-card-alt { opacity: 1; }
    /* hide the first photo too: product cut-outs have transparent backgrounds,
       so it would show through the second one */
    .s-card:hover .s-card-main:has(+ .s-card-alt) { opacity: 0; }
    .s-card:hover .s-card-media img:only-of-type { transform: scale(1.03); }
}
.s-card-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--s-muted); font-size: 2rem; }
.s-card-badges { position: absolute; top: .6rem; inset-inline-start: .6rem; display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.s-tag { background: var(--s-text); color: var(--s-bg); border-radius: 999px; padding: .15rem .55rem; font-size: .72rem; font-weight: 700; }
.s-tag--sale { background: var(--s-sale); color: #fff; }
.s-tag--soft { background: var(--s-bg); color: var(--s-text); box-shadow: var(--s-shadow); }
.s-card-body { display: flex; flex-direction: column; gap: .25rem; padding-top: .75rem; flex: 1; }
.s-card-title { font-family: var(--s-font-body); font-size: .98rem; font-weight: 500; letter-spacing: 0; margin: 0; line-height: 1.35; }
.s-card-title a { text-decoration: none; color: var(--s-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.s-card-rating { font-size: .8rem; color: var(--s-muted); }
.s-card-rating i { color: #f59e0b; }
.s-card-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem; font-weight: 700; }
.s-price-now.is-sale { color: var(--s-sale); }
.s-price-was { color: var(--s-muted); font-weight: 400; font-size: .88rem; }
.s-card-add { margin-top: auto; padding-top: .6rem; }
.s-card.is-sold-out .s-card-media img { opacity: .55; }
@media (hover: hover) and (min-width: 1024px) {
    /* quick add appears on hover on desktop, always visible on touch screens */
    .s-card .s-card-add { opacity: 0; transform: translateY(4px); transition: opacity .2s ease, transform .2s ease; }
    .s-card:hover .s-card-add, .s-card:focus-within .s-card-add { opacity: 1; transform: none; }
}

/* ---------- listing pages ---------- */
.s-page { padding-block: clamp(20px, 3vw, 32px) var(--s-section); }
.s-page-head { margin-bottom: 1.5rem; }
.s-page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: .35rem; }
.s-page-head p { color: var(--s-muted); max-width: 60ch; margin: 0; }
.s-page-head.has-image {
    border-radius: calc(var(--s-radius) * 1.5); padding: clamp(32px, 6vw, 72px) clamp(20px, 4vw, 48px);
    background: linear-gradient(90deg, rgb(0 0 0 / .55), rgb(0 0 0 / .1)), var(--s-hero-img) center / cover;
}
.s-page-head.has-image h1, .s-page-head.has-image p { color: #fff; }
.s-pills { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.s-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    border-block: 1px solid var(--s-line); padding-block: .6rem; margin-bottom: 1.25rem;
}
.s-count { color: var(--s-muted); font-size: .9rem; }
.s-sort { display: flex; gap: .5rem; }
.s-sort .form-select { width: auto; border-radius: 999px; }
.s-empty { text-align: center; padding: clamp(32px, 6vw, 72px) 1rem; }
.s-empty h2 { font-size: 1.35rem; margin-bottom: 1rem; }

/* ---------- footer ---------- */
.s-footer.footer {
    background: var(--s-footer-bg); color: var(--s-footer-text);
    margin-top: 0; padding: clamp(40px, 6vw, 72px) 0 1.5rem;
}
.s-footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr 1fr; }
@media (min-width: 900px) { .s-footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.s-footer-about { grid-column: 1 / -1; }
@media (min-width: 900px) { .s-footer-about { grid-column: auto; } }
.s-footer .s-logo, .s-footer .s-logo:hover { color: var(--s-footer-text); }
.s-footer p { color: color-mix(in srgb, var(--s-footer-text) 75%, transparent); font-size: .92rem; max-width: 40ch; margin: .75rem 0 1rem; }
.s-footer-title { font-family: var(--s-font-body); color: var(--s-footer-text) !important; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .85rem; }
.s-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.s-footer a { color: color-mix(in srgb, var(--s-footer-text) 80%, transparent); text-decoration: none; font-size: .92rem; }
.s-footer a:hover { color: var(--s-footer-text); }
.s-social { display: flex; gap: .4rem; }
.s-social a { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--s-footer-text) 25%, transparent); }
.s-footer-bottom { border-top: 1px solid color-mix(in srgb, var(--s-footer-text) 15%, transparent); margin-top: 2.5rem; padding-top: 1.25rem; font-size: .82rem; color: color-mix(in srgb, var(--s-footer-text) 65%, transparent); }

/* ---------- side cart, bottom nav, cookie bar ---------- */
.s-side-cart { --bs-offcanvas-width: min(420px, 100vw); }
.s-side-cart #side-cart-footer { background: var(--s-surface); }
.studio .mobile-bottom-nav { background: var(--s-bg); border-top: 1px solid var(--s-line); box-shadow: none; padding: .25rem 0 calc(.25rem + env(safe-area-inset-bottom)); }
.studio .mobile-bottom-nav .nav-item { color: var(--s-muted); }
.studio .mobile-bottom-nav .nav-item.active { color: var(--s-text); }
.studio .mobile-bottom-nav .nav-badge { background: var(--s-accent); }
@media (max-width: 991.98px) { body.studio { padding-bottom: 64px; } }
.studio .s-cookie {
    left: 50%; right: auto; bottom: 16px; transform: translate(-50%, 140%);
    width: min(720px, calc(100% - 32px)); background: var(--s-bg); color: var(--s-text);
    border: 1px solid var(--s-line); border-radius: var(--s-radius); box-shadow: var(--s-shadow);
    padding: 1rem 1.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem;
}
.studio .s-cookie.show { transform: translate(-50%, 0); }
.studio .s-cookie p { flex: 1 1 320px; font-size: .88rem; }
.studio .s-cookie a { color: var(--s-accent); }
.s-cookie-actions { display: flex; gap: .5rem; }
.studio .s-cookie .btn-primary { background: var(--s-accent); color: var(--s-on-accent); }
@media (max-width: 991.98px) { .studio .s-cookie { bottom: 80px; } }
.studio .back-to-top { background: var(--s-text); color: var(--s-bg); border-radius: 50%; }

/* ---------- inherited pages: small adjustments ---------- */
.studio .product-grid { gap: var(--s-gap); }
.studio .hero { background: var(--s-surface); }
.studio .footer h6 { color: var(--s-footer-text); }

@media (prefers-reduced-motion: reduce) {
    .studio *, .studio *::before, .studio *::after { transition: none !important; animation: none !important; }
}
