/* ═══════════════════════════════════════════════════════
   Ecommerce Multi-Tenant — Storefront CSS
   Dark theme, design portado de Tienda Top
   Colores dinámicos vía --cp/--cs/--ca alimentados desde store_config
   ═══════════════════════════════════════════════════════ */

:root {
    /* Brand colors — overridden per-store via storeCssVars() */
    --cp:      #DA702D;
    --cs:      #1D1D1B;
    --ca:      #E49558;

    /* Derived shades */
    --cp-d:    color-mix(in srgb, var(--cp) 85%, #000 15%);
    --cp-l:    color-mix(in srgb, var(--cp) 10%, var(--surface));

    /* Dark theme base */
    --font:    var(--font-heading, 'Poppins'), system-ui, sans-serif;
    --bg:      #141412;
    --text:    #F0EFed;
    --muted:   #7A7A76;
    --border:  #2C2C2A;
    --surface: #1E1E1C;
    --radius:  10px;
}

* { box-sizing: border-box; margin: 0; }
body { font-family: var(--font); color: var(--text); background: var(--bg); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* ─── ANNOUNCEMENT BAR ─── */
.announcement-bar {
    background: var(--cp);
    color: #fff;
    text-align: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .2px;
}

/* ─── TOPBAR ─── */
.topbar {
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0;
    background: rgba(20,20,18,.97);
    backdrop-filter: blur(12px);
    z-index: 100;
}
.topbar-inner {
    max-width: 1280px; margin: 0 auto;
    padding: 10px 24px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo-img { height: 44px; width: auto; }
.logo-text {
    font-family: var(--font);
    font-size: 19px; font-weight: 800;
    color: var(--text); letter-spacing: -.3px;
}
.nav-main { display: flex; gap: 22px; }
.nav-main a {
    font-size: 13.5px; font-weight: 500;
    color: var(--muted); transition: color .15s;
}
.nav-main a:hover { color: var(--cp); }
.nav-actions { display: flex; gap: 10px; align-items: center; }

/* ─── NAV SEARCH ─── */
.search-wrap { position: relative; }
.nav-search {
    border: 1.5px solid var(--border); border-radius: 8px;
    padding: 7px 12px 7px 34px;
    font-size: 13px; font-family: var(--font);
    width: 200px;
    background: var(--surface); color: var(--text);
    transition: border-color .2s, width .2s, box-shadow .2s;
}
.nav-search:focus {
    outline: none;
    border-color: var(--cp);
    width: 240px;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cp) 15%, transparent);
}
.nav-search::placeholder { color: var(--muted); font-size: 12.5px; }
.nav-search-icon {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: var(--muted); font-size: 14px; pointer-events: none;
}
.nav-icon {
    font-size: 20px; color: var(--muted);
    position: relative;
    transition: color .15s;
    padding: 4px;
}
.nav-icon:hover { color: var(--cp); }
.cart-badge {
    position: absolute; top: -4px; right: -4px;
    background: var(--cp); color: #fff;
    font-size: 10px; font-weight: 700;
    width: 17px; height: 17px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* ─── HERO BANNER (con imagen / store_banners) ─── */
.hero-section { position: relative; overflow: hidden; }
.hero-slide {
    position: relative;
    min-height: 380px;
    display: flex; align-items: center; justify-content: center;
    background-size: cover; background-position: center;
}
.hero-slide::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(120deg, rgba(29,29,27,.7), rgba(29,29,27,.2));
}
.hero-content {
    position: relative; z-index: 1;
    text-align: center; color: #fff;
    padding: 40px 24px;
}
.hero-content h1 { font-size: 38px; font-weight: 800; margin-bottom: 10px; }
.hero-content p { font-size: 17px; opacity: .9; margin-bottom: 24px; }
.hero-cta {
    display: inline-block;
    background: var(--cp); color: #fff;
    padding: 13px 32px; border-radius: var(--radius);
    font-weight: 700; font-size: 15px;
    transition: background .15s, transform .15s;
}
.hero-cta:hover { background: var(--cp-d); transform: translateY(-1px); color: #fff; }

/* ─── HERO CAROUSEL (multiple banners) ─── */
.hero-carousel { width: 100%; }
.hero-carousel .hero-slide {
    min-height: 340px;
    background: var(--cs);
}
.hero-carousel .hero-content { max-width: 640px; }
.hero-carousel .hero-content h1 {
    font-size: 32px; font-weight: 800;
    letter-spacing: -.3px;
}
.hero-carousel .hero-content p { font-size: 16px; opacity: .8; margin-bottom: 22px; }
.hero-carousel .carousel-indicators button {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(255,255,255,.4); border: none;
}
.hero-carousel .carousel-indicators .active { background: var(--cp); }
.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next { width: 48px; opacity: .5; }
.hero-carousel .carousel-control-prev:hover,
.hero-carousel .carousel-control-next:hover { opacity: .9; }

/* ─── No banner fallback ─── */
.hero-placeholder {
    background: linear-gradient(135deg, var(--cp), color-mix(in srgb, var(--cp) 60%, #000));
    min-height: 280px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; text-align: center; padding: 60px 24px;
}
.hero-placeholder h1 { font-family: var(--font); font-size: 38px; font-weight: 800; }
.hero-placeholder p { font-size: 16px; opacity: .85; margin-top: 8px; }

/* ─── CATALOG LAYOUT: SIDEBAR + GRID ─── */
.catalog-layout {
    max-width: 1280px; margin: 0 auto;
    padding: 24px 24px 48px;
    display: grid; grid-template-columns: 220px 1fr;
    gap: 24px; align-items: start;
}

/* ─── SIDEBAR ─── */
.catalog-sidebar { position: sticky; top: 72px; }
.sidebar-section { margin-bottom: 20px; }
.sidebar-title {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .9px;
    color: var(--muted);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.cat-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.cat-item {
    width: 100%;
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 10px; border-radius: 8px;
    border: none; background: transparent;
    font-size: 13px; font-weight: 500; font-family: var(--font);
    color: var(--text); cursor: pointer;
    transition: all .15s;
    text-align: left;
}
.cat-item:hover { background: var(--surface); color: var(--cp); }
.cat-item.active { background: var(--cp-l); color: var(--cp); font-weight: 700; }
.cat-count {
    font-size: 11px; font-weight: 600;
    color: var(--muted); background: var(--surface);
    padding: 1px 7px; border-radius: 10px;
    min-width: 24px; text-align: center;
}
.cat-item.active .cat-count {
    background: color-mix(in srgb, var(--cp) 15%, transparent);
    color: var(--cp);
}
.sidebar-select {
    width: 100%;
    padding: 7px 10px;
    border: 1.5px solid var(--border); border-radius: 8px;
    font-size: 13px; font-family: var(--font);
    color: var(--text); background: var(--surface);
    cursor: pointer; outline: none;
}
.sidebar-select:focus { border-color: var(--cp); }

/* ─── CATALOG TOOLBAR ─── */
.catalog-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap; gap: 10px;
}
.toolbar-left h2 { font-size: 18px; font-weight: 700; letter-spacing: -.2px; }
.toolbar-count { font-size: 13px; color: var(--muted); margin-left: 8px; }
.search-inline-wrap { position: relative; display: flex; align-items: center; }
.search-inline-wrap i {
    position: absolute; left: 10px;
    color: var(--muted); font-size: 13px;
    pointer-events: none;
}
.search-inline {
    padding: 7px 12px 7px 30px;
    border: 1.5px solid var(--border); border-radius: 8px;
    font-size: 13px; font-family: var(--font);
    color: var(--text); background: var(--surface);
    width: 200px; outline: none;
    transition: border-color .15s, width .2s;
}
.search-inline::placeholder { color: var(--muted); }
.search-inline:focus { border-color: var(--cp); width: 240px; }

/* ─── PRODUCT GRID ─── */
.product-grid {
    max-width: 1280px; margin: 0 auto;
    padding: 0 24px 48px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
}
.catalog-main .product-grid {
    max-width: none; margin: 0;
    padding-left: 0; padding-right: 0;
}

/* ─── PRODUCT CARD ─── */
.product-card {
    border: 1.5px solid var(--border); border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    background: var(--surface);
    display: flex; flex-direction: column;
}
.product-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.35);
    transform: translateY(-2px);
}
.product-card .img-wrap {
    aspect-ratio: 1; overflow: hidden;
    background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    position: relative; cursor: pointer;
}
.product-card .img-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .35s;
}
.product-card:hover .img-wrap img { transform: scale(1.04); }
.product-card .img-wrap .no-img { color: var(--muted); font-size: 44px; opacity: .4; }

.img-skeleton {
    width: 100%; height: 100%;
    background: linear-gradient(90deg, var(--surface) 25%, color-mix(in srgb, var(--surface) 70%, var(--text) 10%) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.out-of-stock-badge {
    position: absolute; top: 8px; left: 8px;
    background: rgba(29,29,27,.85); color: #fff;
    font-size: 10px; font-weight: 700;
    padding: 3px 8px; border-radius: 5px;
}
.product-card .info {
    padding: 10px 12px; flex: 1;
    display: flex; flex-direction: column; gap: 3px;
}
.product-card .info .name {
    font-size: 13px; font-weight: 600; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    cursor: pointer;
}
.product-card .info .name:hover { color: var(--cp); }
.product-card .info .price-row {
    display: flex; align-items: baseline; gap: 6px; margin-top: 4px;
}
.product-card .info .price { font-size: 16px; font-weight: 800; color: var(--cp); }
.product-card .info .compare { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.badge-ahorra {
    display: inline-block;
    background: var(--cp); color: #fff;
    font-size: 10px; font-weight: 700;
    padding: 2px 7px; border-radius: 4px;
    letter-spacing: .2px;
}
.product-card .btn-add {
    width: 100%; padding: 10px; border: none;
    background: var(--cp); color: #fff;
    font-size: 13px; font-weight: 700; font-family: var(--font);
    cursor: pointer;
    transition: background .15s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    letter-spacing: .1px;
}
.product-card .btn-add:hover { background: var(--cp-d); }
.product-card .btn-add:disabled { opacity: .45; cursor: not-allowed; }

/* ─── EMPTY STATE ─── */
.empty-state { text-align: center; padding: 72px 24px; color: var(--muted); }
.empty-state i { font-size: 44px; opacity: .2; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 15px; font-weight: 500; }

/* ─── SPINNER ─── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin .7s linear infinite; }

/* ─── CART TOAST ─── */
#cartToast {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--cs); color: #fff;
    padding: 12px 18px; border-radius: var(--radius);
    font-size: 13px; font-weight: 600; font-family: var(--font);
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
    display: none; align-items: center; gap: 10px;
    min-width: 220px;
    border-left: 3px solid var(--cp);
}
#cartToast.show { display: flex; animation: slideUp .22s ease; }
#cartToast .toast-go { color: var(--cp); font-weight: 700; cursor: pointer; margin-left: 2px; }
#cartToast .toast-close { margin-left: auto; cursor: pointer; opacity: .5; font-size: 16px; line-height: 1; }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ─── PRODUCT DETAIL PAGE ─── */
.product-page {
    max-width: 1280px; margin: 40px auto; padding: 0 24px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
}
.product-gallery img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.product-gallery-main { aspect-ratio: 1; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.product-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.product-gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.product-gallery-thumbs img {
    width: 64px; height: 64px; object-fit: cover; border-radius: 8px;
    border: 2px solid transparent; cursor: pointer;
    transition: border-color .15s;
}
.product-gallery-thumbs img:hover,
.product-gallery-thumbs img.active { border-color: var(--cp); }
.product-info h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; letter-spacing: -.3px; }
.product-info .category-tag { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.product-info .price-row { display: flex; align-items: baseline; gap: 12px; margin: 14px 0; }
.product-info .price { font-size: 28px; font-weight: 800; color: var(--cp); }
.product-info .compare { font-size: 16px; color: var(--muted); text-decoration: line-through; }
.product-info .desc { font-size: 14px; color: var(--muted); line-height: 1.7; margin-bottom: 24px; }
.product-info .stock-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 6px; margin-bottom: 16px; }
.product-info .stock-tag.in { background: rgba(34,197,94,.12); color: #4ade80; }
.product-info .stock-tag.low { background: rgba(234,179,8,.12); color: #eab308; }
.product-info .stock-tag.out { background: rgba(239,68,68,.12); color: #f87171; }
.qty-control {
    display: inline-flex; align-items: center;
    border: 1.5px solid var(--border); border-radius: 10px;
    overflow: hidden; margin-right: 12px;
}
.qty-control button {
    width: 38px; height: 44px;
    background: var(--surface); color: var(--text);
    border: none; font-size: 18px; cursor: pointer;
    transition: color .15s;
}
.qty-control button:hover { color: var(--cp); }
.qty-control span { width: 40px; text-align: center; font-weight: 700; }
.btn-primary-tt {
    background: var(--cp); color: #fff; border: none;
    padding: 14px 32px; border-radius: var(--radius);
    font-size: 15px; font-weight: 700; font-family: var(--font);
    cursor: pointer; transition: background .15s, transform .15s;
    display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary-tt:hover { background: var(--cp-d); transform: translateY(-1px); }
.btn-primary-tt:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-add-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ─── QUICK VIEW MODAL ─── */
#qvOverlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.65); z-index: 1100;
    backdrop-filter: blur(4px);
}
#qvOverlay.open { display: block; }
#qvModal {
    display: none; position: fixed;
    top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: min(860px, 95vw); max-height: 90vh;
    background: var(--bg); border: 1px solid var(--border); border-radius: 16px;
    z-index: 1101; overflow-y: auto;
}
#qvModal.open { display: block; }
.qv-close {
    position: absolute; top: 14px; right: 14px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    color: var(--muted); font-size: 14px; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: color .15s; z-index: 2;
}
.qv-close:hover { color: var(--text); }
.qv-inner { display: grid; grid-template-columns: 1fr 1fr; min-height: 380px; }
@media(max-width:640px) { .qv-inner { grid-template-columns: 1fr; } }
.qv-gallery { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.qv-main-wrap { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface); }
.qv-main-wrap img { width: 100%; height: 100%; object-fit: cover; }
.qv-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.qv-thumb { width: 58px; height: 58px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; transition: border-color .15s; }
.qv-thumb.active, .qv-thumb:hover { border-color: var(--cp); }
.qv-info { padding: 28px 24px 28px 8px; display: flex; flex-direction: column; gap: 12px; }
.qv-category { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.qv-name { font-size: 20px; font-weight: 700; line-height: 1.2; color: var(--text); }
.qv-price-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qv-price { font-size: 22px; font-weight: 800; color: var(--cp); }
.qv-compare { font-size: 14px; color: var(--muted); text-decoration: line-through; }
.qv-save { font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--cp) 15%, transparent); color: var(--cp); padding: 2px 8px; border-radius: 20px; }
.qv-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }
.qv-qty-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.qv-qty-ctrl { display: flex; align-items: center; background: var(--surface); border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; }
.qv-qty-ctrl button { background: none; border: none; color: var(--text); font-size: 18px; width: 38px; height: 42px; cursor: pointer; transition: color .15s; }
.qv-qty-ctrl button:hover { color: var(--cp); }
.qv-qty-ctrl span { min-width: 32px; text-align: center; font-size: 15px; font-weight: 700; }
.qv-btn-add {
    flex: 1; padding: 12px; border: none; border-radius: 10px;
    background: var(--cp); color: #fff; font-size: 14px; font-weight: 700;
    font-family: var(--font); cursor: pointer; transition: background .15s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.qv-btn-add:hover { background: var(--cp-d); }
.qv-btn-add:disabled { opacity: .4; cursor: not-allowed; }
.qv-fulllink { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; margin-top: auto; transition: color .15s; }
.qv-fulllink:hover { color: var(--cp); }

/* ═══════════════════════════════════════════════════════
   CART DRAWER (right-side slide)
   ═══════════════════════════════════════════════════════ */
#cartOverlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 1200;
    opacity: 0; pointer-events: none;
    transition: opacity .25s;
}
#cartOverlay.open { opacity: 1; pointer-events: all; }

#cartDrawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 420px; max-width: 100vw;
    background: var(--surface); border-left: 1px solid var(--border);
    z-index: 1201;
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
}
#cartDrawer.open { transform: translateX(0); }

.cdrawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.cdrawer-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.cdrawer-title i { color: var(--cp); font-size: 18px; }
.cdrawer-count {
    background: var(--cp); color: #fff;
    font-size: 11px; font-weight: 700;
    padding: 1px 7px; border-radius: 10px;
}
.cdrawer-close {
    border: none; background: var(--bg); color: var(--muted);
    width: 32px; height: 32px; border-radius: 8px;
    cursor: pointer; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: color .15s, background .15s;
}
.cdrawer-close:hover { color: var(--text); background: var(--border); }

.cdrawer-ship-bar { padding: 12px 20px; background: var(--bg); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.ship-bar-text { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.ship-bar-text strong { color: var(--text); }
.ship-bar-track { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.ship-bar-fill { height: 100%; background: var(--cp); border-radius: 2px; transition: width .4s ease; }

.cdrawer-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.cdrawer-loading { display: flex; align-items: center; justify-content: center; padding: 60px 24px; color: var(--muted); font-size: 24px; }
.cdrawer-empty { text-align: center; padding: 60px 24px; color: var(--muted); }
.cdrawer-empty i { font-size: 48px; opacity: .2; display: block; margin-bottom: 12px; }
.cdrawer-empty p { font-size: 15px; font-weight: 500; margin-bottom: 16px; }
.cdrawer-empty a { color: var(--cp); font-weight: 600; font-size: 14px; }

.cdrawer-item {
    display: grid; grid-template-columns: 80px 1fr auto;
    gap: 12px; padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: opacity .2s;
}
.cdrawer-item.removing { opacity: .4; pointer-events: none; }
.cdrawer-img { display: block; flex-shrink: 0; }
.cdrawer-img img {
    width: 80px; height: 80px; object-fit: cover;
    border-radius: 8px; border: 1px solid var(--border);
}
.cdrawer-img-placeholder {
    width: 80px; height: 80px;
    background: var(--bg); border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted); font-size: 22px;
    border: 1px solid var(--border);
}
.cdrawer-item-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cdrawer-item-name {
    font-size: 13px; font-weight: 600; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    color: var(--text);
}
.cdrawer-item-name:hover { color: var(--cp); }
.cdrawer-item-variant { font-size: 11px; color: var(--muted); }
.cdrawer-item-price { font-size: 15px; font-weight: 800; color: var(--cp); margin-top: 4px; }
.cdrawer-item-unit { font-size: 11px; color: var(--muted); }

.cdrawer-item-controls { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; }
.cdrawer-remove { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 4px; border-radius: 4px; transition: color .15s; }
.cdrawer-remove:hover { color: #e53e3e; }
.cdrawer-qty { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden; }
.cdrawer-qty button {
    width: 28px; height: 28px; border: none;
    background: var(--bg); color: var(--text);
    font-size: 14px; font-weight: 700;
    cursor: pointer; font-family: var(--font);
    transition: background .15s, color .15s;
}
.cdrawer-qty button:hover { background: var(--border); }
.cdrawer-qty button:disabled { opacity: .35; cursor: not-allowed; }
.cdrawer-qty button.danger:hover { color: #e53e3e; }
.cdrawer-qty span {
    width: 32px; text-align: center;
    font-size: 13px; font-weight: 700;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    padding: 4px 0;
}

.cdrawer-footer {
    flex-direction: column; gap: 10px;
    padding: 16px 20px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
}
.cdrawer-subtotal { display: flex; justify-content: space-between; align-items: center; font-size: 18px; font-weight: 800; }
.cdrawer-shipping-note { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cdrawer-shipping-note i { color: var(--cp); }
.cdrawer-btn-checkout {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 15px;
    background: var(--cp); color: #fff;
    border: none; border-radius: var(--radius);
    font-size: 15px; font-weight: 700; font-family: var(--font);
    cursor: pointer; transition: background .15s, transform .1s;
    text-decoration: none;
}
.cdrawer-btn-checkout:hover { background: var(--cp-d); transform: translateY(-1px); color: #fff; }
.cdrawer-btn-continue {
    width: 100%; padding: 10px;
    background: none; border: none;
    color: var(--muted); font-size: 13px; font-family: var(--font);
    cursor: pointer; transition: color .15s;
}
.cdrawer-btn-continue:hover { color: var(--text); }

/* ─── CART PAGE (fallback non-drawer) ─── */
.cart-page { max-width: 900px; margin: 40px auto; padding: 0 24px; }
.cart-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); }
.cart-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.cart-item .name { font-size: 14px; font-weight: 600; }
.cart-summary {
    background: var(--surface); border-radius: var(--radius);
    padding: 24px; margin-top: 24px;
    border: 1.5px solid var(--border);
}
.cart-total { font-size: 20px; font-weight: 800; color: var(--text); }

/* ─── CHECKOUT FORM ─── */
.checkout-page { max-width: 1100px; margin: 32px auto; padding: 0 24px; display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px; }
@media (max-width: 900px) { .checkout-page { grid-template-columns: 1fr; } }
.co-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; }
.co-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.co-field { margin-bottom: 12px; }
.co-field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.co-field input, .co-field select, .co-field textarea {
    width: 100%; padding: 10px 12px;
    border: 1.5px solid var(--border); border-radius: 8px;
    font-size: 14px; font-family: var(--font);
    background: var(--bg); color: var(--text);
    outline: none; transition: border-color .15s;
}
.co-field input:focus, .co-field select:focus, .co-field textarea:focus {
    border-color: var(--cp);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cp) 12%, transparent);
}
.co-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ─── POPUP ─── */
#sitePopupOverlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.65); z-index: 9000;
    align-items: center; justify-content: center;
}
#sitePopup {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px; max-width: 420px; width: 90%;
    padding: 32px; position: relative; text-align: center;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
    .catalog-layout { grid-template-columns: 1fr; }
    .catalog-sidebar {
        position: static;
        display: flex; gap: 16px; flex-wrap: wrap;
        align-items: flex-start;
    }
    .sidebar-section { margin-bottom: 0; }
    .cat-list { flex-direction: row; flex-wrap: wrap; gap: 6px; }
    .cat-item { width: auto; padding: 5px 12px; }
    .cat-count { display: none; }
}
@media (max-width: 768px) {
    .topbar-inner { padding: 8px 16px; gap: 8px; }
    .nav-main { display: none; }
    .nav-search { width: 130px; }
    .nav-search:focus { width: 150px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 12px 32px; }
    .product-page { grid-template-columns: 1fr; gap: 24px; }
    .footer-inner { gap: 32px; }
    .hero-content h1 { font-size: 28px; }
}
@media (max-width: 480px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0 8px 24px; }
    .product-card .info { padding: 8px 10px; }
    .product-card .info .price { font-size: 14px; }
    .product-card .btn-add { font-size: 12px; padding: 9px; }
    #cartDrawer { width: 100vw; }
}

/* ─── FOOTER ─── */
.site-footer { background: var(--cs); color: #888; padding: 48px 24px 0; margin-top: 64px; }
.footer-inner { max-width: 1280px; margin: 0 auto; display: flex; gap: 60px; flex-wrap: wrap; }
.footer-brand { flex: 1; min-width: 200px; }
.footer-logo {
    font-size: 17px; font-weight: 800; color: #fff;
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 10px;
}
.footer-logo img { height: 32px; width: auto; }
.footer-desc { font-size: 13px; line-height: 1.6; margin-bottom: 16px; max-width: 270px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a { font-size: 18px; color: #555; transition: color .15s; }
.footer-social a:hover { color: var(--cp); }
.footer-links { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-col { min-width: 120px; }
.footer-col h4 {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .9px;
    color: #aaa; margin-bottom: 12px;
}
.footer-col a { display: block; font-size: 13px; color: #666; margin-bottom: 8px; transition: color .15s; }
.footer-col a:hover { color: #ddd; }
.footer-bottom {
    max-width: 1280px; margin: 40px auto 0;
    padding: 16px 0; border-top: 1px solid #2a2a28;
    font-size: 12px; color: #444;
}

/* ═══════════════════════════════════════════════════════
   TEXTO SOBRE EL ACENTO (--on-accent)
   Calculado por luminancia en storeCssVars(): texto oscuro
   cuando el acento (--cp) es claro (oro/amarillo), blanco
   cuando es oscuro. Arregla "texto blanco sobre oro" en
   botones/badges sin importar el branding de la tienda.
   ═══════════════════════════════════════════════════════ */
.announcement-bar,
.cart-badge,
.hero-cta, .hero-cta:hover,
.hero-placeholder,
.badge-ahorra,
.product-card .btn-add, .product-card .btn-add:hover,
.cdrawer-count,
.cdrawer-btn-checkout, .cdrawer-btn-checkout:hover,
.qv-btn-add,
.btn-primary-tt, .btn-primary-tt:hover {
    color: var(--on-accent, #fff);
}
