@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@400;500;600;700;800&family=Almarai:wght@400;700;800&family=Amiri:wght@400;700&family=Aref+Ruqaa:wght@400;700&family=Baloo+Bhaijaan+2:wght@400;500;600;700;800&family=Cairo:wght@400;500;600;700;800&family=Changa:wght@400;500;600;700;800&family=El+Messiri:wght@400;500;600;700&family=Gulzar&family=Harmattan:wght@400;500;600;700&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Jomhuria&family=Jost:wght@500;600;700&family=Lalezar&family=Lateef:wght@400;700&family=Lemonada:wght@400;500;600;700&family=Mada:wght@400;500;600;700;800&family=Marhey:wght@400;500;600;700&family=Markazi+Text:wght@400;500;600;700&family=Mirza:wght@400;500;600;700&family=Noto+Kufi+Arabic:wght@400;500;600;700;800&family=Noto+Naskh+Arabic:wght@400;500;600;700&family=Noto+Sans+Arabic:wght@400;500;600;700;800&family=Rakkas&family=Readex+Pro:wght@400;500;600;700&family=Reem+Kufi:wght@400;500;600;700&family=Reem+Kufi+Fun:wght@400;500;600;700&family=Rubik:wght@400;500;600;700;800&family=Scheherazade+New:wght@400;500;600;700&family=Tajawal:wght@400;500;600;700;800&family=Vazirmatn:wght@400;500;600;700;800&display=swap');

:root {
    /* Day Theme (Default) */
    --bg: #FBF6F1;
    --surface: #FFFFFF;
    --surface-secondary: #F4ECE4;
    --primary: #8E1F55;
    --primary-soft: #E9B2A5;
    --gold: #B8893C;
    --text: #22181D;
    --text-secondary: #6F6168;
    --border: rgba(34, 24, 29, 0.10);
    --card-radius: 22px;
    --btn-radius: 999px;
    --heading-font: 'Amiri', serif;
    --body-font: 'IBM Plex Sans Arabic', sans-serif;
    --num-font: 'Jost', sans-serif;
    --shadow: 0 8px 24px rgba(34, 24, 29, 0.06);
    --header-bg: rgba(251, 246, 241, 0.85);
    --danger: #B91C1C;
    --success: #15803D;
    --warning: #B45309;
}

[data-theme="dark"] {
    --bg: #110B0F;
    --surface: #1B1218;
    --surface-secondary: #271B23;
    --primary: #E9B2A5;
    --primary-soft: #8E1F55;
    --gold: #B8893C;
    --text: #F7EFEA;
    --text-secondary: #C5B4BD;
    --border: rgba(247, 239, 234, 0.10);
    --card-radius: 12px;
    --btn-radius: 10px;
    --heading-font: 'Reem Kufi', sans-serif;
    --shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    --header-bg: rgba(17, 11, 15, 0.85);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    direction: rtl;
}

body {
    font-family: var(--body-font);
    font-size: var(--body-font-size, 16px);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding-bottom: calc(76px + env(safe-area-inset-bottom)); /* Space for 5-icon mobile bottom nav */
    transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, .brand-title {
    font-family: var(--heading-font);
}

.num, .price-current, .price-old {
    font-family: var(--num-font);
    font-variant-numeric: tabular-nums;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }

.container {
    width: 100%;
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Sticky Blur Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.45rem;
}

/* Circular Stories with Primary -> Gold Ring */
.stories-strip {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 14px 4px;
    scrollbar-width: none;
}
.stories-strip::-webkit-scrollbar { display: none; }

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    cursor: pointer;
}

.story-ring {
    width: 68px;
    height: 68px;
    padding: 3px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    transition: transform 0.25s ease;
}

.story-item:hover .story-ring {
    transform: scale(1.05);
}

.story-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg);
}

.story-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    max-width: 72px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cards & Buttons */
.card, .product-card, .card-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--btn-radius);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: #FFFFFF;
}
[data-theme="dark"] .btn-primary {
    color: #110B0F;
}

.btn-secondary {
    background: var(--surface-secondary);
    color: var(--text);
}

/* Mobile-first 2-column Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(var(--mobile-columns, 2), minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(var(--tablet-columns, 3), minmax(0, 1fr));
        gap: 18px;
    }
    body {
        padding-bottom: 0;
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(var(--desktop-columns, 4), minmax(0, 1fr));
        gap: 20px;
    }
}

.product-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-3px);
}

.product-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--surface-secondary);
}

.product-card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

/* 5-Icon Mobile Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    inset-inline: 0;
    z-index: 60;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
}

.bottom-nav-item.active {
    color: var(--primary);
    font-weight: 700;
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
}

/* Bottom Sheet (Mobile) -> Centered Modal (Desktop) */
.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 11, 15, 0.55);
    z-index: 80;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.sheet-backdrop.open {
    display: flex;
}

.sheet-panel {
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    background: var(--surface);
    border-radius: 22px 22px 0 0;
    padding: 20px;
}

@media (min-width: 768px) {
    .sheet-backdrop {
        align-items: center;
    }
    .sheet-panel {
        max-width: 560px;
        border-radius: var(--card-radius);
    }
}

/* Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ==========================================================================
   Glamory editorial storefront refresh — responsive luxury beauty direction
   Safe visual layer: preserves existing markup, routes and business behavior.
   ========================================================================== */
:root {
    --bg: #FCF8F6;
    --surface: #FFFFFF;
    --surface-secondary: #F7ECEF;
    --primary: #873B59;
    --primary-soft: #E9C9D2;
    --gold: #B99A68;
    --text: #30232A;
    --text-secondary: #81727A;
    --border: rgba(73, 43, 57, .11);
    --card-radius: 20px;
    --btn-radius: 12px;
    --heading-font: 'Amiri', serif;
    --body-font: 'IBM Plex Sans Arabic', sans-serif;
    --shadow: 0 10px 30px rgba(64, 36, 49, .055);
    --header-bg: rgba(252, 248, 246, .92);
}
[data-theme="dark"] {
    --bg: #171116;
    --surface: #211820;
    --surface-secondary: #30232D;
    --primary: #E4B8C8;
    --primary-soft: #63394C;
    --gold: #C7A978;
    --text: #F8F0F2;
    --text-secondary: #C5B3BC;
    --border: rgba(248, 240, 242, .12);
    --card-radius: 18px;
    --btn-radius: 12px;
    --shadow: 0 12px 32px rgba(0,0,0,.22);
    --header-bg: rgba(23, 17, 22, .92);
}
body { letter-spacing: -.012em; }
.container { max-width: 1320px; padding-inline: clamp(14px, 3vw, 30px); }
.site-header { border-bottom-color: var(--border); box-shadow: 0 4px 20px rgba(45, 27, 37, .035); }
.header-inner { gap: 16px; padding-block: 11px; }
.brand { gap: 9px; font-size: 1.38rem; letter-spacing: .01em; }
.brand img { border-radius: 13px !important; box-shadow: 0 3px 12px rgba(135,59,89,.12); }
.header-account-btn { white-space: nowrap; min-width: 76px; }
.btn {
    min-height: 38px;
    padding: 8px 14px !important;
    border-radius: 11px;
    font-size: .86rem;
    font-weight: 600;
    letter-spacing: -.01em;
    box-shadow: none;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 82%, #3f2433)) !important; }
.btn-secondary { border: 1px solid var(--border); }
.btn:active { transform: translateY(1px); }
input, select, textarea {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    color: var(--text);
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(185,154,104,.13);
}
#search-input { min-height: 42px; padding: 9px 16px !important; border-radius: 999px !important; }
#search-input::placeholder { color: var(--text-secondary); }
main.container { margin-top: 18px !important; }
main h2 { font-size: clamp(calc(var(--heading-font-size, 32px) * .72), 2.2vw, calc(var(--heading-font-size, 32px) * .95)); font-weight: 700; letter-spacing: -.025em; margin-bottom: 14px !important; }
#categories-wrap { gap: 9px !important; margin-block: 18px 24px !important; }
#categories-wrap .btn { min-height: 34px; padding: 6px 14px !important; border-radius: 999px; }
.stories-strip { gap: 17px; padding-block: 12px 18px; }
.story-ring { width: 72px; height: 72px; padding: 2px; background: linear-gradient(145deg, var(--gold), var(--primary), #E7C5D0); }
.story-label { font-size: .76rem; font-weight: 500; }
.products-grid { gap: clamp(10px, 1.6vw, 20px); }
.product-card {
    border-radius: 17px;
    overflow: hidden;
    box-shadow: 0 5px 22px rgba(57, 35, 45, .045);
    border-color: rgba(73,43,57,.09);
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(57,35,45,.09); }
.product-card-img { aspect-ratio: 4 / 5; background: var(--surface-secondary); }
.product-card-body { padding: 11px 12px 13px; gap: 8px; }
.product-card-body > div:first-child { align-items: center !important; }
.product-card-body a { font-size: var(--product-title-font-size, 14px); line-height: 1.5; }
.fav-toggle-btn { min-width: 30px; min-height: 30px; border-radius: 50% !important; background: var(--surface-secondary) !important; font-size: 1rem; }
.price-current { font-size: var(--price-font-size, 15px); }
.store-banner { display: block; position: relative; overflow: hidden; border-radius: 22px; background: var(--surface-secondary); box-shadow: var(--shadow); }
.store-banner img { width: 100%; display: block; object-fit: cover; transition: transform .7s ease; }
.store-banner:hover img { transform: scale(1.015); }
.store-banner-copy { position: absolute; inset-inline: 0; bottom: 0; padding: clamp(14px, 3vw, 28px); color: white; background: linear-gradient(transparent, rgba(24,12,19,.70)); }
.bottom-nav { background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top-color: var(--border); box-shadow: 0 -5px 22px rgba(45,27,37,.045); }
.bottom-nav-item { font-size: var(--small-font-size, 12px); gap: 4px; padding-block: 3px; }
.bottom-nav-item svg { width: 21px; height: 21px; }
.bottom-nav-item.active { color: var(--primary); }
.sheet-backdrop { backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.sheet-panel { border: 1px solid var(--border); box-shadow: 0 -12px 45px rgba(30,15,24,.16); padding: 22px clamp(16px, 4vw, 26px); }
#sheet-title { font-size: 1.35rem; }
#sheet-close { min-height: 32px; padding: 5px 11px !important; }
#sheet-body { padding-top: 5px; }
#sheet-body form { gap: 9px !important; }
#sheet-body label { font-size: .88rem; font-weight: 600; color: var(--text-secondary); }
#sheet-body input { padding: 10px 13px !important; }
#sheet-body .btn { min-height: 40px !important; }
footer { color: var(--text-secondary); }
.card, .card-box { border-radius: 18px; }
#admin-tabs { gap: 7px !important; }
#admin-tabs .btn { min-height: 36px; padding: 7px 12px !important; }
@media (max-width: 767px) {
    body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
    .header-inner { flex-wrap: wrap; gap: 9px; padding-block: 9px; }
    .header-inner > .brand { flex: 1 1 auto; }
    .header-inner > div:nth-child(2) { order: 3; flex: 1 1 100% !important; max-width: none !important; }
    .header-inner > div:nth-child(3) { gap: 6px !important; }
    .header-inner > div:nth-child(3) #theme-toggle-btn, .header-inner > div:nth-child(3) .header-account-btn { display: none; }
    .header-inner > div:nth-child(3) .btn { min-height: 36px; padding: 6px 11px !important; }
    .product-card-body { padding: 9px 10px 11px; }
    .product-card-body a { font-size: .84rem; }
    .sheet-panel { max-height: 90dvh; border-radius: 23px 23px 0 0; }
}
/* Product columns are controlled only by the active design settings. */

/* Owner visual studio */
.product-card-img { aspect-ratio: var(--product-image-ratio, 4 / 5); }
.btn { border-radius: var(--btn-radius, 11px); }
.store-banner img { height: var(--banner-mobile-height, 190px); }
@media (min-width: 768px) { .store-banner img { height: var(--banner-desktop-height, 340px); } }
.design-studio { display:grid; gap:18px; max-width:1100px; margin-inline:auto; }
.design-card { padding:clamp(15px,2.5vw,25px); border-radius:22px; }
.design-section-title { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; margin-bottom:18px; }
.design-section-title h3 { font-size:1.35rem; margin:4px 0; color:var(--text); }
.design-section-title p,.design-muted { color:var(--text-secondary); font-size:.84rem; }
.design-eyebrow { color:var(--gold); font-size:.68rem; font-weight:800; letter-spacing:.13em; }
.design-identity-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-bottom:20px; }
.design-upload-field { display:grid; gap:8px; color:var(--text-secondary); font-size:.84rem; font-weight:600; }
.design-upload-preview { width:100%; height:130px; object-fit:contain; background:var(--surface-secondary); border:1px solid var(--border); border-radius:14px; padding:8px; }
.design-upload-field input[type=url] { width:100%; padding:9px; }
.design-upload-field input[type=file],.design-file-label input[type=file] { width:100%; font-size:.8rem; }
.design-fields-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.design-fields-grid label,.design-control-grid label { display:grid; gap:6px; color:var(--text-secondary); font-size:.82rem; font-weight:600; }
.design-fields-grid input[type=color] { width:100%; height:43px; padding:4px; }
.design-fields-grid input,.design-fields-grid select,.design-control-grid input,.design-control-grid select { width:100%; padding:8px; min-width:0; }
.design-live-preview { --preview-primary:#873B59;--preview-accent:#B99A68;--preview-bg:#FCF8F6;--preview-surface:#fff;--preview-text:#30232A;--preview-radius:20px; margin-top:18px; padding:16px; border-radius:18px; background:var(--preview-bg); color:var(--preview-text); border:1px solid var(--border); display:grid; gap:12px; }
.design-live-preview > span { font-size:.75rem; color:var(--preview-accent); font-weight:700; }
.design-preview-product { display:flex; gap:12px; align-items:center; padding:10px; border-radius:var(--preview-radius); background:var(--preview-surface); box-shadow:0 5px 18px rgba(0,0,0,.05); }
.design-preview-image { width:76px; aspect-ratio:4/5; border-radius:12px; background:linear-gradient(145deg,#E7CDD5,#B98C9D 55%,#E8D8C8); flex:none; }
.design-preview-product p { font-size:.78rem; opacity:.7; margin:3px 0; }
.design-preview-product b { color:var(--preview-primary); font-size:.86rem; }
.design-live-preview > button { justify-self:start; border:0; border-radius:12px; padding:9px 16px; background:var(--preview-primary); color:white; font:inherit; }
.design-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.design-banner-list { display:grid; gap:14px; }
.design-banner-form { padding:14px; border-radius:17px; box-shadow:none; }
.design-banner-head { display:flex; justify-content:space-between; gap:10px; align-items:center; margin-bottom:12px; }
.design-banner-grid { display:grid; grid-template-columns:minmax(170px,.8fr) minmax(0,1.6fr); gap:15px; }
.design-banner-visual { min-width:0; }
.design-banner-preview { width:100%; aspect-ratio:16/9; object-fit:cover; border-radius:13px; background:var(--surface-secondary); border:1px solid var(--border); }
.design-banner-fields { display:grid; gap:9px; min-width:0; }
.design-banner-fields > input { width:100%; padding:9px 11px; }
.design-file-label { display:grid; gap:6px; color:var(--text-secondary); font-size:.82rem; }
.design-control-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
@media(max-width:700px) {
 .design-identity-grid { grid-template-columns:1fr 1fr; }
 .design-fields-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .design-banner-grid { grid-template-columns:1fr; }
 .design-banner-preview { aspect-ratio:16/8; }
}
@media(max-width:420px) {
 .design-identity-grid { grid-template-columns:1fr; }
 .design-fields-grid { grid-template-columns:1fr 1fr; }
 .design-control-grid { grid-template-columns:1fr 1fr; }
}

.store-hero { position:relative; min-height:clamp(190px,32vw,420px); overflow:hidden; border-radius:24px; margin:14px 0 20px; background:var(--surface-secondary); isolation:isolate; }
.store-hero[hidden] { display:none; }
.store-hero > img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:0; }
.store-hero::after { content:""; position:absolute; inset:0; z-index:1; background:linear-gradient(90deg,rgba(25,13,20,.08),rgba(25,13,20,.60)); }
.store-hero-copy { position:relative; z-index:2; max-width:650px; padding:clamp(24px,5vw,58px); color:#fff; display:flex; min-height:inherit; flex-direction:column; justify-content:center; }
.store-hero-kicker { color:#F1DCC0; font-size:.72rem; font-weight:700; letter-spacing:.16em; }
.store-hero-copy h1 { font-size:clamp(calc(var(--heading-font-size, 32px) * .9),5vw,calc(var(--heading-font-size, 32px) * 1.65)); line-height:1.2; margin:8px 0; }
.store-hero-copy p { font-size:clamp(.88rem,1.4vw,1.05rem); max-width:480px; color:rgba(255,255,255,.9); }
.product-card-img { object-fit:var(--product-image-fit,cover); }


/* Glamory couture finish — premium day/night themes, refined motion and full preview */
:root {
    --section-gap: 24px;
    --hero-height: 380px;
    --desktop-columns: 4;
    --motion-scale: 1;
    --card-shadow-strength: soft;
    scroll-behavior: smooth;
}
[data-theme="dark"] {
    --primary: var(--dark-primary, #E8B7C8);
    --gold: var(--dark-gold, #D0B17A);
    --bg: var(--dark-bg, #171116);
    --surface: var(--dark-surface, #241B22);
    --text: var(--dark-text, #F8F0F2);
    --surface-secondary: color-mix(in srgb, var(--surface) 72%, var(--primary) 8%);
    --text-secondary: color-mix(in srgb, var(--text) 68%, transparent);
    --border: color-mix(in srgb, var(--text) 12%, transparent);
    --header-bg: color-mix(in srgb, var(--bg) 88%, transparent);
}
body {
    background-image: radial-gradient(ellipse at 8% 0%, color-mix(in srgb, var(--primary) 5%, transparent), transparent 38%);
    transition: background-color .45s ease, color .35s ease;
}
.site-header { transition: background .35s ease, box-shadow .35s ease; }
.store-hero { min-height: var(--hero-height); box-shadow: 0 22px 60px rgba(51,28,42,.12); }
main.container > section { margin-block: var(--section-gap); }
.products-grid { grid-template-columns: repeat(var(--mobile-columns,2),minmax(0,1fr)); }
@media(min-width:768px) { .products-grid { grid-template-columns: repeat(var(--tablet-columns,3),minmax(0,1fr)); } }
@media(min-width:1024px) { .products-grid { grid-template-columns: repeat(var(--desktop-columns,4),minmax(0,1fr)); } }
.product-card {
    box-shadow: 0 7px 24px rgba(58,35,47,.055);
    transition: transform calc(.28s * var(--motion-scale)) cubic-bezier(.2,.75,.25,1), box-shadow .35s ease, border-color .35s ease;
}
[data-theme="dark"] .product-card { box-shadow: 0 10px 30px rgba(0,0,0,.22); }
.product-card:hover { transform: translateY(calc(-4px * var(--motion-scale))); }
.btn, .story-ring, .store-banner img { transition-duration: calc(.25s * var(--motion-scale)); }
.store-banner { border-radius: clamp(16px,2vw,28px); }
.store-banner-copy { padding: clamp(18px,4vw,38px); }
#categories-wrap .btn { border:1px solid var(--border); background:var(--surface); color:var(--text); }
#categories-wrap .btn.active, #categories-wrap .btn[aria-pressed="true"] { background:var(--primary); color:white; border-color:transparent; }
.share-store-btn { white-space:nowrap; min-width:42px; }
.share-store-btn svg { flex:none; }
.share-store-label { font-size:.82rem; }
#theme-toggle-btn { min-width:40px; }
.design-presets { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:14px 0 4px; padding:12px; border:1px solid var(--border); border-radius:15px; background:var(--surface-secondary); }
.design-presets strong { font-size:.82rem; color:var(--text-secondary); margin-inline-end:5px; }
.design-presets button { min-height:34px; padding:6px 12px !important; }
.design-live-preview { border:1px solid color-mix(in srgb,var(--preview-primary) 18%,transparent); box-shadow:0 12px 34px rgba(50,30,40,.07); }
.design-preview-product { border:1px solid color-mix(in srgb,var(--preview-primary) 10%,transparent); }
.design-preview-image { background:linear-gradient(145deg,#f4dfe6,#c58ca4 52%,#ead8c4); }
.design-preview-modal { position:fixed; inset:0; z-index:2147483000; isolation:isolate; display:none; flex-direction:column; background:var(--bg); padding:clamp(8px,1.5vw,18px); }
.design-preview-modal.open { display:flex; }
.design-preview-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 4px 14px; color:var(--text); }
.design-preview-toolbar > div { display:flex; gap:8px; }
.design-preview-modal iframe { width:100%; flex:1; min-height:0; border:1px solid var(--border); border-radius:16px; background:var(--bg); }
@media(max-width:767px) {
    .header-inner > div:nth-child(3) #theme-toggle-btn { display:inline-flex; }
    .header-inner > div:nth-child(3) .share-store-btn { display:inline-flex; min-width:38px; padding:7px 9px !important; }
    .share-store-label { display:none; }
    .header-inner > div:nth-child(3) .header-account-btn { display:none; }
    .design-preview-toolbar { align-items:flex-start; flex-direction:column; }
    .design-preview-toolbar > div { width:100%; }
    .design-preview-toolbar .btn { flex:1; }
}
@media(prefers-reduced-motion:reduce) {
    html { scroll-behavior:auto; }
    .product-card,.btn,.story-ring,.store-banner img { transition:none !important; }
}


/* Theme tokens: owner palette remains distinct between day and night modes */
:root {
    --primary: var(--design-primary, #873B59);
    --gold: var(--design-accent, #B99A68);
    --bg: var(--design-background, #FCF8F6);
    --surface: var(--design-surface, #FFFFFF);
    --text: var(--design-text, #30232A);
}
[data-theme="dark"] {
    --primary: var(--dark-primary, #E8B7C8);
    --gold: var(--dark-gold, #D0B17A);
    --bg: var(--dark-bg, #171116);
    --surface: var(--dark-surface, #241B22);
    --text: var(--dark-text, #F8F0F2);
}
.product-card { box-shadow: var(--product-shadow, 0 6px 20px rgba(58,35,47,.045)); }
[data-theme="dark"] .product-card { box-shadow: 0 10px 30px rgba(0,0,0,.24); }


/* Fine layout controls */
.container { max-width: var(--store-max-width, 1320px); }
main.container { display:flex; flex-direction:column; gap:var(--section-gap); }
main.container > section { margin-block:0 !important; }
.site-header { backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); }
[data-header-style="solid"] .site-header { background:var(--surface); backdrop-filter:none; -webkit-backdrop-filter:none; box-shadow:0 5px 20px rgba(40,25,34,.045); }
[data-header-style="minimal"] .site-header { background:color-mix(in srgb,var(--bg) 78%,transparent); backdrop-filter:blur(7px); -webkit-backdrop-filter:blur(7px); box-shadow:none; border-bottom-color:transparent; }


/* Editorial beauty finish */
main h2 { position:relative; padding-inline-start:18px; }
main h2::before { content:""; position:absolute; inset-inline-start:0; top:.28em; width:4px; height:1.05em; border-radius:8px; background:linear-gradient(180deg,var(--gold),var(--primary)); }
#categories-wrap .btn { min-height:39px; padding-inline:18px !important; border-radius:999px !important; transition:transform .25s ease, background .25s ease, border-color .25s ease; }
#categories-wrap .btn:hover { transform:translateY(-2px); border-color:var(--gold); }
.product-card { position:relative; border-radius:24px; border:1px solid color-mix(in srgb,var(--primary) 9%,var(--border)); background:linear-gradient(160deg,var(--surface),color-mix(in srgb,var(--surface) 96%,var(--primary))); }
.product-card-img { transition:transform .8s cubic-bezier(.2,.7,.2,1), filter .5s ease; }
.product-card:hover .product-card-img { transform:scale(1.035); filter:saturate(1.04); }
.product-card-body { position:relative; padding:14px 14px 16px; }
.product-card-body > div:first-child { min-height:34px; }
.fav-toggle-btn { position:absolute; top:10px; inset-inline-start:10px; z-index:2; width:36px; height:36px; display:grid; place-items:center; background:color-mix(in srgb,var(--surface) 88%,transparent) !important; border:1px solid var(--border) !important; box-shadow:0 4px 14px rgba(35,20,28,.09); backdrop-filter:blur(10px); }
.price-current { font-weight:800; letter-spacing:.01em; }
.store-hero { border-radius:30px; }
.store-hero::after { background:linear-gradient(90deg,rgba(20,10,16,.05),rgba(20,10,16,.18) 38%,rgba(20,10,16,.72)),linear-gradient(0deg,rgba(20,10,16,.18),transparent 55%); }
.store-hero-copy h1 { text-shadow:0 4px 22px rgba(0,0,0,.18); }
.store-hero-kicker { display:inline-flex; align-items:center; gap:9px; }
.store-hero-kicker::before,.store-hero-kicker::after { content:""; width:22px; height:1px; background:var(--gold); }
.stories-strip { padding-block:18px 22px; }
.story-ring { box-shadow:0 7px 22px color-mix(in srgb,var(--primary) 14%,transparent); }
.store-banner { isolation:isolate; }
.store-banner::after { content:""; position:absolute; inset:0; border:1px solid rgba(255,255,255,.24); border-radius:inherit; pointer-events:none; }
.store-banner-copy h3 { font-size:clamp(calc(var(--heading-font-size, 32px) * .65),3vw,calc(var(--heading-font-size, 32px) * 1.05)); line-height:1.25; }
footer { padding-block:34px !important; background:linear-gradient(180deg,transparent,color-mix(in srgb,var(--primary) 4%,transparent)); }
@keyframes glamory-rise { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
.product-card { animation:glamory-rise .55s both; }
.product-card:nth-child(2) { animation-delay:.035s; }
.product-card:nth-child(3) { animation-delay:.07s; }
.product-card:nth-child(4) { animation-delay:.105s; }
.product-card:nth-child(5) { animation-delay:.14s; }
.product-card:nth-child(6) { animation-delay:.175s; }
.design-preview-stage { flex:1; min-height:0; overflow:auto; display:flex; justify-content:center; align-items:stretch; padding:10px; border-radius:18px; background:var(--surface-secondary); }
.design-preview-stage iframe { display:block; flex:1; width:100%; min-width:0; max-width:none; min-height:100%; height:100%; border:1px solid var(--border); border-radius:15px; background:var(--bg); transition:max-width .3s ease, flex .3s ease; }
.design-preview-stage[data-device="tablet"] iframe { flex:0 0 768px; max-width:768px; }
.design-preview-stage[data-device="mobile"] iframe { flex:0 0 390px; max-width:390px; }
.design-preview-actions { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.design-preview-actions .active { border-color:var(--gold); color:var(--primary); background:var(--surface-secondary); }
@media(max-width:767px) {
    .design-preview-stage { padding:4px; }
    .design-preview-stage[data-device="mobile"] iframe { flex-basis:360px; max-width:360px; }
    .design-preview-actions { width:100%; }
}
@media(prefers-reduced-motion:no-preference) {
    .store-hero { animation:glamory-rise .7s both; }
    .store-banner { animation:glamory-rise .65s both; }
}
@media(prefers-reduced-motion:reduce) {
    .product-card,.store-hero,.store-banner { animation:none !important; }
}

 
/* Fix: keep the favorite control separate from the product name on narrow cards. */
.product-title-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 36px;
    align-items: start !important;
    gap: 8px !important;
    width: 100%;
    min-width: 0;
}
.product-title-row .product-title {
    display: block;
    min-width: 0;
    max-width: 100%;
    font-weight: 700;
    line-height: 1.55;
    overflow-wrap: anywhere;
    word-break: normal;
}
.product-title-row .fav-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    margin: 0;
    line-height: 1;
    position: relative;
    inset: auto;
    z-index: 1;
    color: var(--text-secondary);
    border: 1px solid var(--border) !important;
    cursor: pointer;
    touch-action: manipulation;
}
.product-title-row .fav-toggle-btn.is-favorite { color: var(--primary); }


/* Glamory visual template skins; all retain the same safe shopping structure. */
:root[data-design-template="rose_atelier"] { --template-image-radius:24px; --template-card-border:color-mix(in srgb,var(--design-primary) 10%,var(--border)); }
:root[data-design-template="pearl_minimal"] { --template-image-radius:12px; --template-card-border:transparent; }
:root[data-design-template="french_editorial"] { --template-image-radius:4px; --template-card-border:color-mix(in srgb,var(--design-accent) 24%,var(--border)); }
:root[data-design-template="blush_romance"] { --template-image-radius:28px; --template-card-border:color-mix(in srgb,var(--design-primary) 16%,var(--border)); }
:root[data-design-template="botanical_ritual"] { --template-image-radius:16px; --template-card-border:color-mix(in srgb,#71806A 16%,var(--border)); }
:root[data-design-template="champagne_luxe"] { --template-image-radius:14px; --template-card-border:color-mix(in srgb,var(--design-accent) 28%,var(--border)); }
:root[data-design-template="beauty_lab"] { --template-image-radius:10px; --template-card-border:color-mix(in srgb,var(--design-primary) 12%,var(--border)); }
:root[data-design-template="velvet_night"] { --template-image-radius:22px; --template-card-border:color-mix(in srgb,var(--design-primary) 20%,var(--border)); }
:root[data-design-template="modern_coral"] { --template-image-radius:18px; --template-card-border:color-mix(in srgb,var(--design-primary) 14%,var(--border)); }
:root[data-design-template] .product-card { border:1px solid var(--template-card-border,var(--border)); }
:root[data-design-template] .product-card-img { border-radius:var(--template-image-radius,18px); }
:root[data-design-template="pearl_minimal"] .product-card { box-shadow:none; }
:root[data-design-template="blush_romance"] .product-card { background:linear-gradient(160deg,var(--surface),color-mix(in srgb,var(--design-primary) 3%,var(--surface))); }
:root[data-design-template="botanical_ritual"] main h2::before { background:linear-gradient(180deg,#B89C72,#687A61); }
:root[data-design-template="champagne_luxe"] .product-card { box-shadow:0 9px 28px color-mix(in srgb,var(--design-accent) 12%,transparent); }
:root[data-design-template="beauty_lab"] .product-card { border-radius:14px; }
:root[data-design-template="velvet_night"] .product-card { box-shadow:0 12px 34px color-mix(in srgb,var(--design-primary) 14%,transparent); }
:root[data-design-template="modern_coral"] .product-card { border-radius:18px; }
.design-presets { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.design-presets strong { flex-basis:100%; margin-bottom:3px; }
.design-presets button { min-height:40px; }

/* Owner typography controls: all sizes are bounded and applied without changing layout behavior. */
:root {
    --body-font-size: 16px;
    --heading-font-size: 32px;
    --product-title-font-size: 14px;
    --price-font-size: 15px;
    --button-font-size: 14px;
    --small-font-size: 12px;
}
.btn, button.btn { font-size: var(--button-font-size, 14px); }
.design-typography-heading {
    grid-column: 1 / -1;
    padding: 12px 14px;
    margin-top: 8px;
    border-inline-start: 3px solid var(--gold);
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary) 6%, var(--surface));
    color: var(--text);
    font-weight: 800;
}


/* Glamory order success — refined ivory, blush and champagne details */
.order-success-card[hidden], .success-wa-wrap[hidden], .success-note[hidden] { display: none !important; }
.order-success-card {
    max-width: 620px;
    margin: 28px auto 48px;
    padding: clamp(24px, 5vw, 48px);
    text-align: center;
    color: var(--text);
    background: linear-gradient(155deg, var(--surface) 0%, var(--bg) 100%);
    border: 1px solid rgba(184, 137, 60, .24);
    border-radius: 28px;
    box-shadow: 0 18px 52px rgba(75, 38, 54, .10);
}
.order-success-card h2 {
    margin: 10px 0 6px;
    color: var(--primary);
    font-family: var(--heading-font);
    font-size: clamp(1.65rem, 5vw, 2.15rem);
}
.success-mark {
    display: grid; place-items: center; width: 68px; height: 68px;
    margin: 0 auto 16px; color: var(--primary);
    background: linear-gradient(145deg, #fff1f2, #f8e1e8);
    border: 1px solid rgba(142, 31, 85, .12); border-radius: 50%;
}
.success-mark svg { width: 42px; height: 42px; }
.success-brandline { margin: 0; color: var(--gold); font: 600 .68rem/1.4 var(--num-font); letter-spacing: .16em; }
.success-subtitle { margin: 0; color: var(--text-secondary); }
.success-gold-rule { width: 74px; height: 1px; margin: 22px auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.success-code-card {
    display: grid; gap: 8px; padding: 20px 16px; background: var(--surface);
    border: 1px solid rgba(142, 31, 85, .14); border-radius: 20px;
}
.success-code-card span, .success-code-card small { color: var(--text-secondary); }
.success-code-card strong { color: var(--primary); font: 700 clamp(1.65rem, 7vw, 2.15rem)/1.2 var(--num-font); letter-spacing: .09em; direction: ltr; }
.success-wa-wrap { margin: 20px 0 12px; }
.success-wa-button {
    display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px;
    padding: 12px 20px; color: #fff !important; background: linear-gradient(135deg, #218b62, #14764f);
    border-radius: 999px; box-shadow: 0 8px 20px rgba(20, 118, 79, .18);
    font-weight: 700; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease;
}
.success-wa-button:hover { transform: translateY(-1px); box-shadow: 0 11px 24px rgba(20, 118, 79, .24); }
.success-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px 0 20px; color: var(--text-secondary); font-size: .84rem; line-height: 1.8; }
.success-note span { color: var(--gold); font-size: 1.1rem; }
.success-back-link { display: inline-flex; margin-top: 2px; }
[data-theme="dark"] .success-mark { background: linear-gradient(145deg, #38202c, #2b1823); }
[data-theme="dark"] .order-success-card { border-color: rgba(184, 137, 60, .30); }
@media (max-width: 480px) {
    .order-success-card { margin: 18px auto 32px; padding: 25px 18px; border-radius: 23px; }
    .success-note { font-size: .78rem; }
}


/* Glamory layout systems: each preset changes composition, not catalog data. */
:root[data-design-template="rose_atelier"] {
    --template-card-gap: 18px;
    --template-card-image-radius: 24px;
}
:root[data-design-template="rose_atelier"] .product-card { border-radius:26px; }
:root[data-design-template="rose_atelier"] .store-banner { border-radius:30px; }
:root[data-design-template="rose_atelier"] .catalog-section > h2 { letter-spacing:-.04em; }

:root[data-design-template="pearl_minimal"] {
    --section-gap:18px;
    --template-card-image-radius:10px;
}
:root[data-design-template="pearl_minimal"] main.container { gap:18px; }
:root[data-design-template="pearl_minimal"] .product-card { border:0; border-radius:12px; box-shadow:none; background:transparent; }
:root[data-design-template="pearl_minimal"] .product-card-body { padding:10px 2px 12px; }
:root[data-design-template="pearl_minimal"] .store-banner { border-radius:8px; box-shadow:none; }
:root[data-design-template="pearl_minimal"] #categories-wrap .btn { border:1px solid var(--border); background:transparent; }

:root[data-design-template="french_editorial"] .catalog-section > h2,
:root[data-design-template="french_editorial"] #offers-section > h2,
:root[data-design-template="french_editorial"] #new-section > h2,
:root[data-design-template="french_editorial"] #bestsellers-section > h2 {
    font-size:clamp(1.7rem,3vw,2.6rem);
    letter-spacing:-.045em;
    padding-inline-start:0;
    border-bottom:1px solid var(--gold);
    padding-bottom:12px;
}
:root[data-design-template="french_editorial"] main h2::before { display:none; }
:root[data-design-template="french_editorial"] .product-card { display:grid; grid-template-columns:minmax(0,1fr); border-radius:3px; box-shadow:none; background:transparent; }
:root[data-design-template="french_editorial"] .product-card-body { padding:12px 4px 16px; }
:root[data-design-template="french_editorial"] .product-card-img { border-radius:2px; }
:root[data-design-template="french_editorial"] .store-banner { border-radius:2px; box-shadow:none; }
:root[data-design-template="french_editorial"] .stories-strip { border-block:1px solid var(--border); }

:root[data-design-template="blush_romance"] .store-hero { border-radius:36px; overflow:hidden; }
:root[data-design-template="blush_romance"] .product-card { border-radius:28px; background:linear-gradient(155deg,var(--surface),color-mix(in srgb,var(--primary) 5%,var(--surface))); }
:root[data-design-template="blush_romance"] .product-card-img { border-radius:25px 25px 12px 12px; }
:root[data-design-template="blush_romance"] #categories-wrap .btn { padding-inline:20px !important; min-height:42px; }
:root[data-design-template="blush_romance"] .store-banner { border-radius:32px; }

:root[data-design-template="botanical_ritual"] .site-header { border-bottom:2px solid color-mix(in srgb,#71806A 25%,var(--border)); }
:root[data-design-template="botanical_ritual"] .product-card { border-radius:18px 18px 8px 8px; box-shadow:none; }
:root[data-design-template="botanical_ritual"] .product-card-img { border-radius:16px 16px 4px 4px; }
:root[data-design-template="botanical_ritual"] .store-banner { border-radius:18px 18px 4px 4px; }
:root[data-design-template="botanical_ritual"] #categories-wrap .btn { border-radius:8px !important; background:color-mix(in srgb,#71806A 9%,var(--surface)); }

:root[data-design-template="champagne_luxe"] .product-card { border:1px solid color-mix(in srgb,var(--gold) 25%,var(--border)); border-radius:15px; box-shadow:0 12px 32px color-mix(in srgb,var(--gold) 10%,transparent); }
:root[data-design-template="champagne_luxe"] .product-card-img { border-radius:13px 13px 5px 5px; }
:root[data-design-template="champagne_luxe"] .store-banner { border:1px solid color-mix(in srgb,var(--gold) 30%,transparent); border-radius:14px; }
:root[data-design-template="champagne_luxe"] main h2::before { width:22px; height:2px; top:auto; bottom:-5px; }

:root[data-design-template="beauty_lab"] .product-card { display:grid; grid-template-columns:minmax(0,1fr); border-radius:12px; box-shadow:0 3px 14px rgba(40,35,55,.06); }
:root[data-design-template="beauty_lab"] .product-card-img { border-radius:10px; }
:root[data-design-template="beauty_lab"] .product-card-body { padding:10px; }
:root[data-design-template="beauty_lab"] #categories-wrap .btn { border-radius:10px !important; border:1px solid var(--border); }
:root[data-design-template="beauty_lab"] .store-banner { border-radius:12px; }

:root[data-design-template="velvet_night"] .site-header { border-bottom-color:color-mix(in srgb,var(--gold) 25%,var(--border)); }
:root[data-design-template="velvet_night"] .product-card { border:1px solid color-mix(in srgb,var(--gold) 18%,var(--border)); border-radius:22px; box-shadow:0 14px 36px rgba(28,12,26,.12); }
:root[data-design-template="velvet_night"] .product-card-img { border-radius:20px 20px 10px 10px; }
:root[data-design-template="velvet_night"] .store-banner { border:1px solid color-mix(in srgb,var(--gold) 24%,transparent); border-radius:22px; }
:root[data-design-template="velvet_night"] main h2::before { background:linear-gradient(180deg,var(--gold),var(--primary)); }

:root[data-design-template="modern_coral"] .product-card { border-radius:12px 24px 12px 24px; box-shadow:0 7px 20px color-mix(in srgb,var(--primary) 8%,transparent); }
:root[data-design-template="modern_coral"] .product-card-img { border-radius:10px 22px 8px 8px; }
:root[data-design-template="modern_coral"] #categories-wrap .btn { border-radius:12px !important; }
:root[data-design-template="modern_coral"] .store-banner { border-radius:12px 30px 12px 30px; }

/* Distinct desktop compositions. The same semantic sections remain intact. */
@media (min-width: 960px) {
    :root[data-design-template="french_editorial"] main.container {
        display:grid;
        grid-template-columns:minmax(0,1fr) minmax(260px, .34fr);
        grid-template-areas:
            "stories stories"
            "hero hero"
            "banners banners"
            "catalog categories"
            "offers categories"
            "new categories"
            "best categories"
            "recs recs";
        align-items:start;
    }
    :root[data-design-template="french_editorial"] #stories-strip { grid-area:stories; }
    :root[data-design-template="french_editorial"] #store-hero { grid-area:hero; }
    :root[data-design-template="french_editorial"] #banners-wrap { grid-area:banners; }
    :root[data-design-template="french_editorial"] #categories-wrap { grid-area:categories; position:sticky; top:105px; display:flex; flex-direction:column; align-items:stretch; padding:20px; border:1px solid var(--border); background:var(--surface); }
    :root[data-design-template="french_editorial"] .catalog-section { grid-area:catalog; }
    :root[data-design-template="french_editorial"] #offers-section { grid-area:offers; }
    :root[data-design-template="french_editorial"] #new-section { grid-area:new; }
    :root[data-design-template="french_editorial"] #bestsellers-section { grid-area:best; }
    :root[data-design-template="french_editorial"] #recs-section { grid-area:recs; }

    :root[data-design-template="botanical_ritual"] main.container {
        display:grid;
        grid-template-columns:220px minmax(0,1fr);
        grid-template-areas:
            "stories stories"
            "hero hero"
            "banners banners"
            "categories offers"
            "categories new"
            "categories best"
            "categories catalog"
            "categories recs";
        align-items:start;
    }
    :root[data-design-template="botanical_ritual"] #stories-strip { grid-area:stories; }
    :root[data-design-template="botanical_ritual"] #store-hero { grid-area:hero; }
    :root[data-design-template="botanical_ritual"] #banners-wrap { grid-area:banners; }
    :root[data-design-template="botanical_ritual"] #categories-wrap { grid-area:categories; position:sticky; top:105px; display:flex; flex-direction:column; align-items:stretch; padding:16px; border-radius:16px; background:color-mix(in srgb,#71806A 7%,var(--surface)); }
    :root[data-design-template="botanical_ritual"] #offers-section { grid-area:offers; }
    :root[data-design-template="botanical_ritual"] #new-section { grid-area:new; }
    :root[data-design-template="botanical_ritual"] #bestsellers-section { grid-area:best; }
    :root[data-design-template="botanical_ritual"] .catalog-section { grid-area:catalog; }
    :root[data-design-template="botanical_ritual"] #recs-section { grid-area:recs; }

    :root[data-design-template="beauty_lab"] .product-card { grid-template-columns:minmax(105px,.82fr) minmax(0,1.18fr); align-items:center; }
    :root[data-design-template="beauty_lab"] .product-card > a { min-width:0; }
    :root[data-design-template="beauty_lab"] .product-card-img { height:100%; min-height:145px; aspect-ratio:auto; object-fit:var(--product-image-fit,cover); }
}
@media (max-width: 959px) {
    :root[data-design-template="french_editorial"] main.container,
    :root[data-design-template="botanical_ritual"] main.container { display:flex; flex-direction:column; }
    :root[data-design-template="french_editorial"] #categories-wrap,
    :root[data-design-template="botanical_ritual"] #categories-wrap { position:static; width:100%; }
}
@media (max-width: 767px) {
    :root[data-design-template="beauty_lab"] .product-card { display:flex; flex-direction:column; }
    :root[data-design-template="beauty_lab"] .product-card-img { width:100%; height:auto; aspect-ratio:var(--product-image-ratio,1 / 1); }
    :root[data-design-template="french_editorial"] .products-grid { gap:16px 12px; }
    :root[data-design-template="french_editorial"] .product-card-body { padding-inline:2px; }
    :root[data-design-template="botanical_ritual"] #categories-wrap { flex-direction:row; overflow-x:auto; flex-wrap:nowrap; }
}


/* Per-preset catalog compositions: deliberately different card rhythm and hierarchy. */
:root[data-design-template="rose_atelier"] .products-grid { gap:22px; }
:root[data-design-template="rose_atelier"] .product-card-img { aspect-ratio:1 / 1; }
:root[data-design-template="rose_atelier"] .product-card-body { padding:14px 15px 17px; }

:root[data-design-template="pearl_minimal"] .products-grid { gap:12px 16px; }
:root[data-design-template="pearl_minimal"] .product-card-body { display:grid; grid-template-columns:minmax(0,1fr); justify-items:center; text-align:center; }
:root[data-design-template="pearl_minimal"] .product-title-row { grid-template-columns:minmax(0,1fr) 32px; }
:root[data-design-template="pearl_minimal"] .product-card-img { aspect-ratio:1 / 1; }

:root[data-design-template="blush_romance"] .products-grid { grid-auto-flow:dense; }
:root[data-design-template="blush_romance"] .products-grid .product-card:first-child { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr); align-items:center; }
:root[data-design-template="blush_romance"] .products-grid .product-card:first-child .product-card-img { height:100%; min-height:180px; aspect-ratio:auto; }
:root[data-design-template="blush_romance"] .products-grid .product-card:first-child .product-card-body { padding:clamp(12px,2vw,24px); }

:root[data-design-template="champagne_luxe"] .products-grid { grid-auto-flow:dense; }
:root[data-design-template="champagne_luxe"] .products-grid .product-card:nth-child(4n + 1) { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr); align-items:center; }
:root[data-design-template="champagne_luxe"] .products-grid .product-card:nth-child(4n + 1) .product-card-img { height:100%; min-height:170px; aspect-ratio:auto; }

:root[data-design-template="velvet_night"] .products-grid { grid-auto-flow:dense; }
:root[data-design-template="velvet_night"] .products-grid .product-card:nth-child(5n + 1) { grid-row:span 2; }
:root[data-design-template="velvet_night"] .products-grid .product-card:nth-child(5n + 1) .product-card-img { height:100%; min-height:300px; aspect-ratio:auto; }

:root[data-design-template="modern_coral"] .products-grid { grid-auto-flow:dense; }
:root[data-design-template="modern_coral"] .products-grid .product-card:nth-child(6n + 1) { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:center; }
:root[data-design-template="modern_coral"] .products-grid .product-card:nth-child(6n + 1) .product-card-img { height:100%; min-height:170px; aspect-ratio:auto; }

@media (min-width: 960px) {
    :root[data-design-template="french_editorial"] .products-grid { gap:28px 20px; }
}
@media (max-width: 767px) {
    :root[data-design-template="blush_romance"] .products-grid .product-card:first-child,
    :root[data-design-template="champagne_luxe"] .products-grid .product-card:nth-child(4n + 1),
    :root[data-design-template="modern_coral"] .products-grid .product-card:nth-child(6n + 1) { grid-template-columns:minmax(0,1fr); }
    :root[data-design-template="velvet_night"] .products-grid .product-card:nth-child(5n + 1) { grid-row:span 1; }
    :root[data-design-template="velvet_night"] .products-grid .product-card:nth-child(5n + 1) .product-card-img { min-height:0; aspect-ratio:var(--product-image-ratio,4 / 5); }
}


/* Theme selection and compact live sample feedback inside the design studio. */
.design-presets button.active,
.design-presets button[aria-pressed="true"] {
    color:var(--primary-contrast,#fff);
    background:var(--primary);
    border-color:var(--primary);
    box-shadow:0 0 0 2px color-mix(in srgb,var(--primary) 18%,transparent);
}
.design-live-preview { transition:background .2s ease,color .2s ease,border-color .2s ease; }
.design-live-preview .design-preview-product { transition:border-radius .2s ease,box-shadow .2s ease,background .2s ease; }
.design-live-preview[data-design-template="pearl_minimal"] .design-preview-product { border:0; box-shadow:none; background:transparent; }
.design-live-preview[data-design-template="french_editorial"] .design-preview-product { border-radius:3px; box-shadow:none; border-block:1px solid var(--preview-accent); }
.design-live-preview[data-design-template="blush_romance"] .design-preview-product { border-radius:28px; background:color-mix(in srgb,var(--preview-primary) 5%,var(--preview-surface)); }
.design-live-preview[data-design-template="botanical_ritual"] .design-preview-product { border-radius:16px 16px 5px 5px; border-inline-start:4px solid #71806A; }
.design-live-preview[data-design-template="champagne_luxe"] .design-preview-product { border:1px solid color-mix(in srgb,var(--preview-accent) 55%,transparent); box-shadow:0 8px 24px color-mix(in srgb,var(--preview-accent) 16%,transparent); }
.design-live-preview[data-design-template="beauty_lab"] .design-preview-product { border-radius:10px; box-shadow:0 3px 14px rgba(40,35,55,.08); }
.design-live-preview[data-design-template="velvet_night"] .design-preview-product { border:1px solid color-mix(in srgb,var(--preview-accent) 40%,transparent); border-radius:22px; box-shadow:0 12px 30px rgba(28,12,26,.14); }
.design-live-preview[data-design-template="modern_coral"] .design-preview-product { border-radius:12px 24px 12px 24px; box-shadow:0 7px 20px color-mix(in srgb,var(--preview-primary) 12%,transparent); }


/* ==========================================================================
   Independent storefront compositions v2
   Each preset owns a recognizable content rhythm on phones and desktops.
   Catalog data, favorites, cart and order behavior remain untouched.
   ========================================================================== */

/* Shared structural foundation: let each preset rearrange existing sections. */
:root[data-design-template] main.container {
    display: flex;
    flex-direction: column;
    gap: var(--section-gap, 24px);
}
:root[data-design-template] main.container > section { min-width: 0; margin-block: 0 !important; }
:root[data-design-template] .catalog-section { min-width: 0; }
:root[data-design-template] .products-grid { min-width: 0; align-items: stretch; }
:root[data-design-template] .product-card { min-width: 0; }
:root[data-design-template] .product-card-img { object-fit: var(--product-image-fit, cover); aspect-ratio: var(--product-image-ratio, 4 / 5); }
:root[data-design-template] .product-title { font-size: var(--product-title-font-size, 14px); }
:root[data-design-template] .price-current { font-size: var(--price-font-size, 15px); }

/* 1. Rose Atelier — centered boutique storefront with a generous hero. */
:root[data-design-template="rose_atelier"] main.container { gap: clamp(18px, 3vw, 34px); }
:root[data-design-template="rose_atelier"] #store-hero { min-height: clamp(250px, 38vw, 440px); }
:root[data-design-template="rose_atelier"] #store-hero .store-hero-copy { max-width: 560px; }
:root[data-design-template="rose_atelier"] #categories-wrap { justify-content: center; padding-block: 8px 16px; border-bottom: 1px solid var(--border); }
:root[data-design-template="rose_atelier"] .catalog-section > h2 { text-align: center; margin-bottom: 22px !important; }
:root[data-design-template="rose_atelier"] .product-card { padding: 7px; }
:root[data-design-template="rose_atelier"] .product-card-img { border-radius: 20px; }

/* 2. Pearl Minimal — quiet whitespace, compact typography, image-first grid. */
:root[data-design-template="pearl_minimal"] main.container { gap: 14px; }
:root[data-design-template="pearl_minimal"] #stories-strip { padding-block: 8px 12px; justify-content: center; }
:root[data-design-template="pearl_minimal"] #categories-wrap { justify-content: center; padding-block: 14px; border-block: 1px solid var(--border); }
:root[data-design-template="pearl_minimal"] .catalog-section > h2 { text-align: center; font-weight: 500; letter-spacing: .04em; }
:root[data-design-template="pearl_minimal"] .products-grid { gap: 22px 14px; }
:root[data-design-template="pearl_minimal"] .product-card { padding: 0; border-radius: 0; }
:root[data-design-template="pearl_minimal"] .product-card-img { border-radius: 0; }
:root[data-design-template="pearl_minimal"] .product-card-body { padding: 9px 2px 12px; }

/* 3. French Editorial — magazine masthead and single-column editorial product stories. */
:root[data-design-template="french_editorial"] main.container { gap: 30px; }
:root[data-design-template="french_editorial"] #store-hero { min-height: clamp(320px, 48vw, 560px); }
:root[data-design-template="french_editorial"] #categories-wrap { order: 2; justify-content: flex-start; border-block: 1px solid var(--border); padding-block: 12px; }
:root[data-design-template="french_editorial"] .catalog-section { order: 3; }
:root[data-design-template="french_editorial"] .catalog-section > h2 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.15; }
:root[data-design-template="french_editorial"] .products-grid { grid-template-columns: repeat(var(--mobile-columns,1),minmax(0,1fr)); gap: 26px; }
:root[data-design-template="french_editorial"] .product-card { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,.85fr); align-items: center; gap: 16px; padding: 0 0 18px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; background: transparent; }
:root[data-design-template="french_editorial"] .product-card > a { min-width: 0; }
:root[data-design-template="french_editorial"] .product-card-img { border-radius: 0; aspect-ratio: 3 / 4; }
:root[data-design-template="french_editorial"] .product-card-body { padding: 8px 0; }
:root[data-design-template="french_editorial"] .product-title-row { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }

/* 4. Blush Romance — featured first product, soft overlapping card rhythm. */
:root[data-design-template="blush_romance"] main.container { gap: 26px; }
:root[data-design-template="blush_romance"] #store-hero { min-height: clamp(280px, 42vw, 470px); border-radius: 42px 42px 12px 12px; }
:root[data-design-template="blush_romance"] #categories-wrap { justify-content: center; }
:root[data-design-template="blush_romance"] .products-grid { grid-template-columns: repeat(var(--mobile-columns,2),minmax(0,1fr)); gap: 18px 12px; }
:root[data-design-template="blush_romance"] .products-grid .product-card:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,.9fr); align-items: center; gap: 12px; padding: 10px; }
:root[data-design-template="blush_romance"] .products-grid .product-card:first-child .product-card-img { height: 100%; min-height: 210px; aspect-ratio: auto; border-radius: 28px 28px 8px 28px; }
:root[data-design-template="blush_romance"] .products-grid .product-card:first-child .product-card-body { padding: 14px 8px; }
:root[data-design-template="blush_romance"] .product-card:not(:first-child) .product-card-img { border-radius: 26px 26px 10px 10px; }

/* 5. Botanical Ritual — nature-led category rail and landscape product tiles. */
:root[data-design-template="botanical_ritual"] main.container { gap: 22px; }
:root[data-design-template="botanical_ritual"] #categories-wrap { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding: 12px; border-radius: 18px; background: color-mix(in srgb,#71806A 8%,var(--surface)); scrollbar-width: none; }
:root[data-design-template="botanical_ritual"] #categories-wrap::-webkit-scrollbar { display:none; }
:root[data-design-template="botanical_ritual"] .catalog-section > h2 { padding-inline-start: 14px; border-inline-start: 3px solid #71806A; }
:root[data-design-template="botanical_ritual"] .products-grid { gap: 16px; }
:root[data-design-template="botanical_ritual"] .product-card { border-radius: 18px 18px 8px 8px; box-shadow: none; border-color: color-mix(in srgb,#71806A 20%,var(--border)); }
:root[data-design-template="botanical_ritual"] .product-card-img { aspect-ratio: 5 / 4; border-radius: 16px 16px 4px 4px; }
:root[data-design-template="botanical_ritual"] .product-card-body { padding: 12px; }

/* 6. Champagne Luxe — gold-framed collection with a featured lead product. */
:root[data-design-template="champagne_luxe"] main.container { gap: 28px; }
:root[data-design-template="champagne_luxe"] #store-hero { min-height: clamp(300px, 45vw, 500px); border: 1px solid color-mix(in srgb,var(--design-accent) 50%,transparent); }
:root[data-design-template="champagne_luxe"] #categories-wrap { justify-content: center; padding-block: 12px; border-block: 1px solid color-mix(in srgb,var(--design-accent) 35%,var(--border)); }
:root[data-design-template="champagne_luxe"] .products-grid { grid-template-columns: repeat(var(--mobile-columns,2),minmax(0,1fr)); gap: 18px 12px; }
:root[data-design-template="champagne_luxe"] .products-grid .product-card:nth-child(4n + 1) { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: center; gap: 14px; padding: 10px; }
:root[data-design-template="champagne_luxe"] .products-grid .product-card:nth-child(4n + 1) .product-card-img { height: 100%; min-height: 190px; aspect-ratio: auto; }
:root[data-design-template="champagne_luxe"] .product-card { border: 1px solid color-mix(in srgb,var(--design-accent) 35%,var(--border)); }

/* 7. Beauty Lab — functional horizontal product rows and specification-like hierarchy. */
:root[data-design-template="beauty_lab"] main.container { gap: 20px; }
:root[data-design-template="beauty_lab"] #categories-wrap { justify-content: flex-start; border-bottom: 1px solid var(--border); padding-block: 10px 16px; }
:root[data-design-template="beauty_lab"] .products-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
:root[data-design-template="beauty_lab"] .product-card { display: grid; grid-template-columns: minmax(112px,.78fr) minmax(0,1.22fr); align-items: stretch; gap: 0; border-radius: 14px; box-shadow: 0 3px 14px rgba(40,35,55,.06); }
:root[data-design-template="beauty_lab"] .product-card > a { min-width: 0; }
:root[data-design-template="beauty_lab"] .product-card-img { width: 100%; height: 100%; min-height: 138px; aspect-ratio: auto; border-radius: 12px; }
:root[data-design-template="beauty_lab"] .product-card-body { justify-content: center; padding: 14px; }
:root[data-design-template="beauty_lab"] .product-title-row { align-items: flex-start; }

/* 8. Velvet Night — cinematic dark gallery and alternating tall image panels. */
:root[data-design-template="velvet_night"] main.container { gap: 26px; }
:root[data-design-template="velvet_night"] #store-hero { min-height: clamp(300px, 46vw, 520px); }
:root[data-design-template="velvet_night"] #categories-wrap { justify-content: center; padding-block: 12px; border-block: 1px solid color-mix(in srgb,var(--design-accent) 30%,var(--border)); }
:root[data-design-template="velvet_night"] .products-grid { grid-template-columns: repeat(var(--mobile-columns,2),minmax(0,1fr)); gap: 14px; align-items: start; }
:root[data-design-template="velvet_night"] .products-grid .product-card:nth-child(5n + 1) { grid-row: span 2; }
:root[data-design-template="velvet_night"] .products-grid .product-card:nth-child(5n + 1) .product-card-img { min-height: 280px; aspect-ratio: 3 / 5; }
:root[data-design-template="velvet_night"] .product-card { padding: 6px; background: color-mix(in srgb,var(--surface) 92%,var(--design-accent)); }

/* 9. Modern Coral — bento catalog with wide alternating product panels. */
:root[data-design-template="modern_coral"] main.container { gap: 22px; }
:root[data-design-template="modern_coral"] #categories-wrap { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-block: 8px 14px; }
:root[data-design-template="modern_coral"] .products-grid { grid-template-columns: repeat(var(--mobile-columns,2),minmax(0,1fr)); gap: 14px; }
:root[data-design-template="modern_coral"] .products-grid .product-card:nth-child(6n + 1) { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: center; gap: 12px; padding: 8px; }
:root[data-design-template="modern_coral"] .products-grid .product-card:nth-child(6n + 1) .product-card-img { height: 100%; min-height: 170px; aspect-ratio: auto; }
:root[data-design-template="modern_coral"] .products-grid .product-card:nth-child(3n + 2) { transform: translateY(8px); }

/* Tablet and desktop compositions remain different, while mobile rules above
   intentionally preserve each template's identity instead of flattening it. */
@media (min-width: 768px) {
    :root[data-design-template="french_editorial"] .products-grid { grid-template-columns: repeat(var(--tablet-columns,2),minmax(0,1fr)); }
    :root[data-design-template="french_editorial"] .product-card { display:flex; flex-direction:column; }
    :root[data-design-template="french_editorial"] .product-card-img { aspect-ratio: 3 / 4; }
    :root[data-design-template="botanical_ritual"] main.container { display:grid; grid-template-columns: minmax(180px,220px) minmax(0,1fr); grid-template-areas: "stories stories" "hero hero" "banners banners" "categories offers" "categories new" "categories best" "categories catalog" "categories recs"; align-items:start; }
    :root[data-design-template="botanical_ritual"] #stories-strip { grid-area:stories; }
    :root[data-design-template="botanical_ritual"] #store-hero { grid-area:hero; }
    :root[data-design-template="botanical_ritual"] #banners-wrap { grid-area:banners; }
    :root[data-design-template="botanical_ritual"] #categories-wrap { grid-area:categories; position:sticky; top:100px; flex-direction:column; align-items:stretch; }
    :root[data-design-template="botanical_ritual"] #offers-section { grid-area:offers; }
    :root[data-design-template="botanical_ritual"] #new-section { grid-area:new; }
    :root[data-design-template="botanical_ritual"] #bestsellers-section { grid-area:best; }
    :root[data-design-template="botanical_ritual"] .catalog-section { grid-area:catalog; }
    :root[data-design-template="botanical_ritual"] #recs-section { grid-area:recs; }
    :root[data-design-template="beauty_lab"] .product-card { grid-template-columns: minmax(150px,.7fr) minmax(0,1.3fr); }
    :root[data-design-template="beauty_lab"] .product-card-img { min-height: 180px; }
    :root[data-design-template="velvet_night"] .products-grid { grid-template-columns: repeat(var(--tablet-columns,3),minmax(0,1fr)); }
    :root[data-design-template="velvet_night"] .products-grid .product-card:nth-child(5n + 1) .product-card-img { min-height: 340px; }
    :root[data-design-template="modern_coral"] .products-grid { grid-template-columns: repeat(var(--tablet-columns,3),minmax(0,1fr)); }
}
@media (max-width: 767px) {
    :root[data-design-template="french_editorial"] .product-card { grid-template-columns: minmax(0,1fr); }
    :root[data-design-template="french_editorial"] .product-card-body { padding: 12px 4px; }
    :root[data-design-template="beauty_lab"] .product-card { grid-template-columns: minmax(104px,.8fr) minmax(0,1.2fr); }
    :root[data-design-template="beauty_lab"] .product-card-img { min-height: 126px; }
    :root[data-design-template="velvet_night"] .products-grid .product-card:nth-child(5n + 1) .product-card-img { min-height: 250px; }
}


/* PWA installation invitation */
.pwa-install-banner {
    position: fixed;
    z-index: 10050;
    inset-inline: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    max-width: 620px;
    margin-inline: auto;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface, #fff);
    color: var(--text, #28212a);
    box-shadow: 0 12px 42px rgba(35, 18, 30, .2);
    direction: rtl;
}
.pwa-install-copy { min-width: 0; }
.pwa-install-copy strong { display: block; margin-bottom: 5px; font-size: .98rem; }
.pwa-install-copy p { margin: 0; color: var(--text-secondary); font-size: .86rem; line-height: 1.6; }
.pwa-install-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.pwa-install-actions button { min-height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: inherit; font: inherit; cursor: pointer; white-space: nowrap; }
.pwa-install-actions .pwa-install-confirm { border-color: var(--design-primary, #8E1F55); background: var(--design-primary, #8E1F55); color: #fff; }
@media (max-width: 520px) {
    .pwa-install-banner { align-items: stretch; flex-direction: column; gap: 12px; }
    .pwa-install-actions { justify-content: flex-end; }
}


/* Seven-theme visual preview gallery in the admin design studio */
.design-presets { display:block; }
.design-presets-heading { display:grid; gap:4px; margin-bottom:12px; }
.design-presets-heading strong { color:var(--text); font-size:1rem; }
.design-presets-heading span { color:var(--text-secondary); font-size:.8rem; line-height:1.6; }
.design-theme-gallery { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
button.design-theme-card { display:flex; flex-direction:column; gap:8px; min-width:0; padding:8px!important; text-align:start; color:var(--text); background:var(--surface)!important; border:1px solid var(--border)!important; border-radius:15px!important; box-shadow:0 3px 12px rgba(40,25,35,.05)!important; cursor:pointer; }
button.design-theme-card.active,button.design-theme-card[aria-pressed="true"] { border:2px solid var(--primary)!important; padding:7px!important; box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 12%,transparent)!important; }
.theme-preview-shell { --tp-bg:#f8f4f0;--tp-surface:#fff;--tp-ink:#392d30;--tp-accent:#a98769;--tp-primary:#74515a; display:flex; flex-direction:column; gap:6px; width:100%; min-height:180px; padding:8px; overflow:hidden; color:var(--tp-ink); background:var(--tp-bg); border:1px solid color-mix(in srgb,var(--tp-ink) 10%,transparent); border-radius:10px; }
.theme-preview-topbar { display:flex; align-items:center; justify-content:space-between; gap:5px; min-height:13px; font-size:7px; letter-spacing:.08em; }
.theme-preview-topbar i { width:9px;height:7px;border-radius:2px;background:var(--tp-accent);opacity:.7; }
.theme-preview-topbar b { font-size:8px;letter-spacing:.12em; }
.theme-preview-hero { display:flex; flex-direction:column; justify-content:center; align-items:center; gap:3px; min-height:45px; padding:7px; color:white; background:linear-gradient(125deg,var(--tp-primary),var(--tp-accent)); border-radius:7px; text-align:center; font-size:10px; letter-spacing:.04em; }
.theme-preview-hero small { font-size:6px;letter-spacing:.12em; }
.theme-preview-categories { display:flex; gap:4px; overflow:hidden; white-space:nowrap; }
.theme-preview-categories i { flex:0 0 auto; padding:3px 5px; color:var(--tp-ink); background:var(--tp-surface); border:1px solid color-mix(in srgb,var(--tp-accent) 35%,transparent); border-radius:20px; font-size:6px; font-style:normal; }
.theme-preview-products { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; min-height:46px; }
.theme-preview-products > i { display:block; min-width:0; min-height:38px; border-radius:5px; background:linear-gradient(145deg,color-mix(in srgb,var(--tp-accent) 24%,white),color-mix(in srgb,var(--tp-primary) 30%,white)); position:relative; }
.theme-preview-products > i::after { content:""; position:absolute; inset:8px 28% 8px; border-radius:45% 45% 35% 35%; background:color-mix(in srgb,var(--tp-surface) 68%,transparent); }
.theme-preview-products.editorial { grid-template-columns:1.1fr .9fr; }
.theme-preview-products.editorial > span { display:flex;flex-direction:column;gap:3px;justify-content:center;font-size:8px; }
.theme-preview-products.editorial small { font-size:6px; }
.theme-preview-products.editorial strong { color:var(--tp-primary);font-size:7px; }
.theme-preview-products.rail { display:flex;overflow:hidden; }
.theme-preview-products.rail > i { flex:0 0 42%; }
.theme-preview-products.masonry { display:grid;grid-template-columns:1fr 1fr;grid-template-rows:24px 17px; }
.theme-preview-products.masonry > i:first-child { grid-row:span 2; }
.theme-preview-products.rows { grid-template-columns:1fr;gap:4px; }
.theme-preview-products.rows > i { min-height:15px;border-radius:4px; }
.theme-preview-products.asym { grid-template-columns:1fr 1fr;grid-template-rows:26px 18px; }
.theme-preview-products.asym > i:first-child { grid-column:1/-1; }
.theme-preview-products.dark { display:flex; }
.theme-preview-products.dark > i { flex:1;border:1px solid var(--tp-accent); }
.theme-preview-products.grid { grid-template-columns:repeat(4,minmax(0,1fr));gap:3px; }
.theme-preview-products.grid > i { min-height:28px;border-radius:3px; }
.theme-preview-caption { display:flex;flex-direction:column;gap:2px;padding-inline:2px; }
.theme-preview-caption b { font-size:.78rem;line-height:1.3; }
.theme-preview-caption small { color:var(--text-secondary);font-size:.68rem; }
.theme-preview-shell[data-design-template="french_editorial"] { --tp-bg:#f7f3ee;--tp-surface:#fffefc;--tp-ink:#302b29;--tp-accent:#b89b83;--tp-primary:#59464a; }
.theme-preview-shell[data-design-template="french_editorial"] .theme-preview-hero { border-radius:1px;min-height:54px; }
.theme-preview-shell[data-design-template="french_editorial"] .theme-preview-categories { border-block:1px solid var(--tp-accent);padding-block:4px;border-radius:0; }
.theme-preview-shell[data-design-template="luxury_boutique"] { --tp-bg:#fbf7f0;--tp-surface:#fffefa;--tp-ink:#33291f;--tp-accent:#c6a36b;--tp-primary:#805a49; }
.theme-preview-shell[data-design-template="luxury_boutique"] .theme-preview-hero { border-radius:3px 3px 16px 3px;min-height:50px; }
.theme-preview-shell[data-design-template="luxury_boutique"] .theme-preview-categories.tiles { display:grid;grid-template-columns:repeat(2,1fr); }
.theme-preview-shell[data-design-template="luxury_boutique"] .theme-preview-categories.tiles i { text-align:center;border-radius:3px;padding:5px 2px; }
.theme-preview-shell[data-design-template="beauty_gallery"] { --tp-bg:#f8f5f3;--tp-surface:#fff;--tp-ink:#352b30;--tp-accent:#c4a7a0;--tp-primary:#76616a; }
.theme-preview-shell[data-design-template="beauty_gallery"] .theme-preview-hero { min-height:35px;border-radius:15px; }
.theme-preview-shell[data-design-template="beauty_lab"] { --tp-bg:#f3f6f8;--tp-surface:#fff;--tp-ink:#26313b;--tp-accent:#a9b8c8;--tp-primary:#5f6878; }
.theme-preview-shell[data-design-template="beauty_lab"] .theme-preview-hero { min-height:28px;border-radius:5px; }
.theme-preview-shell[data-design-template="blush_romance"] { --tp-bg:#fff2f5;--tp-surface:#fff;--tp-ink:#482b37;--tp-accent:#e2b6b5;--tp-primary:#b65f7d; }
.theme-preview-shell[data-design-template="blush_romance"] .theme-preview-hero { min-height:48px;border-radius:24px 24px 7px 24px; }
.theme-preview-shell[data-design-template="blush_romance"] .theme-preview-categories i { border-radius:30px; }
.theme-preview-shell[data-design-template="velvet_night"] { --tp-bg:#130f17;--tp-surface:#211a27;--tp-ink:#f8eff6;--tp-accent:#d9bd83;--tp-primary:#9b6686; border-color:#d9bd83; }
.theme-preview-shell[data-design-template="velvet_night"] .theme-preview-hero { background:linear-gradient(130deg,#211a27,#54344d);border:1px solid var(--tp-accent);border-radius:2px; }
.theme-preview-shell[data-design-template="velvet_night"] .theme-preview-categories i { color:var(--tp-ink);background:var(--tp-surface);border-color:#806c49;border-radius:2px; }
.theme-preview-shell[data-design-template="smart_catalog"] { --tp-bg:#f5f7f7;--tp-surface:#fff;--tp-ink:#26343a;--tp-accent:#c49b72;--tp-primary:#465e69; }
.theme-preview-shell[data-design-template="smart_catalog"] .theme-preview-hero { min-height:27px;border-radius:5px; }
.theme-preview-shell[data-design-template="smart_catalog"] .theme-preview-categories.compact i { padding:3px 4px;border-radius:4px; }
@media (min-width:700px) { .design-theme-gallery { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (min-width:1100px) { .design-theme-gallery { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media (max-width:420px) { .theme-preview-shell { min-height:164px; } button.design-theme-card { padding:6px!important; } }


/* Featured theme preview: real published catalog items, not decorative placeholders */
.design-theme-feature {
    display:grid;
    grid-template-columns:minmax(180px,.72fr) minmax(0,1.28fr);
    align-items:center;
    gap:18px;
    margin:0 0 16px;
    padding:16px;
    border:1px solid var(--border);
    border-radius:18px;
    background:linear-gradient(145deg,var(--surface),color-mix(in srgb,var(--primary) 5%,var(--surface)));
}
.design-theme-feature-copy { display:grid;gap:7px;min-width:0; }
.design-theme-feature-copy > span { color:var(--primary);font-size:.76rem;font-weight:800; }
.design-theme-feature-copy h4 { margin:0;color:var(--text);font-size:1.2rem; }
.design-theme-feature-copy p { margin:0;color:var(--text-secondary);font-size:.9rem; }
.design-theme-feature-copy small { color:var(--text-secondary);line-height:1.6; }
.design-theme-feature-device { display:flex;justify-content:center;min-width:0; }
.theme-preview-shell.is-featured {
    width:100%;
    max-width:480px;
    min-height:350px;
    padding:14px;
    gap:12px;
    border-radius:16px;
    box-shadow:0 14px 34px rgba(30,20,28,.13);
}
.theme-preview-shell.is-featured .theme-preview-topbar { min-height:25px;font-size:11px; }
.theme-preview-shell.is-featured .theme-preview-topbar b { font-size:13px; }
.theme-preview-shell.is-featured .theme-preview-topbar i { width:14px;height:12px; }
.theme-preview-shell.is-featured .theme-preview-hero { min-height:92px;font-size:19px; }
.theme-preview-shell.is-featured .theme-preview-hero small { font-size:9px; }
.theme-preview-shell.is-featured .theme-preview-categories { gap:7px; }
.theme-preview-shell.is-featured .theme-preview-categories i { padding:7px 10px;font-size:10px; }
.theme-preview-shell.is-featured .theme-preview-products { min-height:140px;gap:9px; }
.theme-preview-item { display:flex;flex-direction:column;min-width:0;overflow:hidden;border-radius:9px;background:var(--tp-surface);border:1px solid color-mix(in srgb,var(--tp-ink) 9%,transparent); }
.theme-preview-item img { display:block;width:100%;aspect-ratio:1/1;object-fit:cover;background:color-mix(in srgb,var(--tp-accent) 16%,var(--tp-surface)); }
.theme-preview-item-copy { display:grid;gap:3px;min-width:0;padding:5px;color:var(--tp-ink); }
.theme-preview-item-copy b { overflow:hidden;font-size:clamp(6px,1.6vw,9px);font-weight:700;text-overflow:ellipsis;white-space:nowrap; }
.theme-preview-item-copy small { color:var(--tp-primary);font-size:clamp(6px,1.4vw,8px); }
.theme-preview-shell.is-featured .theme-preview-item-copy { padding:8px; }
.theme-preview-shell.is-featured .theme-preview-item-copy b { font-size:11px; }
.theme-preview-shell.is-featured .theme-preview-item-copy small { font-size:10px; }
.theme-preview-products.editorial .theme-preview-item:first-child { grid-row:span 2; }
.theme-preview-products.rail .theme-preview-item { flex:0 0 43%; }
.theme-preview-products.masonry { grid-template-rows:1fr 1fr; }
.theme-preview-products.masonry .theme-preview-item:first-child { grid-row:span 2; }
.theme-preview-products.rows { grid-template-columns:1fr; }
.theme-preview-products.rows .theme-preview-item { flex-direction:row;align-items:center; }
.theme-preview-products.rows .theme-preview-item img { width:54px;flex:0 0 54px; }
.theme-preview-products.rows .theme-preview-item-copy { flex:1; }
.theme-preview-products.asym { grid-template-rows:1.3fr 1fr; }
.theme-preview-products.asym .theme-preview-item:first-child { grid-column:1/-1; }
.theme-preview-products.dark .theme-preview-item { border-color:var(--tp-accent); }
.theme-preview-products.grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
.theme-preview-products.grid .theme-preview-item-copy { display:none; }
.theme-preview-empty { grid-column:1/-1;display:grid;place-items:center;min-height:80px;color:var(--tp-ink);font-size:12px; }
.theme-preview-shell.is-featured .theme-preview-empty { min-height:130px; }
@media (max-width:680px) {
    .design-theme-feature { grid-template-columns:1fr;gap:12px;padding:12px; }
    .design-theme-feature-copy { text-align:center; }
    .theme-preview-shell.is-featured { min-height:320px; }
}


/* Mobile-first responsive admin storefront preview */
.design-preview-modal {
    box-sizing:border-box;
    width:100%;
    height:100vh;
    height:100dvh;
    max-height:100dvh;
    overflow:hidden;
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
}
.design-preview-toolbar { flex:0 0 auto; min-width:0; }
.design-preview-toolbar > strong { min-width:0; }
.design-preview-actions { min-width:0; }
.design-preview-actions .btn { min-height:40px; touch-action:manipulation; }
.design-preview-stage { width:100%; min-width:0; min-height:0; flex:1 1 auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
.design-preview-stage iframe { min-width:0; }
.design-preview-stage[data-device="tablet"] iframe {
    width:min(768px,100%);
    flex:0 1 768px;
    max-width:768px;
}
.design-preview-stage[data-device="mobile"] iframe {
    width:min(390px,100%);
    flex:0 1 390px;
    max-width:390px;
}
@media(max-width:767px) {
    .design-preview-modal { gap:6px; padding: max(6px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left)); }
    .design-preview-toolbar { gap:7px; padding:4px 2px 6px; }
    .design-preview-toolbar > strong { font-size:14px; line-height:1.4; }
    .design-preview-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
    .design-preview-actions .btn { min-width:0; min-height:42px; padding:7px 5px !important; font-size:12px; white-space:nowrap; }
    .design-preview-stage { padding:3px; border-radius:12px; }
    .design-preview-stage iframe { border-radius:10px; }
    .design-preview-stage[data-device="tablet"] iframe { width:min(768px,100%); flex-basis:min(768px,100%); }
    .design-preview-stage[data-device="mobile"] iframe { width:min(390px,100%); flex-basis:min(390px,100%); }
}
@media(max-width:360px) {
    .design-preview-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
}


/* Checkout price validation and unavailable-item feedback */
.cart-price-warning,
.cart-price-error {
    margin:0 0 12px;
    padding:11px 13px;
    border-radius:10px;
    font-size:.9rem;
    line-height:1.75;
    font-weight:700;
}
.cart-price-warning {
    color:#875b14;
    border:1px solid #ead5a4;
    background:#fff8e8;
}
.cart-price-error {
    color:#9b2c36;
    border:1px solid #efc1c5;
    background:#fff1f2;
}
:root[data-theme="dark"] .cart-price-warning {
    color:#f4dca7;
    border-color:#6f5b32;
    background:#332a19;
}
:root[data-theme="dark"] .cart-price-error {
    color:#ffc2c8;
    border-color:#6c3038;
    background:#351b20;
}


/* Responsive campaign banner preview: real desktop/mobile proportions */
.design-banner-preview-switch {
    display:flex;
    gap:6px;
    margin:0 0 8px;
}
.design-banner-preview-switch .btn {
    min-height:36px;
    padding:6px 12px;
    font-size:12px;
}
.design-banner-preview-frame {
    position:relative;
    width:100%;
    max-width:560px;
    overflow:hidden;
    border:1px solid var(--border);
    border-radius:13px;
    background:var(--surface-secondary);
    isolation:isolate;
    transition:aspect-ratio .18s ease;
}
.design-banner-preview-frame[data-device="mobile"] {
    max-width:390px;
}
.design-banner-preview-frame .design-banner-preview {
    position:absolute;
    inset:0;
    display:block;
    width:100%;
    height:100%;
    aspect-ratio:auto;
    border:0;
    border-radius:0;
    background:var(--surface-secondary);
}
.design-banner-preview-shade {
    position:absolute;
    inset:0;
    z-index:1;
    pointer-events:none;
    background:linear-gradient(90deg,rgba(0,0,0,var(--banner-overlay, .32)),rgba(0,0,0,0));
}
.design-banner-preview-copy {
    position:absolute;
    z-index:2;
    inset-inline-start:7%;
    inset-block-end:9%;
    display:grid;
    gap:5px;
    max-width:86%;
    color:#fff;
    text-shadow:0 1px 5px rgba(0,0,0,.35);
    pointer-events:none;
}
.design-banner-preview-copy strong {
    font-size:clamp(15px,3vw,25px);
    line-height:1.35;
    overflow-wrap:anywhere;
}
.design-banner-preview-copy span {
    font-size:clamp(10px,1.8vw,14px);
    line-height:1.5;
    overflow-wrap:anywhere;
}
.design-banner-preview-frame[data-device="mobile"] .design-banner-preview-copy strong {
    font-size:17px;
}
.design-banner-preview-frame[data-device="mobile"] .design-banner-preview-copy span {
    font-size:11px;
}


/* Smart, stable full-store preview: device widths are real iframe viewports. */
.design-advanced-settings {
    margin:14px 0 18px;
    border:1px solid var(--border);
    border-radius:14px;
    background:var(--surface);
    overflow:hidden;
}
.design-advanced-settings > summary {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:14px 16px;
    cursor:pointer;
    color:var(--text);
    font-weight:700;
    list-style:none;
}
.design-advanced-settings > summary::-webkit-details-marker { display:none; }
.design-advanced-settings > summary::after { content:"＋"; color:var(--primary); font-size:18px; }
.design-advanced-settings[open] > summary::after { content:"−"; }
.design-advanced-settings > summary span { color:var(--text-secondary); font-size:12px; font-weight:400; }
.design-advanced-settings[open] > .design-fields-grid { padding:0 14px 14px; }

.design-preview-stage {
    align-items:center;
    justify-content:center;
    overflow:auto;
    min-width:0;
}
.design-preview-stage iframe {
    display:block;
    flex:1 1 auto;
    width:100%;
    height:100%;
    min-width:0;
    min-height:0;
    max-width:100%;
    border:1px solid var(--border);
    background:var(--bg);
    transition:width .18s ease, height .18s ease, flex-basis .18s ease;
}
.design-preview-stage[data-device="desktop"] iframe {
    flex:1 1 auto;
    width:100%;
    height:100%;
    max-width:none;
    aspect-ratio:auto;
}
.design-preview-stage[data-device="tablet"] iframe {
    flex:0 1 768px;
    width:min(768px,100%);
    height:100%;
    max-width:768px;
    aspect-ratio:auto;
}
.design-preview-stage[data-device="mobile"] iframe {
    flex:0 1 auto;
    width:min(390px,100%);
    height:auto;
    max-height:100%;
    max-width:100%;
    aspect-ratio:9 / 16;
}
@media(max-width:767px) {
    .design-preview-stage[data-device="mobile"] iframe {
        flex:0 1 auto;
        width:min(390px,100%);
        height:auto;
        max-height:100%;
        max-width:100%;
        aspect-ratio:9 / 16;
    }
    .design-advanced-settings > summary { align-items:flex-start; flex-direction:column; gap:4px; }
}

.design-basic-fields {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
    gap:12px;
    margin:16px 0;
    padding:14px;
    border:1px solid var(--border);
    border-radius:14px;
    background:var(--surface);
}
.design-basic-fields > label {
    display:grid;
    align-content:start;
    gap:6px;
    color:var(--text);
    font-size:13px;
    font-weight:600;
}
