/* ============================================================
   SELVADIGITAL — Design System
   ============================================================ */

:root {
    --primary:        #dc2626;
    --primary-light:  #ef4444;
    --primary-dark:   #b91c1c;
    --primary-bg:     #fff1f2;
    --accent:         #f97316;
    --success:        #16a34a;
    --success-bg:     #dcfce7;
    --warning:        #d97706;
    --warning-bg:     #fef3c7;
    --danger:         #dc2626;
    --danger-bg:      #fee2e2;
    --text:           #1e293b;
    --text-muted:     #64748b;
    --text-light:     #94a3b8;
    --border:         #e2e8f0;
    --surface:        #ffffff;
    --surface-2:      #f8fafc;
    --surface-3:      #f1f5f9;
    --shadow-sm:      0 1px 3px rgba(0,0,0,.08);
    --shadow:         0 4px 12px rgba(0,0,0,.1);
    --shadow-lg:      0 8px 24px rgba(0,0,0,.12);
    --radius:         10px;
    --radius-lg:      16px;
    --radius-sm:      6px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--surface-2);
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

/* ── HEADER ── */
.top-announcement-bar {
    height: 30px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: .8rem;
    font-weight: 600;
    padding: 0 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    padding: 0 20px 0 25px;
    height: 103px;
    display: flex;
    align-items: center;
    gap: 38px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 17px;
    font-weight: 700;
    font-size: 1.94rem;
    color: var(--primary);
    flex-shrink: 0;
    margin-left: 15px;
}

.header-logo img { height: 64px; width: auto; }

.header-logo-icon {
    width: 66px; height: 66px;
    background: var(--primary);
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 1.94rem;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.header-nav a {
    padding: 10px 23px;
    border-radius: 10px;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 1.46rem;
    transition: color .15s, background .15s;
}

.header-nav a:hover,
.header-nav a.active { color: var(--primary); background: var(--primary-bg); }

.header-search-wrap {
    position: relative;
    flex: 1;
    min-width: 100px;
}

.header-search-wrap i {
    position: absolute;
    left: 19px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.38rem;
    pointer-events: none;
}

.header-search-wrap input {
    width: 100%;
    height: 59px;
    padding: 0 19px 0 55px;
    border: 2.16px solid var(--border);
    border-radius: 10px;
    font-size: 1.4rem;
    font-family: inherit;
    background: var(--surface-2);
    color: var(--text);
    outline: none;
}

.header-search-wrap input:focus { border-color: var(--primary); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 19px;
    margin-left: auto;
}

.cart-btn {
    position: relative;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 13px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.46rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    text-decoration: none;
}

.cart-btn:hover { background: var(--primary-dark); color: #fff; }

.cart-badge {
    position: absolute;
    top: -10px; right: -10px;
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    width: 32px; height: 32px;
    font-size: 1.14rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    display: none;
}

.cart-badge.show { display: flex; }

.user-menu {
    position: relative;
}

.user-btn {
    background: var(--surface-3);
    border: 1.62px solid var(--border);
    border-radius: 10px;
    padding: 12px 23px;
    font-size: 1.43rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    display: flex; align-items: center; gap: 11px;
    transition: background .15s;
    text-decoration: none;
}

.user-btn:hover { background: var(--border); color: var(--text); }

/* ── LAYOUT ── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-wrapper {
    position: relative;
    min-height: calc(100vh - 103px);
    padding: 32px 0 60px;
}

/* ── HERO ── */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    padding: 48px 20px;
    text-align: center;
}

.hero h1 { font-size: 2rem; font-weight: 700; margin-bottom: 10px; }
.hero p { font-size: 1.05rem; opacity: .9; }

/* ── BARRA DE BÚSQUEDA TOP ── */
.search-bar-top {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 10px 20px;
}

.search-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar-inner i {
    position: absolute;
    left: 14px;
    color: var(--text-light);
    font-size: .85rem;
    pointer-events: none;
}

.search-bar-inner input {
    width: 100%;
    padding: 9px 16px 9px 38px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: .9rem;
    font-family: inherit;
    background: var(--surface-2);
    color: var(--text);
    outline: none;
    transition: border-color .2s;
}

.search-bar-inner input:focus {
    border-color: var(--primary);
    background: var(--surface);
}

/* ── MENÚ HAMBURGUESA CATEGORÍAS (en el header) ── */
.cat-menu-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.cat-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    color: var(--text);
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 1.87rem;
    font-family: inherit;
    transition: color .15s;
    flex-shrink: 0;
}

.cat-menu-btn:hover { color: var(--primary); }

.cat-menu-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 200px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease, opacity .25s;
    opacity: 0;
    z-index: 300;
}

.cat-menu-wrap.open .cat-menu-dropdown {
    max-height: 420px;
    opacity: 1;
}

.cat-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: .88rem;
    color: var(--text);
    cursor: pointer;
    transition: background .15s;
    border-bottom: 1px solid var(--border);
}

.cat-menu-item:last-child { border-bottom: none; }
.cat-menu-item:hover      { background: var(--primary-bg); color: var(--primary); }
.cat-menu-item.active     { background: var(--primary-bg); color: var(--primary); font-weight: 600; }

/* ── SECTION TITLE ── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

/* ── PRODUCT GRID ── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}

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

.product-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: var(--surface-3);
    padding: 16px;
}

.product-img-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: var(--surface-3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 2.5rem;
}

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

.product-category {
    font-size: .73rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .04rem;
}

.product-name {
    font-weight: 600;
    font-size: .92rem;
    color: var(--text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: auto;
}

.product-stock {
    font-size: .78rem;
    color: var(--text-muted);
}

.product-stock.low { color: var(--warning); font-weight: 600; }
.product-stock.out { color: var(--danger); font-weight: 600; }

.product-footer {
    padding: 0 14px 14px;
}

.btn-add-cart {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 9px;
    font-weight: 600;
    font-size: .88rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background .15s, transform .1s;
}

.btn-add-cart:hover { background: var(--primary-dark); }
.btn-add-cart:active { transform: scale(.98); }
.btn-add-cart:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }

/* ── CART PAGE ── */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}

.cart-items { display: flex; flex-direction: column; gap: 12px; }

.cart-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    gap: 16px;
    align-items: center;
}

.cart-item-img {
    width: 72px; height: 72px;
    object-fit: contain;
    background: var(--surface-3);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    padding: 4px;
}

.cart-item-img-placeholder {
    width: 72px; height: 72px;
    background: var(--surface-3);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-light);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 600; font-size: .95rem; }
.cart-item-price { font-size: .88rem; color: var(--text-muted); margin-top: 2px; }

.qty-control {
    display: flex; align-items: center; gap: 8px;
}

.qty-btn {
    width: 28px; height: 28px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}

.qty-btn:hover { border-color: var(--primary); color: var(--primary); }

.qty-num {
    width: 36px;
    text-align: center;
    font-weight: 600;
    font-size: .95rem;
}

.cart-item-subtotal {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
    min-width: 80px;
    text-align: right;
}

.remove-btn {
    background: none; border: none; cursor: pointer;
    color: var(--text-light);
    padding: 4px;
    border-radius: 4px;
    transition: color .15s;
    font-size: 1rem;
}
.remove-btn:hover { color: var(--danger); }

/* ── SUMMARY BOX ── */
.summary-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: sticky;
    top: 80px;
}

.summary-box h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: .9rem;
}

.summary-row.total {
    border-top: 2px solid var(--border);
    margin-top: 8px;
    padding-top: 12px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary);
}

.shipping-select {
    width: 100%;
    margin: 14px 0;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    transition: border-color .15s;
}
.shipping-select:focus { outline: none; border-color: var(--primary); }

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    border: none;
    transition: all .15s;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--surface-3); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--border); color: var(--text); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-lg { padding: 13px 28px; font-size: 1rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-control {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .92rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14,116,144,.12); }
.form-control::placeholder { color: var(--text-light); }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: .8rem; color: var(--danger); margin-top: 4px; }

/* ── CARD ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── CHECKOUT ── */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}

.payment-options { display: flex; flex-direction: column; gap: 10px; }

.payment-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all .15s;
}

.payment-option:hover { border-color: var(--primary); }
.payment-option.selected { border-color: var(--primary); background: var(--primary-bg); }

.payment-option input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; }
.payment-option-name { font-weight: 600; font-size: .92rem; }
.payment-option-desc { font-size: .8rem; color: var(--text-muted); }

/* ── CONFIRMACIÓN ── */
.confirm-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

.confirm-header {
    text-align: center;
    padding: 32px 24px 24px;
    background: var(--success-bg);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border: 1px solid #bbf7d0;
    border-bottom: none;
}

.confirm-icon {
    width: 60px; height: 60px;
    background: var(--success);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.6rem;
    margin: 0 auto 16px;
}

.confirm-body {
    background: var(--surface);
    border: 1px solid #bbf7d0;
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 24px;
}

.order-code {
    display: inline-block;
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 6px 16px;
    border-radius: 6px;
    letter-spacing: .05rem;
    font-family: monospace;
}

.payment-detail-box {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    margin: 16px 0;
}

.payment-detail-box .qr-img {
    max-width: 180px;
    margin: 12px auto;
    border-radius: 8px;
}

.payment-detail-box .pay-number {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: .05rem;
}

.wa-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #25d366;
    color: #fff;
    border-radius: var(--radius);
    padding: 14px 24px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: background .15s;
}
.wa-btn:hover { background: #1ebe5d; color: #fff; }

/* ── CUENTA ── */
.auth-wrapper {
    max-width: 440px;
    margin: 0 auto;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
}

.auth-title {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
}

.auth-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: .9rem;
    margin-bottom: 28px;
}

/* ── PEDIDOS ── */
.pedido-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
    transition: box-shadow .15s;
}
.pedido-row:hover { box-shadow: var(--shadow-sm); }

.pedido-codigo {
    font-family: monospace;
    font-weight: 700;
    color: var(--primary);
    font-size: .95rem;
    min-width: 140px;
}

.pedido-fecha { font-size: .83rem; color: var(--text-muted); }
.pedido-total { font-weight: 700; font-size: 1rem; margin-left: auto; }

/* ── BADGES ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04rem;
}

.badge-pendiente { background: #fef3c7; color: #92400e; }
.badge-confirmado { background: #dcfce7; color: #166534; }
.badge-enviado    { background: #e0f2fe; color: #075985; }
.badge-entregado  { background: #f0fdf4; color: #166534; }
.badge-cancelado  { background: #fee2e2; color: #991b1b; }

/* ── ALERTS ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    margin-bottom: 16px;
}
.alert-success { background: var(--success-bg); color: #166534; border-left: 4px solid var(--success); }
.alert-error   { background: var(--danger-bg); color: #991b1b; border-left: 4px solid var(--danger); }
.alert-info    { background: var(--primary-bg); color: #075985; border-left: 4px solid var(--primary); }
.alert-warning { background: var(--warning-bg); color: #92400e; border-left: 4px solid var(--warning); }

/* ── EMPTY STATE ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i { font-size: 3rem; margin-bottom: 16px; opacity: .4; }
.empty-state h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; color: var(--text); }

/* ── FOOTER ── */
.site-footer {
    background: var(--text);
    color: #94a3b8;
    padding: 32px 20px;
    margin-top: 60px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: space-between;
    align-items: flex-start;
}

.footer-copy { font-size: .85rem; }
.footer-links { display: flex; gap: 20px; padding-top: 4px; }
.footer-links a { color: #94a3b8; font-size: .85rem; }
.footer-links a:hover { color: #fff; }

.footer-about { max-width: 320px; order: 99; }
.footer-about-title { font-weight: 700; color: #fff; font-size: .85rem; margin-bottom: 6px; }
.footer-about-title:not(:first-child) { margin-top: 12px; }
.footer-about-text { font-size: .8rem; line-height: 1.6; color: #94a3b8; margin: 0; }

/* ── TOAST ── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--text);
    color: #fff;
    padding: 12px 18px;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 240px;
    animation: slideUp .25s ease;
}

.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── LOADER ── */
.spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 2.5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-muted);
    gap: 12px;
}

/* ── ADMIN STYLES ── */
.admin-layout {
    min-height: 100vh;
}

.admin-sidebar {
    background: var(--text);
    color: #fff;
    padding: 24px 0;
    position: fixed;
    width: 240px;
    height: 100vh;
    overflow-y: auto;
}

.admin-brand {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    margin-bottom: 16px;
}

.admin-brand h2 { font-size: 1rem; font-weight: 700; color: #000; }
.admin-brand p  { font-size: .78rem; color: #64748b; margin-top: 2px; }

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #94a3b8;
    font-size: .88rem;
    font-weight: 500;
    transition: color .15s, background .15s;
    text-decoration: none;
}

.admin-nav a:hover,
.admin-nav a.active { color: #fff; background: rgba(255,255,255,.08); }
.admin-nav a.active { border-right: 3px solid var(--accent); }
.admin-nav .nav-label { padding: 16px 20px 6px; font-size: .7rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .08rem; }

.admin-nav-group { display: flex; flex-direction: column; }

.admin-nav-parent {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 20px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: .88rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: color .15s, background .15s;
}

.admin-nav-parent:hover { color: #fff; background: rgba(255,255,255,.08); }
.admin-nav-group.has-active .admin-nav-parent { color: #fff; }

.admin-nav-parent .chevron { margin-left: auto; font-size: .68rem; transition: transform .2s; }
.admin-nav-group.open .admin-nav-parent .chevron { transform: rotate(90deg); }

.admin-nav-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
    display: flex;
    flex-direction: column;
}

.admin-nav-group.open .admin-nav-children { max-height: 500px; }

.admin-nav-children a { padding: 9px 20px 9px 46px; font-size: .84rem; }

.admin-placeholder-badge {
    display: inline-block;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: .72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    margin-left: 8px;
}

.admin-main { margin-left: 240px; padding: 28px 36px; }

/* Barra superior solo-mobile: hamburguesa + nombre de tienda */
.admin-mobile-topbar {
    display: none;
    align-items: center;
    gap: 12px;
    background: var(--text);
    color: #fff;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 40;
}
.admin-hamburger-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 6px;
    line-height: 1;
    flex-shrink: 0;
}
.admin-mobile-topbar span { font-size: .95rem; font-weight: 700; }

.admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 45;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.admin-page-title { font-size: 1.3rem; font-weight: 700; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
}

.stat-card .stat-label { font-size: .8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04rem; }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 700; margin-top: 5px; line-height: 1.1; }
.stat-card .stat-sub { font-size: .8rem; color: var(--text-muted); margin-top: 3px; }

.table-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--surface-2);
    padding: 12px 16px;
    text-align: left;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 13px 16px;
    font-size: .88rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }

/* ── ADMIN DASHBOARD ── */
.admin-page-date { color: var(--text-muted); font-size: .85rem; margin-top: 2px; }

.btn-badge { background: rgba(255,255,255,.3); border-radius: 20px; padding: 1px 8px; font-size: .8rem; }

.quick-nav {
    display: flex;
    gap: 0;
    margin-bottom: 28px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.quick-nav__item {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    flex: 1;
    padding: 10px 16px;
    font-size: .84rem; font-weight: 600; text-decoration: none;
    color: var(--text-muted);
    border-right: 1.5px solid var(--border);
    transition: color .15s, background .15s;
    white-space: nowrap;
}
.quick-nav__item:last-child { border-right: none; }
.quick-nav__item:hover { color: var(--primary); background: var(--primary-bg); }

.dash-kpi-grid { grid-template-columns: repeat(4, 1fr); }

.stat-card-inner { display: flex; align-items: center; gap: 18px; }
.stat-icon {
    width: 52px; height: 52px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; flex-shrink: 0;
}
.stat-icon--amber  { background: #fef3c7; color: #d97706; }
.stat-icon--blue   { background: var(--primary-bg); color: var(--primary); }
.stat-icon--green  { background: var(--success-bg); color: var(--success); }
.stat-icon--purple { background: #ede9fe; color: #7c3aed; }
.stat-value--md    { font-size: 1.6rem; }

.dash-charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 28px; }

.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding: 0 4px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-col__amount { font-size: .68rem; color: var(--text-muted); font-weight: 600; }
.bar-col__fill { width: 100%; background: var(--primary); border-radius: 4px 4px 0 0; opacity: .85; transition: height .3s; }
.bar-col__label { font-size: .68rem; color: var(--text-muted); }
.chart-summary { margin-top: 14px; display: flex; gap: 16px; font-size: .82rem; padding-top: 12px; border-top: 1px solid var(--border); }

.status-bars { display: flex; flex-direction: column; gap: 10px; }
.status-item__header { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: 4px; }
.status-item__name  { font-weight: 600; }
.status-item__count { color: var(--text-muted); }
.status-item__track { background: var(--border); border-radius: 4px; height: 7px; overflow: hidden; }
.status-item__fill  { height: 100%; border-radius: 4px; transition: width .4s; }

.section-bar { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.section-bar__title { font-weight: 700; font-size: .95rem; display: flex; align-items: center; gap: 8px; }
.pending-pill { background: #fef3c7; color: #92400e; border-radius: 20px; padding: 1px 10px; font-size: .72rem; font-weight: 700; }

.dash-no-pending { margin-bottom: 28px; }
.dash-no-pending__inner { display: flex; align-items: center; gap: 14px; padding: 20px 24px; }
.dash-no-pending__icon {
    width: 42px; height: 42px; background: var(--success-bg); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: var(--success); flex-shrink: 0;
}
.dash-no-pending__title { font-weight: 700; font-size: .95rem; color: var(--success); }
.dash-no-pending__sub   { font-size: .82rem; color: var(--text-muted); margin-top: 1px; }

.order-code-mono     { font-family: monospace; font-weight: 700; color: var(--primary); }
.order-code-mono--sm { font-size: .83rem; }
.td-bold  { font-weight: 700; }
.td-muted { color: var(--text-muted); font-size: .83rem; }
.method-badge { background: var(--surface-3); padding: 2px 8px; border-radius: 4px; font-size: .78rem; font-weight: 700; text-transform: uppercase; }
.status-chip { border-radius: 20px; padding: 2px 10px; font-size: .75rem; font-weight: 700; }
.btn-action-group { display: flex; gap: 6px; }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal-box { background: var(--surface); border-radius: var(--radius-lg); padding: 28px; max-width: 500px; width: 92%; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-title { font-weight: 700; font-size: 1.05rem; }
.modal-close-btn { background: none; border: none; cursor: pointer; font-size: 1.4rem; color: var(--text-muted); line-height: 1; padding: 0; transition: color .15s; }
.modal-close-btn:hover { color: var(--text); }

.order-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: .86rem; margin-bottom: 14px; background: var(--surface-3); padding: 12px; border-radius: 8px; }
.order-info-label { color: var(--text-muted); }
.order-address { font-size: .83rem; margin-bottom: 12px; color: var(--text-muted); }
.order-items { border-top: 1px solid var(--border); padding-top: 12px; }
.order-item-row { display: flex; justify-content: space-between; font-size: .86rem; padding: 5px 0; border-bottom: 1px solid var(--border); }
.order-total-row { display: flex; justify-content: space-between; font-weight: 700; font-size: 1rem; color: var(--primary); padding: 8px 0; border-top: 2px solid var(--border); margin-top: 2px; }
.order-notes { margin-top: 8px; font-size: .82rem; background: #fef9c3; padding: 8px 12px; border-radius: 6px; }

/* ── DASHBOARD EXTRAS ── */
.kpi-trend {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: .71rem; font-weight: 700;
    padding: 1px 7px; border-radius: 20px; margin-top: 5px;
}
.kpi-trend--up   { background: #dcfce7; color: #16a34a; }
.kpi-trend--down { background: #fee2e2; color: #dc2626; }
.kpi-trend--flat { background: var(--surface-3); color: var(--text-muted); }

.stat-card--secondary { opacity: .92; }

.dash-charts-row--3 { grid-template-columns: 2fr 1fr 1fr; }

.dash-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

/* ── PRODUCT DETAIL ── */
.product-detail-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
}

.product-detail-img-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: sticky;
    top: 80px;
}

.product-detail-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    padding: 20px;
    background: var(--surface-3);
    display: block;
}

.product-detail-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: var(--surface-3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: var(--text-light);
}

.product-detail-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-detail-name {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
}

.product-detail-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.breadcrumb {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 10px 20px;
}

.breadcrumb-inner {
    max-width: 1200px;
    margin: 0 auto;
    font-size: .8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.breadcrumb-inner a { color: var(--text-muted); }
.breadcrumb-inner a:hover { color: var(--primary); }
.breadcrumb-inner .bc-sep { font-size: .58rem; opacity: .45; }

.btn-wa-share {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: #25d366;
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-weight: 600;
    font-size: .88rem;
    text-decoration: none;
    transition: background .15s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.btn-wa-share:hover { background: #1ebe5d; color: #fff; }

.product-desc-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    margin-top: 24px;
}

.product-desc-card h3 {
    font-size: .88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.product-desc-card p {
    font-size: .93rem;
    color: var(--text);
    line-height: 1.7;
}

@media (max-width: 700px) {
    .product-detail-grid { grid-template-columns: 1fr; gap: 16px; }
    .product-detail-img-wrap { position: static; }
    .product-detail-name { font-size: 1.1rem; }
    .product-detail-price { font-size: 1.4rem; }
}

/* ── HERO SLIDER ── */
.hero-slider {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: var(--surface-3);
    margin-top: 0;
    z-index: 1;
}

.slider-track {
    display: flex;
    height: 100%;
    transition: transform .55s cubic-bezier(.4,0,.2,1);
    will-change: transform;
}

.slider-slide {
    /* ancho seteado por JS para garantizar exactamente containerWidth/4 */
    height: 100%;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.slider-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slider-slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0,0,0,.45) 0%, transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 60px;
}

.slider-slide-title {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0,0,0,.3);
    margin-bottom: 8px;
    max-width: 480px;
}

.slider-slide-sub {
    color: rgba(255,255,255,.88);
    font-size: 1rem;
    text-shadow: 0 1px 4px rgba(0,0,0,.3);
    max-width: 420px;
}

.slider-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background .2s, transform .2s;
}

.slider-dot.active {
    background: #fff;
    transform: scale(1.25);
}

.slider-arrows {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 12px;
    pointer-events: none;
    z-index: 10;
}

.slider-arrow {
    pointer-events: all;
    background: rgba(0,0,0,.3);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.slider-arrow:hover { background: rgba(0,0,0,.55); }

/* Placeholder cuando no hay banners */
.hero-slider-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    text-align: center;
    padding: 0 20px;
}

.hero-slider-empty h1 { font-size: 2rem; font-weight: 700; margin-bottom: 10px; }
.hero-slider-empty p  { font-size: 1.05rem; opacity: .9; }

@media (max-width: 600px) {
    .hero-slider { height: 130px; }
    .slider-slide-title { font-size: 1.2rem; }
    .slider-slide-overlay { padding: 0 24px; }
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .cart-layout,
    .checkout-layout { grid-template-columns: 1fr; }
    .products-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 50;
    }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; padding: 20px; }
    .admin-mobile-topbar { display: flex; }
    .admin-sidebar-overlay.open { display: block; }
    /* Header vuelve a su tamaño compacto en mobile (en escritorio es +50%) */
    .header-inner { height: 64px; gap: 10px; }
    .header-logo { gap: 10px; font-size: 1.2rem; }
    .header-logo img { height: 36px; }
    .header-logo-icon { width: 38px; height: 38px; font-size: 1.1rem; border-radius: 10px; }
    .header-nav { gap: 4px; }
    .header-nav a { padding: 6px 8px; font-size: .9rem; border-radius: var(--radius-sm); }
    .cat-menu-btn { padding: 6px; font-size: 1.15rem; }
    .header-search-wrap i { left: 12px; font-size: .85rem; }
    .header-search-wrap input { height: 36px; padding: 0 12px 0 34px; border-width: 1.5px; border-radius: var(--radius-sm); font-size: .87rem; }
    .header-actions { gap: 12px; }
    .cart-btn { padding: 8px 16px; font-size: .9rem; gap: 8px; border-radius: var(--radius-sm); }
    .cart-badge { top: -6px; right: -6px; width: 20px; height: 20px; font-size: .7rem; }
    .user-btn { border-width: 1px; border-radius: var(--radius-sm); padding: 7px 14px; font-size: .88rem; gap: 7px; }
    .page-wrapper { min-height: calc(100vh - 64px); }
    .dash-kpi-grid        { grid-template-columns: repeat(2, 1fr); }
    .dash-charts-row      { grid-template-columns: 1fr; }
    .dash-charts-row--3   { grid-template-columns: 1fr; }
    .dash-bottom-row      { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .hero h1 { font-size: 1.4rem; }
    .cart-item { flex-wrap: wrap; }
    .dash-kpi-grid { grid-template-columns: 1fr 1fr; }
}
