/* ============================================================
   SICT — Hoja de Estilos Principal (Mercado Libre Style)
   Mobile-First, Responsive & Modern
   ============================================================ */

:root {
    --primary: #3483fa;
    --primary-hover: #2968c8;
    --secondary: #39b54a;
    --secondary-hover: #2e963c;
    --whatsapp: #25d366;
    --whatsapp-hover: #1ebc59;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --warning: #f59e0b;
    --success: #10b981;
    --info: #0ea5e9;

    --bg-page: #ebebeb;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --text-light: #888888;
    --border-color: #e5e7eb;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 8px 0 rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 12px 24px -4px rgba(0, 0, 0, 0.12);

    --header-height: 64px;
    --sidebar-width: 260px;
}

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

html {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    color: var(--text-main);
    background-color: var(--bg-page);
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
}

/* ============================================================
   MODO OSCURO
   ============================================================ */
[data-theme="dark"] {
    --bg-page: #121212;
    --card-bg: #1e1e1e;
    --text-main: #e4e4e7;
    --text-muted: #a1a1aa;
    --text-light: #71717a;
    --border-color: #2e2e2e;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 8px 0 rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 12px 24px -4px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .search-input {
    background: #2a2a2e;
    color: #e4e4e7;
    border-color: #3f3f46;
}

[data-theme="dark"] .search-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .search-btn {
    color: #a1a1aa;
}

[data-theme="dark"] .catalog-bar {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .catalog-title {
    color: #e4e4e7;
}

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

[data-theme="dark"] .product-card-media {
    background: #252528;
}

[data-theme="dark"] .product-card-title {
    color: #d4d4d8;
}

[data-theme="dark"] .product-card-footer {
    border-top-color: #2e2e2e;
}

[data-theme="dark"] .price-current {
    color: #e4e4e7;
}

[data-theme="dark"] .filter-title,
[data-theme="dark"] .section-title {
    color: #e4e4e7;
}

[data-theme="dark"] .filter-item {
    color: #a1a1aa;
}

[data-theme="dark"] .filter-box {
    border-bottom-color: #2e2e2e;
}

[data-theme="dark"] .catalog-sidebar {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .sort-select {
    background: #2a2a2e;
    color: #e4e4e7;
    border-color: #3f3f46;
}

[data-theme="dark"] .btn-toggle-filters {
    background: #2a2a2e;
    border-color: #3f3f46;
    color: #e4e4e7;
}

[data-theme="dark"] .footer {
    background-color: #1a1a1e;
    border-top-color: #2e2e2e;
}

[data-theme="dark"] .footer-title {
    color: #e4e4e7;
}

[data-theme="dark"] .footer-contact p {
    color: #a1a1aa;
}

[data-theme="dark"] .footer-bottom {
    background: #141416;
    border-top-color: #2e2e2e;
}

[data-theme="dark"] .page-link {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: #d4d4d8;
}

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

[data-theme="dark"] .detail-title {
    color: #e4e4e7;
}

[data-theme="dark"] .price-amount,
[data-theme="dark"] .currency-symbol {
    color: #e4e4e7;
}

[data-theme="dark"] .gallery-main-viewport {
    background: #252528;
    border-color: #2e2e2e;
}

[data-theme="dark"] .color-pill {
    background: #2a2a2e;
    border-color: #3f3f46;
    color: #d4d4d8;
}

[data-theme="dark"] .size-pill {
    background: #2a2a2e;
    border-color: #3f3f46;
    color: #d4d4d8;
}

[data-theme="dark"] .login-body {
    background: #0a0a0c;
}

[data-theme="dark"] .carousel-container {
    background: #1a1a1e;
}

/* Botón de alternancia modo oscuro */
.dark-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: var(--header-text, #fff);
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

[data-theme="dark"] .dark-mode-toggle {
    background: rgba(255, 255, 255, 0.08);
}

a {
    color: inherit;
    text-decoration: none;
}

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

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* Contenedor */
.container {
    width: 100%;
    max-width: 1220px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

@media (min-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ============================================================
   ENCABEZADO DE LA TIENDA (PERSONALIZABLE & AUTO-OCULTABLE EN SCROLL)
   ============================================================ */
.header {
    background-color: var(--header-bg, #0f172a);
    color: var(--header-text, #ffffff);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    will-change: transform;
}

/* Ocultar barra al hacer scroll hacia abajo */
.header.header-hidden {
    transform: translateY(-100%);
    box-shadow: none;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

@media (max-width: 640px) {
    .header-top {
        flex-wrap: nowrap;
        gap: 0.35rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        align-items: center;
    }

    .logo {
        order: 1;
        font-size: 1.25rem;
        flex-shrink: 0;
    }

    .search-bar {
        order: 2;
        flex: 1;
        min-width: 0;
        max-width: none;
    }

    .header-actions {
        order: 3;
        margin-left: 0;
        gap: 0;
        flex-shrink: 0;
    }

    /* En móvil: solo icono, sin texto ni chevron */
    .user-menu-btn .user-btn-label,
    .user-menu-btn .chevron-icon {
        display: none;
    }

    .user-menu-btn {
        padding: 0.4rem;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        justify-content: center;
    }

    .search-input {
        height: 38px;
        font-size: 0.88rem;
        padding: 0 70px 0 1rem;
    }
}

@media (min-width: 641px) {
    .header-top {
        gap: 1rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--header-text, #ffffff);
    flex-shrink: 0;
    text-decoration: none;
}

.logo-badge {
    font-size: 1.35rem;
    flex-shrink: 0;
}

.logo-name {
    letter-spacing: -0.5px;
    font-weight: 800;
    display: inline-block;
    max-width: 250px;
    opacity: 1;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, margin 0.25s ease;
}

/* Colapso del nombre de tienda en búsqueda expandida (solo queda el rayo ⚡) */
.header-top.search-expanded .logo-name {
    max-width: 0 !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    pointer-events: none;
}

/* Barra de Búsqueda Expandible */
.search-bar {
    flex: 1;
    max-width: 620px;
    display: flex;
    position: relative;
    min-width: 0;
    transition: max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-top.search-expanded .search-bar {
    max-width: 100% !important;
    flex: 1 !important;
}

.search-input {
    width: 100%;
    height: 42px;
    padding: 0 76px 0 1.15rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-full);
    background: #ffffff;
    color: #111111;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
    font-size: 0.95rem;
    outline: none;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.search-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35);
    border-color: #3b82f6;
}

.search-btn {
    position: absolute;
    right: 3px;
    top: 3px;
    bottom: 3px;
    width: 38px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    border-radius: var(--radius-full);
    transition: background 0.2s;
    z-index: 2;
}

.search-btn:hover {
    background: #f3f4f6;
    color: #111;
}

/* Botón cerrar búsqueda expandible (✕) */
.search-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 42px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.08);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}

.header-top.search-expanded .search-close-btn {
    display: flex;
}

.search-close-btn:hover {
    background: rgba(0, 0, 0, 0.15);
    color: #0f172a;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    max-width: 250px;
    opacity: 1;
    transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, margin 0.25s ease;
}

/* Ocultar acciones del header cuando se expande el buscador */
.header-top.search-expanded .header-actions {
    max-width: 0 !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    pointer-events: none;
}

@media (min-width: 640px) {
    .header-actions {
        gap: 1rem;
    }
}

/* Menú Desplegable de Usuario (con Modo Oscuro adentro) */
.user-menu-wrapper {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--header-text, #ffffff);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    line-height: 1;
}

.user-menu-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.chevron-icon {
    opacity: 0.8;
    transition: transform 0.2s ease;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    width: 235px;
    background: var(--card-bg, #ffffff);
    color: var(--text-main, #0f172a);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color, #e2e8f0);
    padding: 0.5rem 0;
    z-index: 1050;
    animation: fadeInDropdown 0.2s ease-out;
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-greeting {
    padding: 0.65rem 1rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    margin-bottom: 0.35rem;
}

.dropdown-greeting strong {
    display: block;
    color: var(--text-main, #0f172a);
    font-size: 0.92rem;
    margin-top: 0.15rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
    color: var(--text-main, #1e293b);
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    text-decoration: none;
}

.dropdown-item:hover {
    background: #f1f5f9;
    color: var(--primary, #3b82f6);
}

.dark-mode-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.theme-label-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.theme-switch-slider {
    width: 38px;
    height: 20px;
    background: #cbd5e1;
    border-radius: 20px;
    position: relative;
    transition: background-color 0.25s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.theme-switch-slider .slider-knob {
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.25s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.theme-switch-slider.active {
    background: var(--primary, #3b82f6);
}

.theme-switch-slider.active .slider-knob {
    transform: translateX(18px);
}

.dropdown-separator {
    height: 1px;
    background: var(--border-color, #e2e8f0);
    margin: 0.4rem 0;
}

.dropdown-item.item-danger {
    color: var(--danger, #ef4444);
}

.dropdown-item.item-danger:hover {
    background: #fef2f2;
}

/* Modo oscuro para menú desplegable */
[data-theme="dark"] .user-dropdown-menu {
    background: #1e1e24;
    border-color: #33333d;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .dropdown-greeting {
    border-bottom-color: #2e2e38;
    color: #94a3b8;
}

[data-theme="dark"] .dropdown-greeting strong {
    color: #f1f5f9;
}

[data-theme="dark"] .dropdown-item {
    color: #e2e8f0;
}

[data-theme="dark"] .dropdown-item:hover {
    background: #2a2a35;
    color: #60a5fa;
}

[data-theme="dark"] .dropdown-separator {
    background: #2e2e38;
}

[data-theme="dark"] .dropdown-item.item-danger:hover {
    background: #3b1c1c;
}

[data-theme="dark"] .theme-switch-slider {
    background: #475569;
}

/* Botón Flotante de Carrito de Compras */
.floating-cart-btn {
    position: fixed;
    bottom: 1.75rem;
    right: 1.75rem;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--primary, #3b82f6);
    color: #ffffff !important;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.2s ease;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
}

.floating-cart-btn:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
    color: #ffffff;
}

.floating-cart-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: #ef4444;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    height: 20px;
    min-width: 20px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.floating-cart-label {
    letter-spacing: 0.2px;
}

/* Animación de salto al agregar producto */
@keyframes bounceCart {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.22) rotate(-8deg); }
    60% { transform: scale(0.92) rotate(4deg); }
    80% { transform: scale(1.1); }
}

.bounce-cart {
    animation: bounceCart 0.5s ease;
}

@media (max-width: 640px) {
    .floating-cart-btn {
        bottom: 1.25rem;
        right: 1.25rem;
        padding: 0.85rem;
        border-radius: 50%;
        width: 52px;
        height: 52px;
        justify-content: center;
    }

    .floating-cart-label {
        display: none;
    }
}

.cart-badge {
    position: absolute;
    top: -2px;
    right: -6px;
    background-color: var(--danger);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    height: 19px;
    min-width: 19px;
    padding: 0 4px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--header-bg, #0f172a);
}

/* Barra de Navegación por Categorías Rápidas */
.header-nav {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background-color: var(--header-nav-bg, #1e293b);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.nav-container {
    display: flex;
    gap: 0.75rem;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

@media (min-width: 640px) {
    .nav-container {
        gap: 1.5rem;
    }
}

.nav-item {
    font-size: 0.8rem;
    color: var(--header-text, #ffffff);
    opacity: 0.85;
    transition: opacity 0.2s, color 0.2s;
    font-weight: 500;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .nav-item {
        font-size: 0.85rem;
    }
}

.nav-item:hover, .nav-item.active {
    opacity: 1;
    color: #ffffff;
    font-weight: 700;
}

/* ============================================================
   BANNERS & CAROUSEL HERO
   ============================================================ */
.hero-carousel-section {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.carousel-container {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-md);
    height: 230px;
}

.carousel-track {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
    display: flex;
    align-items: center;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 1;
}

.carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.85);
}

.carousel-caption {
    position: absolute;
    left: 4rem;
    right: 4rem;
    top: 1.5rem;
    max-width: 540px;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
    z-index: 2;
    pointer-events: auto;
}

.carousel-caption h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
    line-height: 1.2;
}

.carousel-caption p {
    font-size: 0.92rem;
    margin-bottom: 0.85rem;
    opacity: 0.95;
    line-height: 1.35;
}

.carousel-caption .carousel-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.88);
    border: none;
    border-radius: var(--radius-full);
    font-size: 1.15rem;
    color: #1e293b;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: all 0.2s;
    user-select: none;
}

.carousel-arrow:hover {
    background: #ffffff;
    transform: translateY(-50%) scale(1.08);
}

.carousel-arrow.prev { left: 0.85rem; }
.carousel-arrow.next { right: 0.85rem; }

.carousel-dots {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 5;
}

.carousel-dot {
    width: 9px;
    height: 9px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s;
}

.carousel-dot.active {
    background: #ffffff;
    width: 20px;
}

@media (min-width: 768px) {
    .carousel-container {
        height: 340px;
    }
    .carousel-caption {
        left: 5rem;
        right: 5rem;
        top: 2rem;
        max-width: 620px;
    }
    .carousel-caption h2 {
        font-size: 2.1rem;
        line-height: 1.2;
        margin-bottom: 0.45rem;
    }
    .carousel-caption p {
        font-size: 1.05rem;
        margin-bottom: 1.1rem;
    }
    .carousel-caption .carousel-btn {
        padding: 0.55rem 1.25rem;
        font-size: 0.95rem;
    }
    .carousel-arrow {
        width: 42px;
        height: 42px;
        font-size: 1.25rem;
    }
    .carousel-arrow.prev { left: 1.25rem; }
    .carousel-arrow.next { right: 1.25rem; }
}

@media (max-width: 640px) {
    .carousel-container {
        height: 205px;
    }
    .carousel-caption {
        left: 2.75rem;
        right: 2.75rem;
        top: 0.65rem;
        max-width: calc(100% - 5.5rem);
    }
    .carousel-caption h2 {
        font-size: 1.05rem;
        font-weight: 800;
        margin-bottom: 0.2rem;
        line-height: 1.18;
    }
    .carousel-caption p {
        font-size: 0.76rem;
        line-height: 1.22;
        margin-bottom: 0.4rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .carousel-caption .carousel-btn {
        padding: 0.26rem 0.7rem;
        font-size: 0.75rem;
        border-radius: var(--radius-sm);
    }
    .carousel-arrow {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
        box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    }
    .carousel-arrow.prev { left: 0.35rem; }
    .carousel-arrow.next { right: 0.35rem; }
    .carousel-dots {
        bottom: 0.45rem;
        gap: 0.35rem;
    }
    .carousel-dot {
        width: 7px;
        height: 7px;
    }
    .carousel-dot.active {
        width: 16px;
    }
}

/* ============================================================
   GRILLA DE PRODUCTOS Y TARJETA ESTILO MERCADO LIBRE
   ============================================================ */
.section-featured {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
    }
}

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

.product-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
    min-width: 0; /* Prevenir desbordamiento en grid */
    max-width: 100%;
    position: relative;
}

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

.product-card-media {
    position: relative;
    padding-top: 100%; /* Proporción cuadrada 1:1 */
    background: #f8f8f8;
    overflow: hidden;
    display: block;
}

.product-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-card-img {
    transform: scale(1.03);
}

.product-card-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #ccc;
}

.badge-discount {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background-color: var(--secondary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    z-index: 2;
}

.badge-condition {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    z-index: 2;
    max-width: calc(100% - 3.5rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 480px) {
    .badge-condition {
        font-size: 0.62rem;
        padding: 0.1rem 0.3rem;
        max-width: 80px;
    }
    .badge-discount {
        font-size: 0.65rem;
        padding: 0.1rem 0.3rem;
    }
}

.product-card-content {
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0; /* Prevenir desbordamiento de texto */
    overflow: hidden;
}

@media (min-width: 640px) {
    .product-card-content {
        padding: 0.85rem;
    }
}

/* Vista rápida de colores disponibles en la tarjeta */
.color-swatches-mini {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
    min-height: 16px;
}

.color-swatch-dot {
    width: 13px;
    height: 13px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(0,0,0,0.25);
    display: inline-block;
    cursor: pointer;
}

.color-more {
    font-size: 0.7rem;
    color: var(--text-light);
}

.product-card-prices {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.price-original {
    font-size: 0.8rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.price-current {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main, #111);
}

@media (min-width: 640px) {
    .price-current {
        font-size: 1.25rem;
    }
}

.product-card-title {
    font-size: 0.82rem;
    color: var(--text-main, #333);
    line-height: 1.3;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: break-word;
    flex: 1;
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border-color, #f0f0f0);
    gap: 0.25rem;
    min-width: 0;
}

.product-card-category {
    font-size: 0.7rem;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

.btn-quick-view {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-quick-view:hover {
    text-decoration: underline;
}

/* ============================================================
   CATÁLOGO Y SIDEBAR DE FILTROS
   ============================================================ */
.catalog-section {
    padding-top: 1rem;
    padding-bottom: 3rem;
}

.catalog-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.catalog-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.sidebar-header {
    display: none;
}

.filter-box {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f0f0f0;
}

.filter-box:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #222;
}

.filter-list {
    list-style: none;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #555;
    padding: 0.35rem 0;
    cursor: pointer;
}

.filter-item input[type="radio"] {
    accent-color: var(--primary);
}

.filter-item:hover, .filter-item.selected {
    color: var(--primary);
    font-weight: 600;
}

.count-badge {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-left: auto;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.price-input {
    width: 100%;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    outline: none;
}

.btn-filter-apply {
    padding: 0.35rem 0.65rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
}

.btn-clear-filters {
    display: block;
    text-align: center;
    font-size: 0.8rem;
    color: var(--danger);
    font-weight: 600;
}

.catalog-main {
    flex: 1;
    min-width: 0; /* Prevenir desbordamiento en flex */
    overflow: hidden;
}

.catalog-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    background: var(--card-bg, #ffffff);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    gap: 0.5rem;
}

.catalog-heading {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    min-width: 0;
}

.catalog-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main, #222);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catalog-count {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

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

.btn-toggle-filters {
    display: none;
}

.sort-select-wrapper {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #555;
}

.sort-select {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--card-bg, #fff);
    color: var(--text-main, #333);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

@media (max-width: 768px) {
    .catalog-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
        padding: 0.6rem 0.75rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .catalog-heading {
        width: 100%;
        justify-content: space-between;
    }

    .catalog-title {
        font-size: 0.95rem;
        max-width: 75%;
    }

    .catalog-count {
        font-size: 0.75rem;
    }

    .catalog-sorting {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 0.45rem;
        justify-content: space-between;
    }

    .btn-toggle-filters {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        padding: 0.4rem 0.65rem;
        font-size: 0.8rem;
        font-weight: 600;
        background: #f1f5f9;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        cursor: pointer;
        flex-shrink: 0;
    }

    .sort-select-wrapper {
        flex: 1;
        min-width: 0;
    }

    .sort-label {
        display: none !important;
    }

    .sort-select {
        width: 100%;
        min-width: 0;
        font-size: 0.78rem;
        padding: 0.4rem 0.45rem;
    }
}

/* Adaptación móvil del sidebar de filtros */
@media (max-width: 900px) {
    .catalog-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 300px;
        z-index: 1100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        border-radius: 0;
        overflow-y: auto;
    }

    .catalog-sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 1.5rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid #eee;
    }

    .sidebar-close {
        background: none;
        border: none;
        font-size: 1.8rem;
        cursor: pointer;
        line-height: 1;
    }

    .btn-toggle-filters {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        background: #f0f0f0;
        border: 1px solid #ddd;
        padding: 0.35rem 0.75rem;
        border-radius: var(--radius-sm);
        font-size: 0.85rem;
        font-weight: 600;
        cursor: pointer;
    }
}

/* ============================================================
   PAGINACIÓN
   ============================================================ */
.pagination-wrapper {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    list-style: none;
    gap: 0.35rem;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.6rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    color: #444;
    transition: all 0.2s;
}

.page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.page-link:hover:not(.active) {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

/* ============================================================
   DETALLE DE PRODUCTO (VISTA ESTILO MERCADO LIBRE)
   ============================================================ */
.product-detail-container {
    padding-top: 1rem;
    padding-bottom: 3rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    overflow-x: auto;
    white-space: nowrap;
}

.bc-sep {
    color: #bbb;
}

.bc-current {
    color: #222;
    font-weight: 600;
}

.product-detail-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 900px) {
    .product-detail-card {
        grid-template-columns: 1.1fr 1fr;
        padding: 2.5rem;
        gap: 3rem;
    }
}

/* Galería de Producto */
.gallery-wrapper {
    display: flex;
    flex-direction: column-reverse;
    gap: 1rem;
}

@media (min-width: 640px) {
    .gallery-wrapper {
        flex-direction: row;
    }
}

.gallery-thumbs {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    overflow-x: auto;
}

@media (min-width: 640px) {
    .gallery-thumbs {
        flex-direction: column;
        width: 72px;
        flex-shrink: 0;
        overflow-y: auto;
        max-height: 480px;
    }
}

.gallery-thumb {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-color);
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    padding: 2px;
    transition: border-color 0.2s;
    flex-shrink: 0;
}

.gallery-thumb.active, .gallery-thumb:hover {
    border-color: var(--primary);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-main-viewport {
    flex: 1;
    min-height: 320px;
    max-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fdfdfd;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

.main-product-img {
    max-height: 500px;
    width: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.detail-placeholder-img {
    font-size: 5rem;
    color: #ccc;
}

/* Columna de Información */
.detail-header-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.condition-label {
    text-transform: capitalize;
}

.detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .detail-title {
        font-size: 1.8rem;
    }
}

.detail-price-box {
    margin-bottom: 1.5rem;
}

.detail-price-compare {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.2rem;
}

.compare-price-val {
    font-size: 0.95rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.discount-tag {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--secondary);
}

.detail-price-main {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.currency-symbol {
    font-size: 1.5rem;
    font-weight: 400;
    color: #111;
}

.price-amount {
    font-size: 2.2rem;
    font-weight: 700;
    color: #111;
}

/* ============================================================
   SELECTORES DE COLOR Y TALLA (ESTILO MERCADO LIBRE)
   ============================================================ */
.variant-picker-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f0f0f0;
}

.variant-label {
    font-size: 0.95rem;
    color: #444;
    margin-bottom: 0.75rem;
}

.variant-label strong {
    color: #111;
}

/* Selector de Color estilo Mercado Libre */
.color-swatches-large {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.color-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    transition: all 0.2s ease;
}

.color-pill:hover {
    border-color: #999;
}

.color-pill.selected {
    border-color: var(--primary);
    background-color: rgba(52, 131, 250, 0.05);
    box-shadow: 0 0 0 1px var(--primary);
    font-weight: 700;
}

.color-dot {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(0,0,0,0.2);
    display: inline-block;
    flex-shrink: 0;
}

/* Selector de Talla */
.size-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.size-pill {
    min-width: 44px;
    height: 40px;
    padding: 0 0.85rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: all 0.2s;
}

.size-pill:hover {
    border-color: #999;
}

.size-pill.selected {
    border-color: var(--primary);
    background-color: var(--primary);
    color: #ffffff;
}

.modifier-tag {
    font-size: 0.7rem;
    opacity: 0.85;
}

.stock-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #111;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.stock-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
}

.stock-dot.in-stock { background: var(--secondary); }
.stock-dot.out-of-stock { background: var(--danger); }

/* Acciones y Agregar al Carrito */
.detail-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.qty-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #ffffff;
}

.qty-btn {
    width: 38px;
    height: 44px;
    border: none;
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    color: #111;
    background: #f7f7f7;
}

.qty-input {
    width: 44px;
    height: 44px;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    outline: none;
}

.btn-add-cart {
    flex: 1;
    height: 48px;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.detail-perks {
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.perk-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.perk-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.perk-item strong {
    color: #222;
}

.perk-item p {
    color: var(--text-muted);
}

.detail-specs-table {
    margin-bottom: 2rem;
}

.detail-specs-table h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

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

.detail-specs-table tr {
    border-bottom: 1px solid #eee;
}

.detail-specs-table th {
    text-align: left;
    padding: 0.6rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    width: 40%;
}

.detail-specs-table td {
    padding: 0.6rem 0;
    font-size: 0.85rem;
    font-weight: 600;
}

.detail-description h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.description-text {
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.7;
}

.related-products-section {
    margin-top: 3rem;
}

/* ============================================================
   CARRITO DE COMPRAS Y CHECKOUT WHATSAPP
   ============================================================ */
.cart-page-container {
    padding-top: 1.5rem;
    padding-bottom: 4rem;
}

.cart-page-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: #222;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: flex-start;
}

@media (min-width: 960px) {
    .cart-layout {
        grid-template-columns: 1.8fr 1fr;
    }
}

.cart-box, .summary-box {
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
}

.cart-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 1rem;
}

.cart-box-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

.btn-clear-cart {
    background: none;
    border: none;
    font-size: 0.85rem;
    color: var(--danger);
    cursor: pointer;
    font-weight: 500;
}

.btn-clear-cart:hover {
    text-decoration: underline;
}

.cart-item-row {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
    position: relative;
}

.cart-item-row:last-child {
    border-bottom: none;
}

.cart-item-thumb {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #f8f8f8;
    flex-shrink: 0;
    border: 1px solid #eee;
}

.cart-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-thumb-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 0.35rem;
    display: block;
}

.cart-item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.cart-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    background: #f3f4f6;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    color: #4b5563;
}

.pill-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(0,0,0,0.2);
}

.cart-item-unit-price {
    font-size: 0.8rem;
    color: var(--text-light);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.cart-qty-box {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.cart-qty-btn {
    width: 30px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-qty-btn:hover {
    background: #f0f0f0;
}

.cart-qty-val {
    min-width: 32px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
}

.cart-item-subtotal {
    font-size: 1.05rem;
    font-weight: 700;
    min-width: 85px;
    text-align: right;
}

.cart-item-remove {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}

.cart-item-remove:hover {
    color: var(--danger);
}

/* Columna Resumen */
.summary-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 0.75rem;
}

.coupon-box {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.coupon-input-group {
    display: flex;
    gap: 0.5rem;
}

.coupon-input {
    flex: 1;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    outline: none;
    text-transform: uppercase;
}

.btn-apply-coupon {
    padding: 0.45rem 0.85rem;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

.coupon-feedback {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-sm);
}

.coupon-feedback.success {
    background: #d1fae5;
    color: #065f46;
}

.coupon-feedback.error {
    background: #fee2e2;
    color: #991b1b;
}

.discount-val {
    color: var(--secondary);
    font-weight: 700;
}

.summary-divider {
    height: 1px;
    background: #eee;
    margin: 1rem 0;
}

.total-row {
    font-size: 1.25rem;
    font-weight: 800;
    color: #111;
}

.total-val {
    color: #111;
}

/* Formulario Checkout */
.checkout-form-box {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #222;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 0.35rem;
}

.required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #ffffff;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 131, 250, 0.15);
}

/* Botón WhatsApp */
.btn-whatsapp {
    width: 100%;
    padding: 0.9rem 1.25rem;
    background-color: var(--whatsapp);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
    transition: background 0.2s, transform 0.2s;
}

.btn-whatsapp:hover {
    background-color: var(--whatsapp-hover);
    transform: translateY(-1px);
}

.whatsapp-note {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.75rem;
    text-align: center;
    line-height: 1.4;
}

/* Pantalla de Confirmación de Pedido */
.order-completed-box {
    background: #ffffff;
    padding: 3rem 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.completed-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.order-code-text {
    font-size: 1.2rem;
    margin: 1rem 0;
    color: #1f2937;
}

.completed-subtext {
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 2rem;
}

.completed-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ============================================================
   ESTADOS VACÍOS, ALERTAS Y BOTONES COMUNES
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.empty-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.empty-state h2, .empty-state h3 {
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
    color: #222;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: #4b5563;
}

.btn-outline:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: var(--danger-hover);
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.05rem;
}

.btn-block {
    width: 100%;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Alertas */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }

.alert-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}

/* Toast flotante */
.cart-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: #1f2937;
    color: #ffffff;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.cart-toast.visible {
    transform: translateY(0);
    opacity: 1;
}

.toast-link {
    color: #60a5fa;
    font-weight: 700;
}

/* ============================================================
   PIE DE PÁGINA (FOOTER)
   ============================================================ */
.footer {
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    padding-top: 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-bottom: 2.5rem;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1.5fr;
    }
}

.footer-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #111;
}

.footer-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-contact p {
    font-size: 0.85rem;
    color: #333;
    margin-bottom: 0.3rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

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

.footer-badges {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.security-badge {
    font-size: 0.75rem;
    background: #f3f4f6;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    color: #4b5563;
    font-weight: 600;
}

.footer-bottom {
    background: #f9fafb;
    border-top: 1px solid #f0f0f0;
    padding: 1.25rem 0;
}

.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-light);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.admin-link {
    color: var(--text-light);
    text-decoration: underline;
}

/* ============================================================
   PANEL ADMINISTRATIVO (ESTILOS COMPLETOS)
   ============================================================ */
.admin-body {
    background-color: #f1f5f9;
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: #0f172a;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.admin-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.2rem;
}

.sidebar-close-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
}

.admin-nav {
    padding: 1rem 0;
    overflow-y: auto;
    flex: 1;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    color: #94a3b8;
    transition: all 0.2s;
}

.admin-nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.admin-nav-link.active {
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
}

.admin-nav-link.logout {
    color: #f87171;
}

.admin-nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0.75rem 0;
}

.admin-main-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-topbar {
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
}

.topbar-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
}

.topbar-user {
    font-size: 0.85rem;
    color: #64748b;
}

.admin-content-view {
    padding: 1.5rem;
    flex: 1;
}

@media (max-width: 900px) {
    .admin-sidebar {
        transform: translateX(-100%);
        z-index: 1000;
        width: 270px;
        box-shadow: none;
    }
    .admin-sidebar.open {
        transform: translateX(0);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    }
    .admin-sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 999;
        backdrop-filter: blur(2px);
    }
    .admin-sidebar-backdrop.open {
        display: block;
    }
    .admin-main-area {
        margin-left: 0;
        width: 100%;
        min-width: 0;
    }
    .admin-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: var(--radius-sm);
        background: #f1f5f9;
        font-size: 1.25rem;
    }
    .sidebar-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
    }
}

/* Adaptaciones móviles del panel de administración */
.admin-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
}

@media (max-width: 768px) {
    .admin-content-view {
        padding: 0.85rem 0.5rem;
    }

    .admin-topbar {
        padding: 0 0.75rem;
        height: 52px;
    }

    .topbar-title {
        font-size: 0.95rem;
        max-width: 160px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-user {
        font-size: 0.75rem;
    }

    .topbar-user span strong {
        max-width: 70px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
        vertical-align: bottom;
    }

    .admin-card, .admin-panel {
        padding: 0.85rem 0.65rem;
        margin-bottom: 1rem;
        border-radius: var(--radius-sm);
    }

    .admin-page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
        margin-bottom: 1rem;
    }

    .admin-page-header h1 {
        font-size: 1.25rem;
    }

    .admin-page-header .header-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .admin-page-header .btn {
        width: 100%;
        justify-content: center;
        padding: 0.6rem;
    }

    .admin-search-form {
        max-width: 100%;
        width: 100%;
        display: flex;
        gap: 0.35rem;
    }

    .admin-search-input {
        flex: 1;
        min-width: 0;
        font-size: 0.85rem;
    }

    .orders-filter-tabs {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
        gap: 0.35rem;
    }

    /* Tabla administrativa en móvil: no colapsar columnas */
    .admin-table {
        min-width: 680px;
    }

    .admin-table th, .admin-table td {
        padding: 0.65rem 0.5rem;
        font-size: 0.82rem;
        white-space: nowrap;
    }

    /* El nombre del producto puede tener hasta 2 líneas */
    .admin-table td:nth-child(2) {
        white-space: normal;
        min-width: 150px;
        max-width: 220px;
    }

    .product-name-link {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.25;
    }

    .table-thumb, .table-thumb-placeholder {
        width: 40px;
        height: 40px;
    }

    .action-buttons {
        gap: 0.25rem;
    }

    .action-buttons .btn {
        padding: 0.25rem 0.45rem;
        font-size: 0.75rem;
    }

    /* Formularios en móvil */
    .form-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .form-row .form-group,
    .form-row > div[style*="flex"] {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Variantes en móvil */
    .color-variants-grid {
        grid-template-columns: 1fr;
    }

    .gallery-admin-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* Dashboard Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.stat-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f172a;
}

.stat-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.stat-sub {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.5rem;
}

.admin-panels-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .admin-panels-grid {
        grid-template-columns: 1.2fr 1fr;
    }
}

.admin-panel, .admin-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.panel-header, .card-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.panel-header h2, .card-inner-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}

/* Tablas Admin */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.admin-table th {
    text-align: left;
    padding: 0.75rem 0.85rem;
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.admin-table td {
    padding: 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: #f8fafc;
}

.text-right { text-align: right !important; }
.text-muted { color: #94a3b8; }
.line-through { text-decoration: line-through; }

.table-thumb {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid #e2e8f0;
}

.table-thumb-placeholder {
    width: 46px;
    height: 46px;
    background: #f1f5f9;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-product-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
}

.order-code-badge, .coupon-code-badge {
    background: #e2e8f0;
    color: #0f172a;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.85rem;
    font-weight: 700;
}

.stock-badge.in { color: #10b981; font-weight: 700; }
.stock-badge.out { color: #ef4444; font-weight: 700; }

.action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
}

.inline-form {
    display: inline-block;
}

.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-page-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
}

.page-subtitle {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.2rem;
}

.admin-search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-width: 400px;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #334155;
}

.custom-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-card-narrow {
    max-width: 650px;
}

/* Variantes Admin (Color, Talla, Galería) */
.color-variants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.color-variant-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    background: #f8fafc;
}

.color-card-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.color-swatch-badge {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #cbd5e1;
    flex-shrink: 0;
}

.color-card-info {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
}

.hex-text, .stock-text {
    font-size: 0.75rem;
    color: #64748b;
}

.color-card-img-wrap {
    height: 120px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
    border: 1px solid #e2e8f0;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-card-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-img-text {
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
    padding: 0.5rem;
}

.color-card-actions {
    display: flex;
    gap: 0.45rem;
    align-items: center;
}

.color-card-actions .btn {
    flex: 1;
}

.color-card-edit {
    animation: fadeInDropdown 0.2s ease-out;
}

.color-edit-actions {
    display: flex;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.color-edit-actions .btn {
    flex: 1;
}

.form-label-sm {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.2rem;
    display: block;
}

.form-control-sm {
    padding: 0.35rem 0.55rem;
    font-size: 0.82rem;
    height: auto;
}

.color-picker-input-sm {
    width: 100%;
    height: 32px;
    padding: 2px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

/* Edición inline de tallas */
.size-edit-inline-form {
    display: flex;
    align-items: flex-end;
}

.size-edit-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    width: 100%;
}

.size-field {
    display: flex;
    flex-direction: column;
}

.size-edit-btns {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.add-variant-box {
    background: #f1f5f9;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
    border: 1px dashed #cbd5e1;
}

.add-variant-box h3 {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: #1e293b;
}

.gallery-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.gallery-admin-item {
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.gallery-admin-item.is-primary {
    border-color: var(--primary);
}

.gallery-admin-thumb {
    width: 100%;
    height: 110px;
    object-fit: cover;
}

.gallery-item-actions {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.badge-primary-photo {
    font-size: 0.7rem;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    margin: 0.35rem 0.5rem 0;
    display: inline-block;
}

.size-badge-pill {
    background: #e2e8f0;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
}

/* Banners Admin */
.banners-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.banner-admin-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.banner-admin-thumb {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.banner-admin-content {
    padding: 1rem;
}

.banner-admin-content h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.banner-admin-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    font-size: 0.8rem;
}

.banner-admin-actions {
    padding: 0.75rem 1rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Detalle Pedido Admin */
.order-detail-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 960px) {
    .order-detail-layout {
        grid-template-columns: 2fr 1fr;
    }
}

.customer-info-list {
    list-style: none;
    font-size: 0.9rem;
}

.customer-info-list li {
    padding: 0.55rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.info-label {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 0.15rem;
}

.note-box {
    background: #f8fafc;
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.orders-filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.75rem;
}

.tab-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.tab-link:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.tab-link.active {
    background: var(--primary);
    color: #ffffff;
}

.settings-group-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.settings-group-title {
    font-size: 1.15rem;
    margin-bottom: 1.25rem;
    color: #0f172a;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .settings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-picker-input {
    width: 44px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 2px;
}

.badge-help {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
    margin-left: 0.5rem;
}

/* Pantalla Login */
.login-body {
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
}

.login-box {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo-icon {
    font-size: 2.5rem;
}

.login-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
}

.login-subtitle {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.75rem;
    font-size: 0.85rem;
    color: var(--primary);
}

/* Botón Mostrar/Ocultar Contraseña en Login */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-control {
    padding-right: 2.75rem;
}

.password-toggle-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
}

.password-toggle-btn:hover {
    color: #475569;
    background: #f1f5f9;
}


/* ============================================================
   SISTEMA DE AUTENTICACION Y PESTANAS
   ============================================================ */
.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color, #e2e8f0);
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 0.65rem 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.auth-tab:hover {
    color: var(--primary, #3b82f6);
}

.auth-tab.active {
    color: var(--primary, #3b82f6);
    border-bottom-color: var(--primary, #3b82f6);
}

/* ============================================================
   PORTAL DE CLIENTE Y MIS COMPRAS (ESTILO MERCADO LIBRE)
   ============================================================ */
.account-container {
    max-width: 1040px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.account-header-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg, #ffffff);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-md, 12px);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
    border: 1px solid var(--border-color, #e2e8f0);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.account-user-info {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.account-avatar-circle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
    flex-shrink: 0;
}

.account-greeting {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    color: var(--text-main, #1e293b);
}

.account-meta {
    font-size: 0.88rem;
    color: var(--text-muted, #64748b);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge-role-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
}

.badge-role-inline.role-admin {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.badge-role-inline.role-staff {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.badge-role-inline.role-customer {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.account-nav-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    padding-bottom: 0.25rem;
}

.account-tab {
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-muted, #64748b);
    text-decoration: none;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.account-tab:hover {
    color: var(--primary, #3b82f6);
}

.account-tab.active {
    color: var(--primary, #3b82f6);
    border-bottom-color: var(--primary, #3b82f6);
    background: var(--card-bg, #ffffff);
}

/* Tarjetas de Estadisticas de Cliente Estilo ML */
.customer-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.stat-card-ml {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.04));
    transition: transform 0.2s;
}

.stat-card-ml:hover {
    transform: translateY(-2px);
}

.stat-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main, #1e293b);
    line-height: 1.2;
}

.stat-title {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    margin-top: 0.15rem;
    font-weight: 500;
}

/* Tarjeta de Orden de Compra */
.customer-order-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.04));
    transition: border-color 0.2s;
}

.customer-order-card:hover {
    border-color: #cbd5e1;
}

.order-card-top {
    padding: 1rem 1.4rem;
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.order-code-badge {
    font-weight: 800;
    color: var(--text-main, #1e293b);
    font-size: 0.95rem;
}

.order-date-text {
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
    margin-left: 0.75rem;
}

.order-status-pill {
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
}

.status-badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge-confirmed {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge-process {
    background: #ede9fe;
    color: #5b21b6;
}

.status-badge-shipping {
    background: #cffafe;
    color: #155e75;
}

.status-badge-delivered {
    background: #d1fae5;
    color: #065f46;
}

.status-badge-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.order-items-wrapper {
    padding: 1rem 1.4rem;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px dashed var(--border-color, #e2e8f0);
}

.order-item-row:last-child {
    border-bottom: none;
}

.item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main, #1e293b);
    margin-bottom: 0.35rem;
}

.item-variants-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag-variant {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.78rem;
    color: var(--text-muted, #475569);
}

.tag-qty {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
}

.item-price {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main, #1e293b);
}

.order-card-bottom {
    padding: 1rem 1.4rem;
    background: rgba(0, 0, 0, 0.015);
    border-top: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.order-totals-summary {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.order-discount-badge {
    font-size: 0.8rem;
    color: #ef4444;
    font-weight: 600;
    background: #fee2e2;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

.order-final-total {
    font-size: 1.15rem;
    color: var(--text-main, #1e293b);
}

.order-final-total strong {
    font-size: 1.25rem;
    color: var(--primary, #3b82f6);
}

.btn-whatsapp-order {
    background: #25d366;
    color: #ffffff;
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.3);
    transition: background 0.2s, transform 0.2s;
}

.btn-whatsapp-order:hover {
    background: #20ba5a;
    transform: translateY(-1px);
    color: #ffffff;
}

.empty-orders-card {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
}

.empty-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.empty-orders-card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.empty-orders-card p {
    color: var(--text-muted, #64748b);
    max-width: 440px;
    margin: 0 auto;
}

/* Formularios de Perfil de Cliente */
.account-grid-forms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 1.5rem;
}

.account-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.04));
}

.card-header-styled {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.card-header-styled h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.card-header-styled p {
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
}

.account-form {
    display: flex;
    flex-direction: column;
}

/* ============================================================
   GESTION DE USUARIOS Y ROLES (ADMINISTRADOR)
   ============================================================ */
.user-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.user-stat-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: all 0.2s;
}

.user-stat-card:hover,
.user-stat-card.active {
    border-color: var(--primary, #3b82f6);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.user-stat-card .stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.user-stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    font-weight: 600;
}

.role-admin-color { color: #8b5cf6; }
.role-staff-color { color: #3b82f6; }
.role-customer-color { color: #10b981; }

.user-table-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.role-badge-admin {
    background: #ede9fe;
    color: #6d28d9;
}

.role-badge-staff {
    background: #dbeafe;
    color: #1e40af;
}

.role-badge-customer {
    background: #d1fae5;
    color: #065f46;
}

.badge-you {
    font-size: 0.72rem;
    background: #f1f5f9;
    color: #475569;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 0.3rem;
}

.status-toggle-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    transition: all 0.2s;
}

.status-toggle-btn.active {
    background: #dcfce7;
    color: #166534;
}

.status-toggle-btn.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.role-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.role-option-card {
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    transition: all 0.2s;
}

.role-option-card:hover {
    border-color: #cbd5e1;
}

.role-option-card input[type="radio"]:checked + .role-card-content {
    color: var(--primary, #3b82f6);
}

.role-option-card:has(input[type="radio"]:checked) {
    border-color: var(--primary, #3b82f6);
    background: rgba(59, 130, 246, 0.04);
}

.role-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.role-desc {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    line-height: 1.35;
    margin: 0;
}

/* Modo oscuro para estos nuevos componentes */
[data-theme="dark"] .account-header-box,
[data-theme="dark"] .customer-order-card,
[data-theme="dark"] .stat-card-ml,
[data-theme="dark"] .account-card,
[data-theme="dark"] .empty-orders-card,
[data-theme="dark"] .user-stat-card {
    background: #18181b;
    border-color: #27272a;
}

[data-theme="dark"] .order-card-top,
[data-theme="dark"] .order-card-bottom {
    background: #1e1e22;
    border-color: #27272a;
}

[data-theme="dark"] .account-tab.active {
    background: #18181b;
    color: #60a5fa;
}

[data-theme="dark"] .role-option-card {
    border-color: #27272a;
}

[data-theme="dark"] .role-option-card:has(input[type="radio"]:checked) {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}
