:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: #16161f;
    --bg-hover: #1e1e2a;
    --text-primary: #f0f0f5;
    --text-secondary: #8888aa;
    --accent: #f59e0b;
    --accent-dim: #d97706;
    --accent-light: #fbbf24;
    --accent-glow: rgba(245, 158, 11, 0.3);
    --border: #2a2a3a;
    --success: #4caf50;
    --danger: #e53945;
    --warning: #f59e0b;
    --radius: 12px;
}

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

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    animation: fadeIn 0.3s ease;
}

/* Animaciones globales */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 4px var(--accent-glow); }
    50%      { box-shadow: 0 0 14px var(--accent-glow); }
}

img { max-width: 100%; height: auto; }

.container { width: 100%; max-width: 100%; overflow-x: hidden; }
.main-content {
    flex: 1 0 auto;
    animation: fadeIn 0.25s ease;
}

/* ===== HEADER ===== */
.header {
    background: rgba(17,17,24,0.95);
    border-bottom: 1px solid var(--border);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    gap: 0.8rem;
}
.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}
.header-logo img {
    height: 36px;
    width: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* Nombre de la marca al lado del logo */
.header-brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    margin-left: 0.5rem;
}

.header-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-shrink: 0;
}

/* Search bar — full width row under header */
.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 0.4rem 0.8rem;
    gap: 0.5rem;
}
.search-bar .search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    min-width: 0;
}
.search-bar .search-input::placeholder { color: var(--text-secondary); }
.search-bar .search-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.search-bar .search-btn:hover { color: var(--accent-light); }

/* ===== CARRITO BADGE ===== */
.cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}
.cart-btn:hover { border-color: var(--accent-dim); }
.cart-btn .cart-count {
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    position: absolute;
    top: -6px;
    right: -6px;
    border: 2px solid var(--bg-primary);
}
.cart-btn svg { flex-shrink: 0; }

/* ===== SECCIONES (Amazon-style scroll) ===== */
.seccion {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem 0.5rem;
}
.seccion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.seccion-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.seccion-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.ver-todo {
    color: var(--accent-light);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}
.ver-todo:hover { text-decoration: underline; }

.scroll-row {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem 0 1rem;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-dim) var(--bg-secondary);
}
.scroll-row::-webkit-scrollbar { height: 6px; }
.scroll-row::-webkit-scrollbar-track { background: var(--bg-secondary); border-radius: 3px; }
.scroll-row::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 3px; }

/* Animación escalonada para cards dentro de scroll-row */
.scroll-row .product-card {
    animation: fadeInUp 0.4s ease both;
}
.scroll-row .product-card:nth-child(1) { animation-delay: 0.02s; }
.scroll-row .product-card:nth-child(2) { animation-delay: 0.06s; }
.scroll-row .product-card:nth-child(3) { animation-delay: 0.10s; }
.scroll-row .product-card:nth-child(4) { animation-delay: 0.14s; }
.scroll-row .product-card:nth-child(5) { animation-delay: 0.18s; }
.scroll-row .product-card:nth-child(6) { animation-delay: 0.22s; }
.scroll-row .product-card:nth-child(7) { animation-delay: 0.26s; }
.scroll-row .product-card:nth-child(8) { animation-delay: 0.30s; }

.product-card {
    flex: 0 0 auto;
    width: 240px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    border-color: var(--accent-dim);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(124,58,237,0.2);
}
.product-card .img-wrap {
    height: 200px;
    overflow: hidden;
    position: relative;
    background: var(--bg-secondary);
}
.product-card .img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.product-card:hover .img-wrap img { transform: scale(1.05); }
.product-card .info { padding: 0.8rem; flex: 1; display: flex; flex-direction: column; }
.product-card .name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}
.product-card .price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent-light);
    margin-bottom: 0.5rem;
    margin-top: auto;
}
.product-card .actions {
    display: flex;
    gap: 0.5rem;
}
.product-card .btn-add {
    flex: 1;
    padding: 0.4rem;
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.product-card .btn-add:hover {
    background: linear-gradient(135deg, #b45309, #d97706);
    box-shadow: 0 2px 10px var(--accent-glow);
}
.product-card .btn-add:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.product-card .btn-detail {
    padding: 0.4rem 0.6rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.product-card .btn-detail:hover { border-color: var(--accent-dim); color: var(--text-primary); }

/* ===== BOTONES ===== */
.btn {
    padding: 0.6rem 1.4rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-primary {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: #fff;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #b45309, #d97706);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--accent-dim); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.85; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: 0.85; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.8rem; }
.btn-telegram {
    background: linear-gradient(135deg, #229ED9, #2AABB0);
    color: #fff;
    font-size: 0.9rem;
    padding: 0.6rem 1.4rem;
    gap: 0.5rem;
}
.btn-telegram svg { flex-shrink: 0; }
.btn-telegram:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(34,158,217,0.3); }
.btn-outline {
    background: transparent;
    color: var(--accent-light);
    border: 1px solid var(--accent-dim);
}
.btn-outline:hover { background: rgba(245,158,11,0.1); }
.btn-cart {
    background: var(--accent);
    color: #fff;
    width: 100%;
    justify-content: center;
}
.btn-cart:hover { opacity: 0.9; }

/* ===== BUSCADOR (legacy - now in .search-bar) ===== */
.search-results { max-width: 1200px; margin: 0 auto; padding: 2rem; }
.search-results h1 { margin-bottom: 0.5rem; }
.search-results .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }

/* ===== AUTH ===== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    padding: 2rem;
}
.auth-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
}
.auth-box h1 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.auth-box p { color: var(--text-secondary); margin-bottom: 1.5rem; }
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.auth-success { color: var(--success); margin-top: 1rem; font-weight: 600; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.2rem; text-align: left; }
.form-group label { display: block; margin-bottom: 0.4rem; font-size: 0.85rem; color: var(--text-secondary); font-weight: 600; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border 0.2s;
}
.form-group input:focus, .form-group textarea:focus {
    border-color: var(--accent-dim);
    box-shadow: 0 0 0 2px var(--accent-glow);
}
.form-group select {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border 0.2s;
}
.form-group select:focus {
    border-color: var(--accent-dim);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Password toggle */
.pw-wrap {
    position: relative;
    display: flex;
}
.pw-wrap input {
    flex: 1;
    padding-right: 2.8rem !important;
}
.pw-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.3rem;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}
.pw-toggle:hover { color: var(--accent-light); }
.form-actions { display: flex; gap: 1rem; margin-top: 1.5rem; justify-content: center; }
.form-actions .btn { width: 100%; justify-content: center; }

/* ===== FLASH MESSAGES ===== */
.flash {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    margin: 0.5rem 2rem;
    font-size: 0.9rem;
}
.flash-success { background: rgba(76,175,80,0.15); border: 1px solid var(--success); }
.flash-error { background: rgba(229,57,53,0.15); border: 1px solid var(--danger); }

/* ===== USER DROPDOWN ===== */
.user-dropdown {
    position: relative;
    display: inline-block;
}
.user-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: all 0.2s;
    white-space: nowrap;
}
.user-dropdown-trigger:hover {
    background: var(--bg-hover);
    border-color: var(--accent-dim);
}
.user-dropdown-trigger .avatar-img,
.user-dropdown-trigger .avatar-fallback {
    width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
    border: 2px solid var(--accent-dim);
}
.user-dropdown-trigger .avatar-fallback {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #d97706, #f59e0b);
    font-size: 0.75rem; font-weight: 700; color: #fff;
}
.user-name {
    max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dropdown-arrow {
    font-size: 0.6rem; color: var(--text-secondary); transition: transform 0.2s;
}
.dropdown-menu {
    position: absolute; top: calc(100% + 0.3rem); right: 0;
    min-width: 210px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.4rem 0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
    /* Animación suave */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
}
.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.dropdown-menu.show ~ .user-dropdown-trigger .dropdown-arrow,
.user-dropdown-trigger[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}
.dropdown-header {
    padding: 0.5rem 1rem 0.3rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--accent-light); }
.logout-item { color: var(--danger) !important; }
.logout-item:hover { background: rgba(229, 57, 69, 0.1) !important; }
.dropdown-divider { height: 1px; background: var(--border); margin: 0.3rem 0.5rem; }

/* ===== ADMIN PANEL ===== */
.admin-container { padding: 2rem; max-width: 1200px; margin: 0 auto; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.admin-header-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table th { color: var(--text-secondary); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; }
.admin-table tr:hover { background: var(--bg-secondary); }
.admin-table img { width: 50px; height: 50px; object-fit: cover; border-radius: 8px; }

/* ===== CARRITO PAGE ===== */
.cart-page { max-width: 900px; margin: 0 auto; padding: 2rem; }
.cart-page h1 { margin-bottom: 0.5rem; }
.cart-empty { text-align: center; padding: 3rem; color: var(--text-secondary); }
.cart-empty svg { margin-bottom: 1rem; opacity: 0.3; }
.cart-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    align-items: center;
}
.cart-item img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.cart-item-info { flex: 1; }
.cart-item-info h3 { font-size: 1rem; margin-bottom: 0.2rem; }
.cart-item-info .price { color: var(--accent-light); font-weight: 700; font-size: 1.1rem; }
.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cart-item-qty button {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}
.cart-item-qty button:hover { border-color: var(--accent-dim); }
.cart-item-qty span {
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}
.cart-item .btn-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.4rem;
    transition: opacity 0.2s;
}
.cart-item .btn-remove:hover { opacity: 0.7; }
.item-subtotal {
    margin-left: 1rem;
    font-weight: 700;
    color: var(--accent-light);
    font-size: 1.05rem;
}
.cart-total {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: right;
}
.cart-total .total-line {
    font-size: 1.1rem;
    color: var(--text-secondary);
}
.cart-total .total-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-light);
}

/* ===== PRODUCT DETAIL ===== */
.detail-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
.detail-img { flex: 1; min-width: 300px; }
.detail-img img { width: 100%; border-radius: 12px; }
.detail-info { flex: 1; min-width: 300px; }
.detail-info h1 { margin-bottom: 0.5rem; }
.detail-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-light);
    margin-bottom: 1rem;
}

/* ===== GALERÍA DE PRODUCTO ===== */
.gallery-main {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    aspect-ratio: 1 / 1;
}
.gallery-slide {
    display: none;
    width: 100%;
    height: 100%;
}
.gallery-slide.active {
    display: flex;
    align-items: center;
    justify-content: center;
}
.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}
.gallery-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    background: #000;
}
.gallery-img-single {
    width: 100%;
    border-radius: 12px;
}
.gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.3rem;
}
.gallery-thumb {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border);
    cursor: pointer;
    padding: 0;
    background: var(--bg-card);
    transition: border-color 0.2s;
    position: relative;
}
.gallery-thumb.active {
    border-color: var(--accent);
}
.gallery-thumb img,
.gallery-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.thumb-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

/* Badges en cards de productos */
.multi-photo-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}
.video-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(124,58,237,0.9);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
}

.gallery-img-single {
    width: 100%;
    border-radius: 12px;
    object-fit: contain;
    max-height: 500px;
}

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 768px) {
    .header-top { padding: 0.5rem 0.8rem; gap: 0.5rem; }
    .header-logo img { height: 30px; width: 30px; }
    .header-brand-name { font-size: 0.95rem; }
    .header-actions { gap: 0.4rem; flex-wrap: nowrap; }
    .search-bar { padding: 0.35rem 0.6rem; }

    .seccion { padding: 1rem 0.8rem 0.5rem; }
    .seccion-title { font-size: 1.1rem; }
    .scroll-row { gap: 0.6rem; padding: 0.3rem 0 0.8rem; }
    .product-card { width: 160px; }
    .product-card .img-wrap { height: 130px; }
    .product-card .name { font-size: 0.8rem; }
    .product-card .price { font-size: 0.9rem; }
    .product-card .info { padding: 0.5rem; }
    .product-card .btn-add { font-size: 0.7rem; padding: 0.3rem; }
    .product-card .btn-detail { padding: 0.3rem 0.4rem; }

    .admin-container { padding: 0.8rem; }
    .admin-header { flex-direction: column; align-items: stretch; text-align: center; }
    .admin-header-actions { justify-content: center; }
    .admin-table { font-size: 0.75rem; }
    .admin-table th, .admin-table td { padding: 0.4rem 0.3rem; }
    .admin-table th:nth-child(3), .admin-table td:nth-child(3) { display: none; }

    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; justify-content: center; }
    
    .auth-container { padding: 1rem; }
    .auth-box { padding: 1.5rem; }

    .detail-container { padding: 0.8rem; flex-direction: column; }
    .detail-img { min-width: auto; }
    .detail-img img { max-height: 280px; object-fit: contain; }
    .detail-info { min-width: auto; }
    .detail-price { font-size: 1.4rem; }

    .cart-page { padding: 0.8rem; }
    .cart-item { gap: 0.6rem; padding: 0.8rem; flex-wrap: wrap; }
    .cart-item img { width: 60px; height: 60px; }
    .cart-item-info h3 { font-size: 0.85rem; }
    .cart-item-info .price { font-size: 0.95rem; }
    .cart-total { text-align: center; }
    .cart-total .total-amount { font-size: 1.3rem; }
    
    .user-dropdown-trigger { padding: 0.2rem 0.4rem; gap: 0.2rem; font-size: 0.75rem; }
    .user-dropdown-trigger .avatar-img,
    .user-dropdown-trigger .avatar-fallback { width: 24px; height: 24px; }
    .user-name { max-width: 40px; }
    .btn-sm { padding: 0.25rem 0.5rem; font-size: 0.7rem; }

    .search-results { padding: 0.8rem; }
    .search-results .grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }

    .flash { margin: 0.3rem 0.5rem; padding: 0.6rem 0.8rem; font-size: 0.85rem; }
    
    .cart-btn { padding: 0.35rem 0.5rem; font-size: 0.7rem; gap: 0.2rem; }
    .cart-btn span:last-child { display: none; }
}

/* Phone small */
@media (max-width: 480px) {
    .header-top { padding: 0.4rem 0.5rem; gap: 0.3rem; }
    .header-logo img { height: 26px; width: 26px; }
    .header-brand-name { font-size: 0.85rem; }
    .header-actions { gap: 0.25rem; }
    .search-bar { padding: 0.3rem 0.5rem; }
    .search-bar .search-input { font-size: 0.8rem; padding: 0.3rem 0.4rem; }
    
    .seccion { padding: 0.8rem 0.5rem 0.3rem; }
    .seccion-title { font-size: 1rem; }
    .product-card { width: 140px; }
    .product-card .img-wrap { height: 110px; }
    .product-card .name { font-size: 0.75rem; }
    .product-card .price { font-size: 0.85rem; }
    .product-card .btn-add { font-size: 0.65rem; padding: 0.25rem; }
    
    .search-results .grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    
    .admin-table th:nth-child(4), .admin-table td:nth-child(4) { display: none; }
    
    .cart-item { padding: 0.6rem; gap: 0.5rem; }
    .cart-item img { width: 55px; height: 55px; }
    .cart-item-info h3 { font-size: 0.8rem; }
    .cart-item-qty button { width: 26px; height: 26px; font-size: 0.85rem; }
    .cart-item .btn-remove { font-size: 0.7rem; }
    
    .detail-img img { max-height: 220px; }
    
    .auth-box { padding: 1.2rem; }
    .auth-box h1 { font-size: 1.2rem; }
    
    .form-group input, .form-group textarea { font-size: 0.85rem; padding: 0.6rem; }
}

/* Very small phones */
@media (max-width: 360px) {
    .product-card { width: 130px; }
    .product-card .img-wrap { height: 100px; }
    .header-actions { gap: 0.2rem; }
    .btn-sm { padding: 0.2rem 0.4rem; font-size: 0.65rem; }
}

/* PC large */
@media (min-width: 1024px) {
    .product-card { width: 250px; }
    .product-card .img-wrap { height: 220px; }
    .product-card .name { font-size: 1rem; }
    .product-card .price { font-size: 1.2rem; }
    .seccion { padding: 1.5rem 2rem 0.5rem; }
    .search-results { padding: 1.5rem 2rem; }
}

/* ===== FOOTER ===== */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 1.5rem 1rem 0.8rem;
    flex-shrink: 0;
}
.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}
.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.footer-logo {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    object-fit: cover;
    opacity: 0.9;
}
.footer-name {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: var(--accent-light);
}
.footer-contact {
    margin-bottom: 1rem;
}
.footer-contact p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin: 0.3rem 0;
}
.footer-contact a {
    color: var(--accent-light);
    text-decoration: none;
}
.footer-contact a:hover {
    text-decoration: underline;
}
.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}
.footer-bottom p {
    color: var(--text-secondary);
    font-size: 0.7rem;
    margin: 0.2rem 0;
    opacity: 0.7;
}

@media (max-width: 480px) {
    .site-footer { padding: 1.5rem 0.8rem 0.8rem; }
    .footer-links { gap: 0.8rem; }
    .footer-links a { font-size: 0.8rem; }
    .footer-bottom p { font-size: 0.65rem; }
}

/* ====== CARRITO AJAX ANIMATIONS ====== */

/* Toast notification — píldora verde redonda con ✓ animado */
.cart-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(140px) scale(0.4);
    padding: 0 1.4rem 0 0.4rem;
    height: 56px;
    background: linear-gradient(135deg, #064e3b, #047857);
    color: #d1fae5;
    border: 2px solid #10b981;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    z-index: 9999;
    opacity: 0;
    transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 32px rgba(16,185,129,0.45), 0 0 0 6px rgba(16,185,129,0.12);
    pointer-events: none;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    letter-spacing: 0.2px;
}

.cart-toast::before {
    content: '';
    width: 38px;
    height: 38px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 16px rgba(16,185,129,0.6);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 22px;
    transform: scale(0);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s;
}

.cart-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}

.cart-toast.show::before {
    transform: scale(1);
}

.cart-toast-error {
    background: linear-gradient(135deg, #450a0a, #7f1d1d);
    color: #fecaca;
    border-color: #ef4444;
    box-shadow: 0 8px 32px rgba(239,68,68,0.45), 0 0 0 6px rgba(239,68,68,0.12);
}

.cart-toast-error::before {
    background-color: #ef4444;
    box-shadow: 0 0 16px rgba(239,68,68,0.6);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><line x1='18' y1='6' x2='6' y2='18'/><line x1='6' y1='6' x2='18' y2='18'/></svg>");
}

/* Cart badge bump */
@keyframes cartBump {
    0%   { transform: scale(1); }
    25%  { transform: scale(1.5) rotate(-8deg); }
    50%  { transform: scale(0.85) rotate(4deg); }
    75%  { transform: scale(1.15) rotate(-2deg); }
    100% { transform: scale(1) rotate(0); }
}

.cart-count.bump {
    animation: cartBump 0.6s ease;
}

/* Añadir al carrito — animación rica */
@keyframes addRipple {
    0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(124,58,237,0.5); }
    50%  { transform: scale(0.92); box-shadow: 0 0 0 12px rgba(124,58,237,0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(124,58,237,0); }
}

.btn-add {
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(124,58,237,0.4);
}

.btn-add:active {
    animation: addRipple 0.4s ease;
    transform: scale(0.95);
}

/* Botón grande de producto individual */
.btn-cart {
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 18px rgba(124,58,237,0.4);
}

.btn-cart:active {
    animation: addRipple 0.4s ease;
    transform: scale(0.96);
}

/* Botones +/- del carrito */
.cart-item-qty button {
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.cart-item-qty button:hover {
    transform: translateY(-1px) scale(1.08);
    border-color: var(--accent) !important;
    box-shadow: 0 2px 10px rgba(124,58,237,0.25);
}

.cart-item-qty button:active {
    transform: scale(0.88) !important;
}

@keyframes qtyBump {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.25); color: #4ade80; }
    100% { transform: scale(1); }
}

.cart-item-qty span {
    transition: all 0.3s ease;
}

.cart-item-qty span.bump {
    animation: qtyBump 0.4s ease;
}

/* ====== MODAL DE CONFIRMACIÓN ====== */
.vms-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.vms-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    animation: vmsBackdropIn 0.25s ease;
}

@keyframes vmsBackdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.vms-modal-box {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 1.5rem 1.5rem;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transform: scale(0.85) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vms-modal-box.show {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.vms-modal-icon {
    font-size: 3rem;
    margin-bottom: 0.8rem;
    animation: vmsIconBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
    display: inline-block;
}

@keyframes vmsIconBounce {
    0%   { transform: scale(0) rotate(0deg); }
    60%  { transform: scale(1.2) rotate(-10deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.vms-modal-title {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin: 0 0 0.5rem;
    font-weight: 700;
}

.vms-modal-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 0 1.5rem;
    line-height: 1.4;
}

.vms-modal-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
}

.vms-btn {
    padding: 0.7rem 1.4rem;
    border-radius: 10px;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 100px;
}

.vms-btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.vms-btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-dim);
    transform: translateY(-1px);
}

.vms-btn-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff;
}

.vms-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(239,68,68,0.4);
}

.vms-btn:active {
    transform: scale(0.95);
}

/* ====== ALERTA DE CORREO EN REGISTRO ====== */
.auth-warning-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.3);
    border-left: 4px solid #ef4444;
    border-radius: 10px;
    padding: 0.8rem 0.9rem;
    margin: 1rem 0;
    transition: opacity 0.3s;
}

.auth-warning-alert.hidden {
    display: none;
}

.auth-warning-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    line-height: 1;
    padding-top: 0.1rem;
}

.auth-warning-text {
    flex: 1;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.auth-warning-text strong {
    color: #fca5a5;
}

.auth-warning-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    padding: 0 0.3rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.auth-warning-close:hover {
    opacity: 1;
}

/* ====== CHECKBOX DE TÉRMINOS ====== */
.terms-check {
    margin-top: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text-primary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 0.2rem;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: #f59e0b;
    cursor: pointer;
}

.checkbox-label a {
    color: var(--accent-light);
    text-decoration: underline;
    font-weight: 600;
}

.terms-points {
    margin: 0.6rem 0 0 1.8rem;
    padding: 0;
    list-style: none;
}

.terms-points li {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
    padding: 0.2rem 0;
    position: relative;
    padding-left: 1rem;
}

.terms-points li::before {
    content: '•';
    color: var(--accent);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* ====== FOOTER LINKS ====== */
.footer-links {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent-light);
}

/* ====== PÁGINAS LEGALES ====== */
.legal-page {
    max-width: 760px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.legal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.legal-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.legal-icon {
    font-size: 3rem;
    margin-bottom: 0.8rem;
}

.legal-header h1 {
    margin: 0 0 0.3rem;
    font-size: 1.6rem;
    color: var(--text-primary);
}

.legal-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

.legal-body {
    padding: 2rem;
}

.legal-section {
    margin-bottom: 2rem;
}

.legal-section:last-of-type {
    margin-bottom: 0;
}

.legal-section h2 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0 0 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--accent-dim);
}

.legal-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0.5rem 0;
}

.legal-section ul {
    margin: 0.5rem 0;
    padding-left: 1.2rem;
}

.legal-section li {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0.35rem 0;
}

.legal-section a {
    color: var(--accent-light);
    text-decoration: underline;
}

.legal-section hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0 1rem;
}

.legal-ack {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 1.5rem;
    line-height: 1.5;
}

.legal-warning {
    background: rgba(239,68,68,0.06);
    border: 1px solid rgba(239,68,68,0.2);
    border-left: 4px solid #ef4444;
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.2rem;
}

.legal-warning h2 {
    border-bottom-color: rgba(239,68,68,0.3);
}

.legal-warning p,
.legal-warning li {
    color: var(--text-secondary);
}

.legal-footer {
    padding: 1.5rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

@media (max-width: 600px) {
    .legal-body { padding: 1.2rem; }
    .legal-header { padding: 1.5rem 1.2rem; }
    .legal-header h1 { font-size: 1.3rem; }
}

/* ====== TOP VENDIDOS ====== */
.top-vendidos-section {
    margin-bottom: 2rem;
}

.Top-vendidos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.top-vendido {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.top-vendido:hover {
    transform: translateY(-4px);
    border-color: rgba(239,68,68,0.4);
    box-shadow: 0 8px 24px rgba(239,68,68,0.2);
}

.top-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    background: linear-gradient(135deg, #dc2626, #f97316);
    color: #fff;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(239,68,68,0.4);
    letter-spacing: 0.3px;
}

.top-sold {
    font-size: 0.75rem;
    color: var(--accent-light);
    margin: 0.3rem 0 0.5rem;
    font-weight: 600;
}

@media (max-width: 900px) {
    .Top-vendidos-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .Top-vendidos-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
    .top-vendido { border-radius: 10px; }
}

/* ====== COMPARTIR PRODUCTO ====== */
.product-price-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: -0.7rem 0 1rem;
}

.product-price-options span {
    padding: 0.3rem 0.55rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.78rem;
}

.price-multi {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.price-multi span {
    font-size: 0.78rem;
}

.product-share {
    position: relative;
    display: inline-flex;
    margin: 0.2rem 0 1.2rem;
}

.share-button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.85rem;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 9px;
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}

.share-button:hover,
.share-button:focus-visible {
    color: var(--accent-light);
    border-color: var(--accent-dim);
    background: rgba(245, 158, 11, 0.08);
    transform: translateY(-1px);
    outline: none;
}

.share-button svg { flex-shrink: 0; }

.share-menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    z-index: 20;
    display: grid;
    min-width: 180px;
    padding: 0.35rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px) scale(0.98);
    transform-origin: top left;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.share-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.share-menu a,
.share-menu button {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    color: var(--text-primary);
    background: transparent;
    border: 0;
    border-radius: 7px;
    font: inherit;
    font-size: 0.86rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.share-option-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: currentColor;
}

.share-menu .whatsapp-icon { color: #25d366; }
.share-menu .telegram-icon { color: #229ed9; }
.share-menu .facebook-icon { color: #1877f2; }
.share-menu .x-icon { color: var(--text-primary); }
.share-menu .copy-icon { fill: none; stroke: currentColor; stroke-width: 1.8; }

.share-menu a:hover,
.share-menu button:hover,
.share-menu a:focus-visible,
.share-menu button:focus-visible {
    background: var(--bg-secondary);
    color: var(--accent-light);
    outline: none;
}

/* ═══════════════════════════════════════════════════════════ */
/* LIGHT MODE — Azul y Blanco                                 */
/* ═══════════════════════════════════════════════════════════ */
[data-theme="light"] {
    --bg-primary: #f0f4f8;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #e8eef5;
    --text-primary: #1a2332;
    --text-secondary: #5a6a7e;
    --accent: #d97706;
    --accent-dim: #b45309;
    --accent-light: #f59e0b;
    --accent-glow: rgba(217, 119, 6, 0.2);
    --border: #d1d9e6;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
}

[data-theme="light"] body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="light"] .header {
    background: rgba(255,255,255,0.95);
    border-bottom: 1px solid var(--border);
}

[data-theme="light"] .footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

[data-theme="light"] .ai-chat {
    background: var(--bg-card);
}

[data-theme="light"] .ai-msg.bot {
    background: var(--bg-secondary);
    border-color: var(--border);
}

[data-theme="light"] .product-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent-light);
}

[data-theme="light"] .detail-container {
    background: var(--bg-card);
}

[data-theme="light"] .review-card {
    background: var(--bg-secondary);
    border-color: var(--border);
}

[data-theme="light"] .review-form {
    background: var(--bg-secondary);
}

[data-theme="light"] .review-textarea {
    background: var(--bg-primary);
    border-color: var(--border);
    color: var(--text-primary);
}

[data-theme="light"] input, [data-theme="light"] select {
    background: var(--bg-primary);
    border-color: var(--border);
    color: var(--text-primary);
}

/* ═══ THEME TOGGLE ═══ */
.theme-toggle {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.15rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.theme-toggle:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: rotate(20deg);
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }
[data-theme="light"] .theme-toggle .icon-sun { display: inline; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ═══════════════════════════════════════════════════════════ */
/* REVIEWS — Estilos                                         */
/* ═══════════════════════════════════════════════════════════ */
.reviews-section {
    max-width: 700px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.reviews-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Stats */
.reviews-stats {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}
.stats-summary {
    text-align: center;
    min-width: 100px;
}
.stats-avg {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}
.stats-stars { margin: 0.3rem 0; }
.stat-star {
    font-size: 1.1rem;
    color: #555;
}
.stat-star.filled { color: #f59e0b; }
.stats-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.stats-distribution {
    flex: 1;
}
.dist-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.dist-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 30px;
}
.dist-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
}
.dist-fill {
    height: 100%;
    background: #f59e0b;
    border-radius: 3px;
    transition: width 0.4s ease;
}
.dist-count {
    font-size: 0.7rem;
    color: var(--text-secondary);
    min-width: 20px;
    text-align: right;
}

/* Review Form */
.review-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}
.review-form h3 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}
.star-picker {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 0.8rem;
}
.star-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
    line-height: 1;
}
.star-btn.active { color: #f59e0b; transform: scale(1.1); }
.star-btn:hover { color: #f59e0b; }
.review-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 70px;
}
.review-textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.review-form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.8rem;
}
.review-login-prompt {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}
.review-login-prompt a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

/* Review Cards */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.review-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    transition: border-color 0.2s;
}
.review-card:hover {
    border-color: var(--accent-dim);
}
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}
.review-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.review-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}
.review-name {
    font-size: 0.9rem;
    color: var(--text-primary);
}
.review-you {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 400;
}
.review-date {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
}
.review-rating {
    color: #f59e0b;
    font-size: 0.9rem;
    letter-spacing: 1px;
}
.review-body {
    color: var(--text-primary);
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 0.6rem;
    white-space: pre-wrap;
}
.review-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.review-like {
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.25rem 0.7rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s;
}
.review-like:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.review-like.liked {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: #fff;
}
.emoji-picker {
    display: flex;
    gap: 0.2rem;
}
.emoji-opt {
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.2rem 0.35rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
}
.emoji-opt:hover {
    background: var(--bg-hover);
    border-color: var(--border);
    transform: scale(1.15);
}
.review-emojis {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}
.emoji-badge {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    transition: all 0.15s;
}
.emoji-badge:hover {
    border-color: var(--accent);
}
.emoji-badge.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: #fff;
}
.review-loading, .review-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Product card rating */
.product-card-rating {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.3rem;
}
.pc-stars {
    color: #f59e0b;
    font-size: 0.8rem;
    letter-spacing: 1px;
}
.pc-count {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════ */
/* SKELETON LOADERS                                          */
/* ═══════════════════════════════════════════════════════════ */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}
.skeleton-card {
    height: 280px;
    border-radius: var(--radius);
}
.skeleton-text {
    height: 14px;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}
.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }
.skeleton-title {
    height: 20px;
    width: 70%;
    margin-bottom: 0.8rem;
}

/* ═══════════════════════════════════════════════════════════ */
/* EMPTY STATES                                              */
/* ═══════════════════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}
.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}
.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.empty-state p {
    font-size: 0.9rem;
    max-width: 300px;
    margin: 0 auto 1rem;
}
.empty-state .btn {
    display: inline-flex;
}

/* ═══════════════════════════════════════════════════════════ */
/* ANIMATIONS — Subtle improvements                           */
/* ═══════════════════════════════════════════════════════════ */
.product-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}
.btn, .btn-add, .btn-cart {
    transition: all 0.2s ease;
}
.btn:active, .btn-add:active, .btn-cart:active {
    transform: scale(0.97);
}

/* Review avatar image */
.review-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

/* ═══ Review corrections ═══ */
.review-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
}
.sentiment-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
}
.sentiment-badge.positive {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success);
}
.sentiment-badge.negative {
    background: rgba(229, 57, 69, 0.15);
    color: var(--danger);
}
.sentiment-badge.neutral {
    background: rgba(136, 136, 170, 0.15);
    color: var(--text-secondary);
}
.own-review {
    border-left: 3px solid var(--accent);
}
.own-review .review-footer {
    opacity: 0.5;
}
.own-review .review-footer button[disabled] {
    cursor: not-allowed;
    pointer-events: none;
}
.emoji-picker.disabled {
    opacity: 0.4;
    pointer-events: none;
}
.emoji-opt.active {
    background: var(--accent-dim);
    border-color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════ */
/* PATCH MODAL                                               */
/* ═══════════════════════════════════════════════════════════ */
.patch-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}
.patch-overlay.show {
    display: flex;
}
.patch-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: min(500px, 100%);
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.35s ease;
    display: flex;
    flex-direction: column;
}
.patch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border);
}
.patch-header h2 {
    font-size: 1.15rem;
    margin: 0;
    color: var(--text-primary);
}
.patch-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.patch-close:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.patch-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.2rem 1.5rem;
}
.patch-block {
    margin-bottom: 1.2rem;
}
.patch-block:last-child {
    margin-bottom: 0;
}
.patch-meta {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.patch-title {
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
}
.patch-changes {
    list-style: none;
    padding: 0;
    margin: 0;
}
.patch-changes li {
    padding: 0.4rem 0;
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.4;
    border-bottom: 1px solid rgba(42, 42, 58, 0.3);
}
.patch-changes li:last-child {
    border-bottom: none;
}
.patch-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}
