:root{--primary:#6d3ee5;--dark:#4c1d95;--ink:#17132a;--surface:#fff;--radius:18px;--shadow:0 15px 45px rgba(52,31,108,.08)}*{box-sizing:border-box}body{font-family:Inter,system-ui,sans-serif}img{object-fit:cover}.nav-pill{display:inline-flex;align-items:center;padding:8px 13px;border-radius:999px;color:#475569;font-size:12px;transition:background .2s}.nav-pill:hover{background:#f1eaff;color:var(--primary)}.no-scrollbar::-webkit-scrollbar{display:none}.panel{background:var(--surface);border:1px solid #eae7f4;border-radius:var(--radius);box-shadow:var(--shadow)}.btn-primary{background:var(--primary);color:#fff;border-radius:12px;padding:12px 20px;display:inline-flex;align-items:center;justify-content:center;gap:7px;font-weight:700;transition:filter .2s}.btn-primary:hover{filter:brightness(.91)}.btn-primary:disabled{background:#bbb5cb;cursor:not-allowed}.btn-outline{border:1px solid #ddd7ef;border-radius:12px;padding:11px 18px;display:inline-flex;justify-content:center;gap:8px}.btn-outline:hover{border-color:var(--primary);color:var(--primary)}.page-wrap{max-width:1280px;margin:0 auto;padding:32px 16px}.section-title{font-size:clamp(1.35rem,2.4vw,2rem);font-weight:800;letter-spacing:-.04em}.product-card{overflow:hidden;border-radius:18px;background:white;border:1px solid #eae7f4;transition:transform .2s,box-shadow .2s}.product-card:hover{transform:translateY(-3px);box-shadow:var(--shadow)}.product-image{height:250px;width:100%;object-fit:contain;background:#f8f7fc}.input-style{width:100%;border:1px solid #ddd9e9;padding:12px 14px;border-radius:12px;outline:none;background:white}.input-style:focus{border-color:var(--primary);box-shadow:0 0 0 3px #ede5ff}.pill-select{padding:10px 15px;border:1px solid #ded8e8;border-radius:10px;font-size:13px;cursor:pointer;background:white;min-width:48px}.pill-select[aria-pressed="true"]{border:2px solid var(--primary);background:#f1eaff;color:#4c1d95;font-weight:800}.pill-select:disabled{opacity:.32;text-decoration:line-through;cursor:not-allowed}.color-select{height:35px;width:35px;border-radius:50%;border:2px solid #ddd;background:var(--swatch,#fff);cursor:pointer;outline-offset:3px}.color-select[aria-pressed="true"]{outline:2px solid var(--primary)}.color-select:disabled{opacity:.24;cursor:not-allowed}.field-label{display:block;font-size:13px;font-weight:600;margin-bottom:6px}.field-row{margin-bottom:16px}.field-row input,.field-row select,.field-row textarea{width:100%;border:1px solid #dfdbe9;border-radius:12px;padding:11px 13px;background:white}.field-row input[type=checkbox]{width:auto}.field-row .errorlist{font-size:12px;color:#be123c}.data-table{width:100%;border-collapse:collapse}.data-table th,.data-table td{padding:12px;text-align:left;border-bottom:1px solid #eee9f5;font-size:13px}.data-table th{font-weight:700;color:#64748b;background:#faf9ff}.swatch-input{width:48px!important;height:44px;padding:4px!important;cursor:pointer}@media(max-width:640px){.product-image{height:200px}.page-wrap{padding:22px 14px}.data-table th,.data-table td{padding:8px}}

/* Navegación comercial, capas y estados responsivos. El tema vive en base.html */
.nav-link{padding:9px 10px;border-radius:999px;white-space:nowrap}.nav-link:hover,.nav-link.is-current,.nav-pill.is-current{background:#f1eaff;color:var(--primary);font-weight:700}
.nav-cart{background:#f1eaff;color:var(--primary);border-radius:999px;padding:9px 12px;font-weight:700;white-space:nowrap}.nav-cart.is-current{outline:2px solid var(--primary)}
.icon-btn{width:38px;height:38px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;background:#f7f3ff;color:var(--ink)}
.mega-menu{position:absolute;top:100%;left:0;right:0;background:#fff;box-shadow:0 22px 45px rgba(25,15,47,.15);border-top:1px solid #ede7fa;max-height:70vh;overflow-y:auto;z-index:60}
.screen-backdrop{position:fixed;inset:0;background:rgba(17,12,31,.46);z-index:65}
.side-menu,.cart-drawer{position:fixed;z-index:70;top:0;bottom:0;width:min(92vw,420px);background:#fff;transition:transform .25s ease;box-shadow:0 20px 50px #17132a22}
.side-menu{left:0;transform:translateX(-105%)}.side-menu.open{transform:translateX(0)}
.cart-drawer{right:0;transform:translateX(105%);display:flex;flex-direction:column}.cart-drawer.open{transform:translateX(0)}
.variant-modal{position:fixed;z-index:80;left:50%;top:50%;transform:translate(-50%,-46%) scale(.97);width:min(92vw,520px);max-height:86vh;overflow-y:auto;background:white;border-radius:24px;padding:25px;box-shadow:0 24px 60px #17132a40;visibility:hidden;opacity:0;transition:all .2s}.variant-modal.open{visibility:visible;opacity:1;transform:translate(-50%,-50%) scale(1)}
.store-toast{position:fixed;bottom:23px;left:50%;transform:translateX(-50%);z-index:100;background:#24123d;color:white;padding:13px 20px;border-radius:15px;box-shadow:0 12px 25px #0003;max-width:90vw;text-align:center;font-size:14px}
.card-gallery{display:flex;gap:6px;padding:8px 12px;overflow-x:auto;min-height:57px;background:#faf8ff}.card-thumb{width:42px;height:42px;flex-shrink:0;border:1px solid #ddd7ef;background:white;border-radius:9px;overflow:hidden}.card-thumb.is-active{border:2px solid var(--primary)}.card-thumb img{height:100%;width:100%;object-fit:contain}
.card-gallery:empty{display:none}.admin-nav{display:flex;gap:8px;overflow-x:auto;padding-bottom:9px;scrollbar-width:thin}.admin-nav>a{flex-shrink:0}.admin-nav .is-current{background:var(--primary);color:white;border-color:var(--primary);box-shadow:0 5px 15px #6d3ee533}
.drawer-line{display:flex;gap:12px;padding:13px 0;border-bottom:1px solid #eee9f5}.drawer-line img{width:65px;height:65px;object-fit:contain;border-radius:10px;background:#faf9ff}.drawer-line .item-content{flex:1;min-width:0}
@media(max-width:700px){.mega-menu{display:none!important}.admin-nav{margin-left:-8px;margin-right:-8px}.product-card .product-image{height:210px}}

.sticky-buy{position:fixed;left:0;right:0;bottom:0;z-index:35;background:rgba(255,255,255,.98);box-shadow:0 -10px 36px #24123d16;border-top:1px solid #e9e1fa;padding:12px 0;display:none}.sticky-buy .btn-primary{padding:11px 14px;font-size:13px}@media(max-width:767px){body:has(#buyForm) .sticky-buy{display:block}body:has(#buyForm) footer{padding-bottom:80px}}


/* Autocompletado contextual, siempre por encima del mega menú. */
.search-autocomplete-container {
    position: relative;
    overflow: visible;
}
.search-autocomplete-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 90;
    background: #ffffff;
    border: 1px solid #e8e1f6;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(34, 20, 70, .16);
    max-height: min(65vh, 540px);
    overflow-y: auto;
    padding: 8px;
}
.search-autocomplete-popup[hidden],
.special-product-choice[hidden] {
    display: none !important;
}
.search-result {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px;
    border-radius: 12px;
}
.search-result:hover,
.search-result:focus-visible {
    background: #f5f0ff;
}
.search-result img {
    width: 52px;
    height: 52px;
    flex: none;
    object-fit: contain;
    border-radius: 9px;
    background: #faf9ff;
}
.search-result-body {
    min-width: 0;
    display: grid;
    gap: 3px;
    font-size: 13px;
}
.search-result-body strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-result-body small {
    color: #64748b;
}
.search-result-body b {
    color: #6d3ee5;
}
.search-category {
    display: block;
    padding: 10px 12px;
    font-size: 12px;
    color: #6d3ee5;
    border-top: 1px solid #eee9fb;
}
.search-no-results {
    padding: 16px;
    font-size: 13px;
    color: #64748b;
}


/* Nova V5: pie de página accesible, colores de descuento y temas persistentes. */
.store-footer {
    color: #f8f5ff;
    background: #17132a;
    border-top: 1px solid rgba(255, 255, 255, .15);
}
.store-footer .footer-brand {
    display: inline-block;
    color: #ffffff;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -.035em;
}
.store-footer .footer-description { color: #e3def5; line-height: 1.8; font-size: .94rem; }
.store-footer .footer-heading { font-weight: 800; color: #ffffff; margin-bottom: 1rem; }
.store-footer .footer-links { display: grid; gap: .8rem; }
.store-footer .footer-links a { color: #e3def5; font-size: .91rem; width: fit-content; }
.store-footer .footer-links a:hover, .store-footer .footer-links a:focus-visible {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 4px;
}
.store-footer .footer-bottom { color: #d5cce9; border-top: 1px solid #50445f; }
.theme-toggle { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid #ded6f1; border-radius: 999px; padding: 8px 12px; font-size: .81rem; font-weight: 700; background: #f5f0ff; color: #391e68; white-space: nowrap; }
.theme-toggle:hover { border-color: var(--primary); }
.sale-badge { display: inline-flex; align-items: center; color: #fff; background: #6d3ee5; padding: 4px 8px; font-size: .77rem; font-weight: 800; border-radius: 8px; white-space: nowrap; }
.original-price, .search-offer del { color: #655d75; text-decoration: line-through; }
.search-offer { display: flex; align-items: center; gap: .6rem; }
/* Los selectores siguientes cubren las utilidades más usadas en templates públicos y de gestión. */
html[data-theme="dark"] { color-scheme: dark; --ink:#f4efff; --surface:#211b32; --shadow:0 15px 45px rgba(0,0,0,.28); }
html[data-theme="dark"] body { background: #130f20 !important; color: #f4efff !important; }
html[data-theme="dark"] .bg-white, html[data-theme="dark"] .bg-white\/95,
html[data-theme="dark"] .bg-slate-50, html[data-theme="dark"] .bg-\[\#faf9ff\],
html[data-theme="dark"] .bg-\[\#f8f7fc\],html[data-theme="dark"] .panel,
html[data-theme="dark"] .product-card, html[data-theme="dark"] .mega-menu,
html[data-theme="dark"] .side-menu, html[data-theme="dark"] .cart-drawer,
html[data-theme="dark"] .variant-modal,html[data-theme="dark"] .search-autocomplete-popup,
html[data-theme="dark"] .sticky-buy,html[data-theme="dark"] .card-thumb,
html[data-theme="dark"] .field-row input,html[data-theme="dark"] .field-row select,
html[data-theme="dark"] .field-row textarea,html[data-theme="dark"] .input-style,
html[data-theme="dark"] .pill-select { background-color: #211b32 !important; color: #f4efff !important; }
html[data-theme="dark"] .bg-\[\#f1eaff\],html[data-theme="dark"] .bg-violet-50,
html[data-theme="dark"] .bg-slate-100,html[data-theme="dark"] .card-gallery,
html[data-theme="dark"] .nav-link.is-current,html[data-theme="dark"] .nav-cart,
html[data-theme="dark"] .icon-btn,html[data-theme="dark"] .theme-toggle { background: #322749 !important; color: #e9dcff !important; }
html[data-theme="dark"] .text-deep,html[data-theme="dark"] .text-slate-900,
html[data-theme="dark"] .text-slate-800,html[data-theme="dark"] .text-slate-700,
html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3,
html[data-theme="dark"] strong,html[data-theme="dark"] label { color: #f4efff; }
html[data-theme="dark"] .text-slate-600,html[data-theme="dark"] .text-slate-500,
html[data-theme="dark"] .text-slate-400,html[data-theme="dark"] .original-price,
html[data-theme="dark"] .search-offer del { color: #c0b5d2 !important; }
html[data-theme="dark"] .text-brand,html[data-theme="dark"] .text-violet-600,
html[data-theme="dark"] .search-result-body b { color: #bb9bff !important; }
html[data-theme="dark"] .border,html[data-theme="dark"] .border-b,
html[data-theme="dark"] .border-t,html[data-theme="dark"] .border-slate-100,
html[data-theme="dark"] .border-slate-200,html[data-theme="dark"] .product-card,
html[data-theme="dark"] .panel,html[data-theme="dark"] .data-table td,
html[data-theme="dark"] .data-table th { border-color: #473858 !important; }
html[data-theme="dark"] .data-table th,html[data-theme="dark"] thead,
html[data-theme="dark"] .search-result:hover,html[data-theme="dark"] .search-result:focus-visible,
html[data-theme="dark"] .search-category:hover { background: #312740 !important; color: #f4efff !important; }
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea {
    background-color: #241d36; color: #f4efff; border-color: #514262;
}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder { color: #aaa0b9; }
html[data-theme="dark"] .product-image { background: #282238; }
html[data-theme="dark"] .store-footer { background: #0c0a15; }
html[data-theme="dark"] .store-footer .footer-description,
html[data-theme="dark"] .store-footer .footer-links a { color: #e3def5; }
html[data-theme="dark"] .btn-primary,html[data-theme="dark"] .sale-badge { color: white !important; }
html[data-theme="dark"] .search-autocomplete-popup { border-color: #514262; }
@media (prefers-reduced-motion: reduce) { .theme-toggle, .product-card { transition: none; } }


/* V6: logotipo consistente, foco accesible y contrastes claros/oscuros. */
.store-logo-ring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: none;
    overflow: hidden;
    border-radius: 50%;
    background: #21152f;
    border: 2px solid #f15da5;
    box-shadow: 0 0 0 2px rgba(241, 93, 165, .12), 0 5px 15px rgba(209, 47, 130, .27);
}
.store-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.store-logo-fallback { font-size: 12px; color: white; font-weight: 800; }
.cart-count-badge,
html[data-theme="light"] .cart-count-badge,
html[data-theme="dark"] .cart-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 23px;
    height: 23px;
    padding: 1px 6px;
    border-radius: 999px;
    background-color: #5a25ca !important;
    color: #ffffff !important;
    font-weight: 800;
    font-size: 12px;
    line-height: 1;
    opacity: 1 !important;
    border: 1px solid rgba(255,255,255,.3);
}
html[data-theme="light"] .nav-cart { color: #44218c !important; background: #f0e8ff !important; }
html[data-theme="light"] .store-global-search { background-color: #ffffff; border-color: #cec3e4; color: #21152f; }
html[data-theme="light"] .store-global-search input { color: #21152f !important; opacity: 1 !important; }
html[data-theme="light"] .store-global-search input::placeholder { color: #687086 !important; opacity: 1; }
html[data-theme="light"] .store-global-search button { background: #2d164c !important; color: #ffffff !important; }
html[data-theme="dark"] .cart-count-badge { background: #ab74ff !important; color: #171023 !important; }
html[data-theme="dark"] .store-logo-ring { border-color: #ff6fbb; }
.product-sharing { display: flex; flex-wrap: wrap; gap: 10px 15px; align-items: center; margin: -9px 0 24px; }
.product-share-label { font-size: 13px; font-weight: 700; }
.product-share-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.share-action { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d7cbe9; color: #351f58; background: #ffffff; border-radius: 999px; padding: 9px 12px; font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: none; }
.share-action:hover, .share-action:focus-visible { border-color: #6d3ee5; outline-offset: 2px; color: #572bbf; }
.product-share-feedback { flex-basis: 100%; font-size: 12px; color: #255e45; min-height: 1em; }
html[data-theme="dark"] .share-action { background: #302442; border-color: #5c4b73; color: #f4efff; }
html[data-theme="dark"] .product-share-feedback { color: #8be8bd; }

/* V7 · Navegación adaptable para tienda y administración. */
.mobile-bottom-nav,
.mobile-category-tab,
.admin-mobile-toolbar,
.admin-mobile-drawer {
    display: none;
}

.admin-desktop-nav .admin-nav-item {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd7ef;
    border-radius: 12px;
    padding: 11px 18px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.admin-desktop-nav .admin-nav-item:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.admin-desktop-nav .admin-nav-item.is-current {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
}

@media (max-width: 1023px) {
    :root {
        --mobile-nav-height: 68px;
    }
    body {
        padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    }
    /* La barra inferior ocupa el lugar de los enlaces del header en móvil/tablet. */
    .mobile-header-actions > :not(.theme-toggle) {
        display: none !important;
    }
    .mobile-header-actions {
        margin-left: auto;
        flex: none;
    }
    .mobile-header-brand {
        min-width: 0;
    }
    .mobile-header-brand .store-logo-ring {
        width: 42px;
        height: 42px;
    }
    #storeHeader > div:first-child {
        gap: 10px;
    }
    .mobile-bottom-nav {
        position: fixed;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 58;
        padding: 5px max(7px, env(safe-area-inset-left, 0px)) calc(5px + env(safe-area-inset-bottom, 0px)) max(7px, env(safe-area-inset-right, 0px));
        border-top: 1px solid #e9ddf4;
        background: rgba(255, 255, 255, .98);
        box-shadow: 0 -8px 32px rgba(28, 14, 48, .09);
        backdrop-filter: blur(14px);
    }
    .mobile-bottom-item {
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        min-width: 0;
        border-radius: 14px;
        color: #604a75;
        font-weight: 700;
        gap: 3px;
        line-height: 1;
        cursor: pointer;
        background: transparent;
        touch-action: manipulation;
    }
    .mobile-bottom-item > span:first-child {
        font-size: 25px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .mobile-bottom-item small {
        font-size: 10px;
        line-height: 1.15;
        white-space: nowrap;
    }
    .mobile-bottom-item:hover,
    .mobile-bottom-item:focus-visible,
    .mobile-bottom-item.is-current {
        background: #f0e8ff;
        color: #5d23c4;
    }
    .mobile-bottom-count {
        position: absolute;
        top: 0;
        left: calc(50% + 8px);
        border-radius: 999px;
        background: #6d3ee5;
        color: white;
        min-width: 19px;
        height: 19px;
        font-size: 10px;
        padding: 3px;
        font-weight: 800;
        text-align: center;
    }
    .mobile-category-tab {
        display: flex;
        position: fixed;
        z-index: 42;
        top: 41%;
        left: 0;
        transform: translateY(-50%);
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 8px;
        width: 37px;
        height: 116px;
        border-radius: 0 16px 16px 0;
        background: linear-gradient(160deg, #ec4899, #a326b8);
        box-shadow: 3px 8px 18px rgba(176, 39, 123, .24);
        color: white;
        font-weight: 800;
        font-size: 11px;
        writing-mode: vertical-rl;
        text-transform: uppercase;
        letter-spacing: .025em;
    }
    .mobile-category-tab-icon {
        writing-mode: horizontal-tb;
        font-size: 23px;
    }
    body:has(#mobileMenu.open) .mobile-category-tab {
        visibility: hidden;
    }
    .admin-desktop-nav {
        display: none !important;
    }
    .admin-mobile-toolbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 14px;
        border-radius: 14px;
        border: 1px solid #e7ddf5;
        background: #fff;
        box-shadow: 0 6px 25px rgba(54, 33, 94, .04);
    }
    .admin-mobile-context {
        display: flex;
        flex-direction: column;
        gap: 3px;
        min-width: 0;
    }
    .admin-mobile-context strong {
        font-size: 14px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .admin-mobile-context-label,
    .admin-mobile-drawer-eyebrow {
        color: #766483;
        font-size: 11px;
        font-weight: 700;
    }
    .admin-mobile-open {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        flex: none;
        border-radius: 12px;
        background: #6d3ee5;
        color: #fff;
        padding: 10px 12px;
        font-weight: 700;
        font-size: 12px;
    }
    .admin-mobile-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        z-index: 72;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(90vw, 380px);
        background: #fff;
        box-shadow: 10px 0 32px rgba(22, 10, 38, .23);
        transform: translateX(-105%);
        transition: transform .24s ease;
    }
    .admin-mobile-drawer.open {
        transform: translateX(0);
    }
    .admin-mobile-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 19px 18px;
        border-bottom: 1px solid #e9e1f4;
    }
    .admin-mobile-drawer-links {
        display: flex;
        flex-direction: column;
        gap: 5px;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 14px 12px max(22px, env(safe-area-inset-bottom, 0px));
    }
    .admin-mobile-drawer-links .admin-nav-item {
        display: flex;
        padding: 13px 14px;
        border-radius: 12px;
        font-size: 14px;
        font-weight: 700;
        color: #412c60;
        background: transparent;
    }
    .admin-mobile-drawer-links .admin-nav-item:hover,
    .admin-mobile-drawer-links .admin-nav-item:focus-visible,
    .admin-mobile-drawer-links .admin-nav-item.is-current {
        background: #eee5ff;
        color: #5723c3;
    }
    body:has(#buyForm) .sticky-buy {
        bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    }
    .store-toast {
        bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 14px);
    }
    .store-footer {
        margin-bottom: 0;
    }
    .side-menu,
    .cart-drawer {
        width: min(92vw, 410px);
    }
}

@media (max-width: 410px) {
    .mobile-header-brand > span:last-child {
        display: none !important;
    }
    .mobile-category-tab {
        width: 31px;
        height: 100px;
        font-size: 9px;
    }
    .mobile-bottom-item small {
        font-size: 9px;
    }
    .mobile-header-actions .theme-toggle {
        padding: 8px 10px;
    }
}

/* Mantener la barra inferior y los menús legibles en modo oscuro. */
@media (max-width: 1023px) {
    html[data-theme="dark"] .mobile-bottom-nav,
    html[data-theme="dark"] .admin-mobile-toolbar,
    html[data-theme="dark"] .admin-mobile-drawer {
        background: #211b32;
        border-color: #4b3a63;
        color: #f4efff;
    }
    html[data-theme="dark"] .mobile-bottom-item {
        color: #d1c2e9;
    }
    html[data-theme="dark"] .mobile-bottom-item.is-current,
    html[data-theme="dark"] .mobile-bottom-item:hover,
    html[data-theme="dark"] .mobile-bottom-item:focus-visible,
    html[data-theme="dark"] .admin-mobile-drawer-links .admin-nav-item.is-current {
        background: #44325e;
        color: #e4d3ff;
    }
    html[data-theme="dark"] .admin-mobile-drawer-links .admin-nav-item {
        color: #ebe2fa;
    }
    html[data-theme="dark"] .admin-mobile-context-label,
    html[data-theme="dark"] .admin-mobile-drawer-eyebrow {
        color: #c1b4d6;
    }
}

@media (min-width: 1024px) {
    .admin-mobile-drawer,
    .admin-mobile-toolbar,
    .mobile-bottom-nav,
    .mobile-category-tab {
        display: none !important;
    }
}


/* V8 — Navegación sin pestaña flotante ni franja promocional superior. */
.mobile-category-tab { display: none !important; }
.footer-brand-with-logo { display: inline-flex; align-items: center; gap: 12px; }
.footer-brand-with-logo .store-logo-ring { flex: none; width: 46px; height: 46px; }

@media (max-width: 1023px) {
    .store-mobile-drawer,
    .admin-mobile-drawer {
        width: min(91vw, 390px);
        max-width: 100%;
        height: 100dvh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        background: #fff;
        color: #21172f;
    }
    .mobile-drawer-head,
    .admin-mobile-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        flex: none;
        padding: 18px 16px;
        border-bottom: 1px solid #e9e0f2;
        background: linear-gradient(120deg, #fff, #f5edff);
    }
    .mobile-drawer-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
    .mobile-drawer-brand strong,
    .mobile-drawer-brand h2 { display: block; font-weight: 800; font-size: 16px; line-height: 1.3; }
    .mobile-drawer-brand p { font-size: 11px; color: #665874; margin-top: 2px; }
    .mobile-drawer-logo { flex: none; width: 49px; height: 49px; }
    .mobile-drawer-close { flex: none; border: 1px solid #e5d7f3; border-radius: 12px; width: 38px; height: 38px; font-size: 18px; background: #fff; color: #4e2b69; }
    .mobile-drawer-body,
    .admin-mobile-drawer-links {
        padding: 12px 14px 20px;
        overflow-y: auto;
        overscroll-behavior: contain;
        flex: 1;
    }
    .mobile-drawer-section-label {
        margin: 19px 9px 8px;
        color: #776782;
        font-weight: 800;
        font-size: 10px;
        letter-spacing: .11em;
        text-transform: uppercase;
    }
    .mobile-drawer-row,
    .mobile-category-group > summary {
        display: flex;
        align-items: center;
        gap: 13px;
        padding: 13px 12px;
        color: #2d2042;
        font-size: 14px;
        font-weight: 650;
        border-radius: 13px;
        cursor: pointer;
        list-style: none;
        min-height: 48px;
    }
    .mobile-category-group > summary::-webkit-details-marker { display: none; }
    .mobile-drawer-row > span:first-child,
    .mobile-category-symbol,
    .admin-mobile-drawer-links .admin-nav-item > span:first-child {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: none;
        width: 35px;
        height: 35px;
        border-radius: 11px;
        color: #6d3ee5;
        background: #f0e9ff;
        font-size: 21px;
    }
    .mobile-category-group { border-bottom: 1px solid #f1edf6; }
    .mobile-category-group[open] > summary,
    .mobile-category-group > summary:hover,
    .mobile-drawer-row:hover,
    .mobile-drawer-row.is-current { background: #f4efff; color: #5821bf; }
    .mobile-row-chevron,
    .mobile-category-arrow { margin-left: auto; font-size: 22px; color: #8e7a9e; }
    .mobile-category-group[open] .mobile-category-arrow { transform: rotate(180deg); }
    .mobile-category-children { padding: 0 12px 12px 58px; display: grid; gap: 2px; }
    .mobile-category-children a { display: block; padding: 10px 5px; border-radius: 8px; color: #655572; font-size: 13px; }
    .mobile-category-children a:hover { color: #6d3ee5; background: #f8f4ff; }
    .mobile-drawer-empty { margin: 0 10px; color: #6b5d7b; font-size: 13px; }
    .mobile-drawer-foot { flex: none; text-align: center; border-top: 1px solid #ede5f6; padding: 13px; font-size: 11px; color: #776782; }
    .admin-mobile-drawer-links { gap: 3px; }
    .admin-mobile-drawer-links .mobile-drawer-section-label { flex: none; }
    .admin-mobile-drawer-links .admin-nav-item { align-items: center; gap: 12px; min-height: 50px; }
    .admin-mobile-drawer-links .admin-nav-item > span:first-child { width: 34px; height: 34px; font-size: 19px; }
    .admin-mobile-drawer-links .admin-nav-item.is-current { border-left: 3px solid #6d3ee5; }
    .admin-return-link { border-top: 1px solid #eee4f6; margin-top: 8px; }
    .admin-mobile-toolbar { border-radius: 16px; }
    .admin-mobile-open { min-height: 44px; }
}
@media (max-width: 1023px) {
    html[data-theme="dark"] .store-mobile-drawer,
    html[data-theme="dark"] .admin-mobile-drawer { background: #211b32; color: #f5f0ff; }
    html[data-theme="dark"] .mobile-drawer-head,
    html[data-theme="dark"] .admin-mobile-drawer-header { background: linear-gradient(120deg, #211b32, #332448); border-color: #4b3a63; }
    html[data-theme="dark"] .mobile-drawer-brand p,
    html[data-theme="dark"] .mobile-drawer-section-label,
    html[data-theme="dark"] .mobile-drawer-foot { color: #c5b8d9; }
    html[data-theme="dark"] .mobile-drawer-close { background: #3a2b4d; border-color: #615171; color: white; }
    html[data-theme="dark"] .mobile-drawer-row,
    html[data-theme="dark"] .mobile-category-group > summary { color: #eee6fb; }
    html[data-theme="dark"] .mobile-category-group,
    html[data-theme="dark"] .mobile-drawer-foot { border-color: #49395d; }
    html[data-theme="dark"] .mobile-drawer-row > span:first-child,
    html[data-theme="dark"] .mobile-category-symbol,
    html[data-theme="dark"] .admin-mobile-drawer-links .admin-nav-item > span:first-child { color: #d9c5ff; background: #433059; }
    html[data-theme="dark"] .mobile-drawer-row:hover,
    html[data-theme="dark"] .mobile-drawer-row.is-current,
    html[data-theme="dark"] .mobile-category-group[open] > summary,
    html[data-theme="dark"] .mobile-category-group > summary:hover { color: #eedfff; background: #423059; }
    html[data-theme="dark"] .mobile-category-children a { color: #d4c4e8; }
    html[data-theme="dark"] .mobile-category-children a:hover { background: #44325e; color: white; }
}


/* V9: jerarquía visual de categorías y subcategorías (claro y oscuro). */
.mobile-category-symbol i,
.mobile-subcategory-icon i { font-size: 17px; line-height: 1; }
.mobile-category-children {
    padding: 3px 9px 12px 17px;
    gap: 5px;
}
.mobile-category-children .mobile-subcategory-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 11px;
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #514263;
    font-weight: 550;
    font-size: 13px;
    text-decoration: none;
}
.mobile-subcategory-icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f2eaff;
    color: #6d3ee5;
}
.mobile-subcategory-chevron { margin-left: auto; opacity: .65; }
.mobile-category-children .mobile-subcategory-link:hover,
.mobile-category-children .mobile-subcategory-link:focus-visible {
    background: #f5f0ff;
    border-color: #dfd2ff;
    color: #4c1d95;
}
.mobile-category-children .mobile-category-all {
    font-weight: 750;
    color: #5b2dc7;
}
html[data-theme="dark"] .mobile-category-children .mobile-subcategory-link {
    color: #eee5fb;
}
html[data-theme="dark"] .mobile-subcategory-icon {
    background: #48315f;
    color: #d5b5ff;
}
html[data-theme="dark"] .mobile-category-children .mobile-subcategory-link:hover,
html[data-theme="dark"] .mobile-category-children .mobile-subcategory-link:focus-visible {
    background: #48315f;
    border-color: #735492;
    color: white;
}


/* Nova V10: la firma se lee y se exporta igual en ambos temas. */
#signature.signature-canvas,
html[data-theme="dark"] #signature.signature-canvas {
    background: #fff !important;
    border-color: #a78bfa !important;
    color-scheme: light;
    touch-action: none;
}

/* El mega menú y las categorías deben contrastar también en modo oscuro. */
html[data-theme="dark"] .nav-pill {
    color: #eee3ff !important;
}
html[data-theme="dark"] .nav-pill:hover,
html[data-theme="dark"] .nav-pill:focus-visible,
html[data-theme="dark"] .nav-pill.is-current {
    color: #fff !important;
    background: #4e356a !important;
}
html[data-theme="dark"] #megaMenu,
html[data-theme="dark"] .mega-menu {
    background: #251c36 !important;
    color: #f8f2ff !important;
    border-color: #5e4d72;
}
html[data-theme="dark"] #megaMenu a,
html[data-theme="dark"] #megaMenu .text-slate-600 {
    color: #ddd0f3 !important;
}
html[data-theme="dark"] #megaMenu a:hover {
    color: #fff !important;
    background: #3a2a4e;
    border-radius: 8px;
}
html[data-theme="dark"] .admin-nav-item:not(.is-current) {
    color: #e4d8f4;
}
html[data-theme="dark"] .admin-nav-item:hover {
    background: #4a3365;
    color: white;
}
html[data-theme="dark"] .mobile-category-children .mobile-subcategory-link {
    color: #e4d6f8 !important;
}
html[data-theme="dark"] .return-qty {
    background: #302441;
    border: 1px solid #715594;
    color: #fff;
}
.return-qty { width: 96px; padding: 9px; border: 1px solid #ddd7ef; border-radius: 10px; }

/* V11: cabecera compacta en una sola línea en móvil y tablet. */
@media (max-width: 767px) {
    #storeHeader > div:first-child {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        width: 100%;
        padding: 9px 10px;
        gap: 8px;
        min-width: 0;
    }
    #storeHeader .mobile-header-hamburger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        min-width: 38px;
        padding: 0;
        flex-shrink: 0;
    }
    #storeHeader .mobile-header-brand {
        display: inline-flex;
        flex: none;
        align-items: center;
        gap: 0;
        min-width: 0;
    }
    #storeHeader .mobile-header-brand > span:last-child {
        display: none !important;
    }
    #storeHeader .mobile-header-brand .store-logo-ring {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }
    #storeHeader .mobile-inline-search {
        display: flex !important;
        align-items: stretch;
        flex: 1 1 0;
        width: 0;
        min-width: 0;
        height: 40px;
        border: 1px solid #ddcde9;
        background: #fff;
        border-radius: 13px;
        overflow: visible;
        margin: 0;
        position: relative;
    }
    #storeHeader .mobile-inline-search > input {
        flex: 1 1 auto;
        width: 0;
        min-width: 0;
        padding: 0 10px;
        border: 0;
        border-radius: 13px 0 0 13px;
        color: #271935;
        background: transparent;
        font-size: 14px;
        outline: none;
    }
    #storeHeader .mobile-inline-search > button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        min-width: 40px;
        border-radius: 0 12px 12px 0;
        background: #e83c98;
        color: #fff;
        font-size: 18px;
        font-weight: 600;
    }
    #storeHeader .mobile-header-actions {
        margin-left: 0;
        flex: 0 0 auto;
        gap: 0;
    }
    #storeHeader .mobile-header-actions .theme-toggle {
        width: 38px;
        height: 38px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }
    #storeHeader .mobile-header-actions .theme-toggle > span:not(:first-child) {
        display: none !important;
    }
    #storeHeader .mobile-inline-search .search-autocomplete-popup {
        left: auto;
        right: -45px;
        width: min(calc(100vw - 20px), 440px);
        max-width: calc(100vw - 20px);
        z-index: 80;
    }
    #storeHeader .mobile-inline-search .search-result { min-width: 0; }
    #storeHeader .mobile-inline-search .search-result-body { min-width: 0; }
    html[data-theme="dark"] #storeHeader .mobile-inline-search {
        background: #2b223d;
        border-color: #645079;
    }
    html[data-theme="dark"] #storeHeader .mobile-inline-search > input {
        color: #f8f3ff;
    }
    html[data-theme="dark"] #storeHeader .mobile-inline-search > input::placeholder {
        color: #bdb1ce;
    }
}
@media (min-width: 768px) {
    #storeHeader .mobile-inline-search { display: none !important; }
}
@media (max-width: 359px) {
    #storeHeader > div:first-child { gap: 5px; padding-inline: 6px; }
    #storeHeader .mobile-header-hamburger { width: 34px; min-width: 34px; }
    #storeHeader .mobile-header-brand .store-logo-ring { width: 34px; height: 34px; min-width: 34px; }
    #storeHeader .mobile-header-actions .theme-toggle { width: 34px; height: 34px; }
    #storeHeader .mobile-inline-search > button { width: 35px; min-width: 35px; }
}
/* La opción Devoluciones queda visible al desplegar Gestión en teléfonos. */
.admin-mobile-drawer-links .admin-menu-item-arrow { margin-left: auto; opacity: .6; }

/* Inicio de sesión con Google/Facebook: adaptable a ambos temas. */
.social-login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    border: 1px solid #d9d3e5;
    border-radius: 12px;
    background: #fff;
    color: #17132a;
    font-weight: 700;
    transition: border-color .15s, box-shadow .15s;
}
.social-login-button:hover,
.social-login-button:focus-visible {
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(167,139,250,.14);
}
.social-facebook-logo {
    display: inline-grid;
    place-items: center;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: #1877f2;
    color: #fff;
    font-family: Arial, sans-serif;
    font-weight: 800;
    font-size: 19px;
}
html[data-theme="dark"] .social-login-button {
    background: #2c223d;
    color: #f8f5ff;
    border-color: #635576;
}

/* V15 · Claridad y accesibilidad comercial */
.product-card [data-add-card]{display:flex;align-items:center;justify-content:center;gap:.5rem;min-height:44px;white-space:nowrap}
.product-card [data-add-card] i{font-size:1.05rem}
.category-showcase-card{overflow:hidden;position:relative;min-height:178px;display:flex;flex-direction:column;align-items:center;justify-content:center;border:1px solid var(--line,#e6dff2)}
.category-showcase-card:hover,.category-showcase-card:focus-visible{border-color:#a78bfa;transform:translateY(-3px);box-shadow:0 14px 28px rgba(82,40,146,.12)}
.category-showcase-icon{display:inline-flex;align-items:center;justify-content:center;width:76px;height:76px;border-radius:22px;background:linear-gradient(140deg,#ede5ff,#faf5ff);color:#6337c8;font-size:2.2rem}
.category-card-action{font-size:11px;color:#6d3ee5;margin-top:10px;font-weight:700}
.offer-mini-card{position:relative;min-width:0;background:#fff;color:#1e1635;border-radius:17px;padding:12px;display:flex;align-items:center;gap:10px;min-height:100px}
.offer-mini-card img{width:65px;height:70px;object-fit:contain;border-radius:9px;flex-shrink:0}
.offer-mini-title{font-size:12px;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.offer-mini-discount{position:absolute;right:8px;top:8px;background:#5f32d2;color:white;font-size:10px;border-radius:8px;padding:3px 5px}
.offer-mini-icon{font-size:27px;color:#6d3ee5}
[data-theme=dark] .category-showcase-icon{background:#302445;color:#b89aff}
[data-theme=dark] .category-card-action{color:#bea6ff}
@media(max-width:639px){.offer-mini-card{flex-direction:column;align-items:flex-start}.offer-mini-card img{width:100%;height:95px}.offer-mini-discount{top:4px;right:4px}.category-showcase-card{min-height:150px}}

.footer-install-button{display:inline-flex;align-items:center;gap:10px;padding:11px 16px;border:1px solid #a78bfa;border-radius:999px;color:inherit;font-size:13px;font-weight:700;cursor:pointer}
.footer-install-button:hover,.footer-install-button:focus-visible{background:rgba(167,139,250,.16);outline-offset:2px}
.footer-install-button i{font-size:18px}


/* V16: más espacio de trabajo solo para Gestión; sin modificar el catálogo público. */
body:has(.admin-nav) .page-wrap,
body:has(.admin-mobile-toolbar) .page-wrap,
body[data-page^="coupon_"] .page-wrap,
body[data-page="coupons_manage"] .page-wrap {
    max-width: 1680px;
    width: 100%;
    padding-inline: clamp(16px, 3vw, 56px);
}
@media (min-width: 1024px) {
    body:has(.admin-nav) .page-wrap,
    body:has(.admin-mobile-toolbar) .page-wrap { padding-top: 38px; }
    body:has(.admin-nav) .data-table th,
    body:has(.admin-nav) .data-table td { padding: 15px 18px; font-size: 14px; }
    body:has(.admin-nav) .data-table { min-width: 880px; }
    body:has(.admin-nav) .panel > form[method="get"],
    body:has(.admin-nav) form.panel[method="get"] { column-gap: 20px; row-gap: 14px; }
}
.admin-page-heading { display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:24px; }
.admin-muted { color:var(--admin-muted,#64748b); }
.admin-back-link {display:inline-flex;align-items:center;gap:8px;color:var(--primary);font-weight:700;font-size:14px;}
.admin-heading-icon {display:grid;place-items:center;min-width:56px;height:56px;border-radius:17px;background:#f2ebff;color:#6d3ee5;font-size:27px;}
.admin-editor-grid {display:grid;grid-template-columns:minmax(300px,4fr) minmax(460px,6fr);gap:22px;align-items:start;}
.admin-form-section {padding:clamp(20px,2.2vw,34px);min-width:0;}
.admin-section-title {font-size:18px;font-weight:800;display:flex;gap:10px;align-items:center;margin-bottom:22px;}
.admin-section-title i {color:#7551d5;}
.admin-form-fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;}
.admin-field {min-width:0;}
.admin-field-wide {grid-column:1/-1;}
.admin-field input:not([type="checkbox"]),.admin-field select {width:100%;}
.admin-field input[type="checkbox"]{height:19px;width:19px;}
.admin-editor-actions {grid-column:1/-1;display:flex;justify-content:flex-end;align-items:center;gap:12px;}
.admin-entity-picker {border:1px solid #e5dff0;border-radius:16px;padding:17px;margin-top:17px;min-width:0;}
.admin-picker-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;}
.admin-picker-counter {font-size:11px;font-weight:700;color:#7053ab;background:#f3edff;padding:5px 9px;border-radius:999px;white-space:nowrap;}
.admin-picker-search {position:relative;}
.admin-picker-search > i {position:absolute;left:15px;top:50%;transform:translateY(-50%);color:#827390;}
.admin-picker-search input {padding-left:42px;}
.admin-picker-results {max-height:224px;min-height:66px;overflow:auto;margin-top:10px;border:1px solid #eee9f5;border-radius:12px;}
.admin-option-row {display:flex;align-items:center;gap:12px;padding:11px 13px;cursor:pointer;border-bottom:1px solid #eee9f5;}
.admin-option-row:last-child {border-bottom:0;}
.admin-option-row:hover {background:#f8f5ff;}
.admin-option-row input {width:18px;height:18px;accent-color:#6d3ee5;flex-shrink:0;}
.admin-option-description {min-width:0;display:grid;gap:3px;}
.admin-option-description strong {font-size:13px;font-weight:700;overflow-wrap:anywhere;}
.admin-option-description small {font-size:12px;color:#64748b;overflow-wrap:anywhere;}
.admin-picked {display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;}
.admin-selected-chip {display:inline-flex;align-items:center;gap:8px;padding:6px 9px;border-radius:10px;background:#eee5ff;color:#4c1d95;font-size:12px;font-weight:700;max-width:100%;}
.admin-selected-chip button {font-size:18px;line-height:1;min-width:20px;}
.admin-picker-more {margin-top:10px;color:var(--primary);font-size:13px;font-weight:800;}
.admin-picker-error {padding:14px;font-size:13px;color:#be123c;}
html[data-theme="dark"] {--admin-muted:#b6abc7;}
html[data-theme="dark"] .admin-entity-picker,
html[data-theme="dark"] .admin-picker-results {border-color:#574668;}
html[data-theme="dark"] .admin-option-row {border-color:#453751;color:#eee7fa;}
html[data-theme="dark"] .admin-option-row:hover {background:#372744;}
html[data-theme="dark"] .admin-option-description small {color:#b6abc7;}
html[data-theme="dark"] .admin-picked .admin-selected-chip {background:#493466;color:#f8efff;}
html[data-theme="dark"] .admin-heading-icon,
html[data-theme="dark"] .admin-picker-counter {background:#493466;color:#eee0ff;}
@media (max-width:1100px) { .admin-editor-grid {grid-template-columns:1fr;} }
@media (max-width:640px) {
    .admin-form-fields {grid-template-columns:1fr;}
    .admin-page-heading {align-items:flex-start;}
    .admin-heading-icon {min-width:44px;height:44px;font-size:22px;}
    .admin-form-section {padding:18px;}
    .admin-editor-actions {justify-content:stretch;flex-direction:column-reverse;}
    .admin-editor-actions > * {width:100%;}
}

.admin-option-image {width:43px;height:43px;object-fit:contain;background:#faf8ff;border-radius:9px;flex-shrink:0;border:1px solid #eee9f5;}
html[data-theme="dark"] .admin-option-image {background:#322941;border-color:#574668;}


/* V17: controles de acciones y señales operativas en toda Gestión. */
.admin-table-action {display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;padding:7px 11px;border-radius:9px;border:1px solid #dcd1ef;background:#f7f3ff;color:#5834a9!important;font-size:12px;font-weight:800;line-height:1.25;text-decoration:none!important;white-space:nowrap;transition:background .15s,border-color .15s;cursor:pointer;}
.admin-table-action:hover,.admin-table-action:focus-visible{background:#e9ddff;border-color:#8c67cf;outline-offset:2px;}
.admin-table-action-primary{background:#6d3ee5;color:#fff!important;border-color:#6d3ee5;}
.admin-table-action-primary:hover{background:#5128bd;color:#fff!important;}
.admin-table-action-warning{background:#fff7e8;color:#956000!important;border-color:#f0d4a0;}
.admin-table-action-danger{background:#fff1f2;color:#a31535!important;border-color:#f3bbc7;}
.admin-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-width:max-content;}
.admin-actions form{display:inline-flex;align-items:center;gap:6px;}
.admin-actions select{min-height:34px;max-width:150px;}
.admin-status{display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:999px;font-weight:800;font-size:11px;white-space:nowrap;border:1px solid transparent;}
.admin-status-vencida,.admin-status-danger{background:#fee2e2;color:#991b1b;border-color:#fecaca;}
.admin-status-proxima,.admin-status-warning{background:#fff1c7;color:#854d0e;border-color:#fde68a;}
.admin-status-pagada,.admin-status-success{background:#d1fae5;color:#065f46;border-color:#a7f3d0;}
.admin-status-vigente,.admin-status-neutral{background:#edf1f7;color:#475569;border-color:#dbe3ee;}
.admin-row-vencida{box-shadow:inset 4px 0 0 #ef4444;}
.admin-row-proxima{box-shadow:inset 4px 0 0 #d97706;}
.admin-invoice-image{width:58px;height:58px;object-fit:contain;border-radius:10px;border:1px solid #e7e0f0;background:#fff;flex-shrink:0;}
.admin-invoice-placeholder{display:grid;place-items:center;color:#9a8bad;font-size:23px;}
.admin-invoice-totals{width:100%;max-width:440px;margin-left:auto;display:grid;gap:8px;font-size:13px;}
.admin-invoice-totals>div{display:flex;align-items:center;justify-content:space-between;gap:18px;}
.admin-invoice-total{padding:12px 0;border-top:1px solid #dcd1ef;border-bottom:1px solid #dcd1ef;font-size:17px;font-weight:800;}
.admin-indicator{padding:16px 18px;border:1px solid;border-radius:14px;display:grid;gap:8px;}
.admin-indicator span{font-size:12px;font-weight:700;}
.admin-indicator strong{font-size:27px;font-weight:900;}
.admin-indicator-danger{background:#fff1f2;color:#991b1b;border-color:#fecdd3;}
.admin-indicator-warning{background:#fffbeb;color:#854d0e;border-color:#fcd34d;}
.admin-indicator-success{background:#ecfdf5;color:#065f46;border-color:#a7f3d0;}
.admin-indicator-neutral{background:#f1f5f9;color:#334155;border-color:#e2e8f0;}
html[data-theme="dark"] .admin-table-action{background:#352a49;color:#e6d5ff!important;border-color:#675185;}
html[data-theme="dark"] .admin-table-action-primary{background:#8054e8;color:white!important;border-color:#9a72ff;}
html[data-theme="dark"] .admin-table-action-warning{background:#473515;color:#ffe3a2!important;border-color:#8d692b;}
html[data-theme="dark"] .admin-table-action-danger{background:#482333;color:#ffc2ce!important;border-color:#814056;}
html[data-theme="dark"] .admin-status-vencida,html[data-theme="dark"] .admin-status-danger,html[data-theme="dark"] .admin-indicator-danger{background:#4a1c2a;color:#ffc4cc;border-color:#913d52;}
html[data-theme="dark"] .admin-status-proxima,html[data-theme="dark"] .admin-status-warning,html[data-theme="dark"] .admin-indicator-warning{background:#493517;color:#ffe1a3;border-color:#89682c;}
html[data-theme="dark"] .admin-status-pagada,html[data-theme="dark"] .admin-status-success,html[data-theme="dark"] .admin-indicator-success{background:#123e36;color:#a7f3d0;border-color:#2d7664;}
html[data-theme="dark"] .admin-status-vigente,html[data-theme="dark"] .admin-status-neutral,html[data-theme="dark"] .admin-indicator-neutral{background:#322a44;color:#e3d8f3;border-color:#5f5274;}
html[data-theme="dark"] .admin-invoice-total{border-color:#655679;}
@media(max-width:640px){.admin-invoice-table{min-width:680px;}.admin-actions{min-width:0;}}


/* Nova V18: tarjetas elevadas y acciones compactas accesibles en ambos temas. */
.product-card-raised {
    box-shadow: 0 9px 26px rgba(32, 17, 68, .13), 0 2px 7px rgba(32, 17, 68, .06);
    border-color: rgba(120, 83, 178, .20);
}
.product-card-raised:hover,
.product-card-raised:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 18px 42px rgba(45, 22, 92, .20);
}
.card-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: .5rem;
}
.card-actions > * {
    min-width: 0;
    min-height: 43px;
    padding: .55rem .6rem;
    text-align: center;
    line-height: 1.2;
}
.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: 1px solid #12814c;
    border-radius: 12px;
    font-weight: 700;
    background: #ecfdf3;
    color: #086d3a;
    text-decoration: none;
}
.btn-whatsapp:hover,
.btn-whatsapp:focus-visible {
    background: #dbfce8;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, .18);
}
.share-whatsapp {
    background: #e9fbf0;
    color: #08723f;
    border-color: #5fcf95;
}
html[data-theme="dark"] .product-card-raised {
    box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
    border-color: #55466d;
}
html[data-theme="dark"] .btn-whatsapp,
html[data-theme="dark"] .share-whatsapp {
    background: #124934;
    color: #e4ffee;
    border-color: #49ae7b;
}
html[data-theme="dark"] .btn-whatsapp:hover {
    background: #176442;
}
/* Tarjetas en móvil: dos iconos accesibles en una sola fila. */
@media (max-width: 639px) {
    .card-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem;
    }
    .card-actions .card-action-label {
        display: none;
    }
    .card-actions > * {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: .65rem .4rem;
        min-height: 44px;
        font-size: 1.2rem;
    }
    .card-actions > * > .bi {
        font-size: 1.25rem;
        line-height: 1;
    }
}

/* V19: tarjetas móviles compactas, sin sacrificar acciones ni galería. */
@media (max-width: 639px) {
    .product-card {
        border-radius: 13px;
        min-width: 0;
    }
    .product-card .product-image {
        width: 100%;
        height: clamp(112px, 36vw, 152px);
        object-fit: contain;
    }
    .product-card [data-card-photo] {
        height: clamp(112px, 36vw, 152px);
    }
    .product-card .card-gallery {
        min-height: 34px;
        gap: 4px;
        padding: 4px 7px;
    }
    .product-card .card-thumb {
        width: 26px;
        height: 26px;
        border-radius: 6px;
    }
    .product-card > div.p-4 {
        padding: 9px 10px 10px;
    }
    .product-card > div.p-4 > a {
        font-size: 12px;
        line-height: 1.3;
        margin-top: 4px;
        min-height: 31px;
    }
    .product-card > div.p-4 > span {
        font-size: 9px;
        letter-spacing: .04em;
    }
    .product-card > div.p-4 > p {
        font-size: 10px;
        margin-top: 3px;
    }
    .product-card > div.p-4 > div.mt-auto {
        padding-top: 7px;
    }
    .product-card > div.p-4 > div.mt-auto p.text-xl {
        font-size: clamp(12px, 3.9vw, 17px);
        line-height: 1.25;
    }
    .product-card .sale-badge {
        font-size: 9px;
        padding: 3px 6px;
    }
    .product-card .card-actions {
        margin-top: 8px;
        gap: 6px;
    }
    .product-card .card-actions > * {
        min-height: 35px;
        padding: 6px;
        border-radius: 8px;
    }
    .product-card .card-actions > * > .bi {
        font-size: 1.1rem;
    }
    #catalogCards,
    .store-product-grid {
        gap: 10px;
    }
}
