/* Estilos principales de la tienda virtual */

/* Variables CSS - Sistema de Temas */
:root {
    /* Colores base del sistema */
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --sidebar-width: 280px;
    
    /* TEMA CLARO (por defecto) */
    --bg-color: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-color: #212529;
    --text-muted: #6c757d;
    --text-inverse: #ffffff;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
    
    /* Sidebar - Tema Claro */
    --sidebar-bg: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    --sidebar-text: #ecf0f1;
    --sidebar-hover: rgba(52, 152, 219, 0.1);
    
    /* Cards y elementos */
    --card-bg: #ffffff;
    --card-border: #dee2e6;
    --card-shadow: rgba(0, 0, 0, 0.1);
    
    /* Navbar */
    --navbar-bg: #343a40;
    --navbar-text: #ffffff;
    
    /* Botones */
    --btn-bg: var(--bg-color);
    --btn-border: var(--border-color);
    --btn-text: var(--text-color);
    
    /* Inputs */
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --input-text: #495057;
    --input-focus: rgba(0, 123, 255, 0.25);
}

/* TEMA OSCURO */
[data-theme="dark"] {
    /* Fondos */
    --bg-color: #1a1a1a;
    --bg-secondary: #2d2d30;
    --bg-tertiary: #3e3e42;
    --text-color: #ffffff;
    --text-muted: #b3b3b3;
    --text-inverse: #1a1a1a;
    --border-color: #404040;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.4);
    
    /* Sidebar - Tema Oscuro */
    --sidebar-bg: linear-gradient(180deg, #1e1e1e 0%, #2d2d30 100%);
    --sidebar-text: #ffffff;
    --sidebar-hover: rgba(52, 152, 219, 0.2);
    
    /* Cards y elementos */
    --card-bg: #2d2d30;
    --card-border: #404040;
    --card-shadow: rgba(0, 0, 0, 0.3);
    
    /* Navbar */
    --navbar-bg: #1a1a1a;
    --navbar-text: #ffffff;
    
    /* Botones */
    --btn-bg: var(--bg-tertiary);
    --btn-border: var(--border-color);
    --btn-text: var(--text-color);
    
    /* Inputs */
    --input-bg: #2d2d30;
    --input-border: #404040;
    --input-text: #ffffff;
    --input-focus: rgba(52, 152, 219, 0.4);
}

/* Estilos generales con soporte para temas */
body {
    font-family: var(--font-family);
    padding-top: 62px!important; /* Para el navbar fixed */
    padding-left: 0 !important;
    padding-right: 0 !important;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container-fluid {
    padding-left: 0px!important;
    padding-right: 0px!important;
}

.mt-5 {
    margin-top: 0rem !important;
}

.main-content {
    min-height: calc(100vh - 200px);
}

/* Navbar con soporte de temas */
.navbar {
    background-color: var(--navbar-bg) !important;
    transition: background-color 0.3s ease;
}

.navbar-brand, .navbar-nav .nav-link {
    color: var(--navbar-text) !important;
    transition: color 0.3s ease;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* ===========================================
   SIDEBAR MODERNO
   =========================================== */

/* Botón flotante para abrir sidebar */
.sidebar-toggle {
    position: fixed;
    top: 15px;
    right: 15px; /* Cambiado de left a right */
    z-index: 1050;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 12px;
    background: var(--sidebar-bg);
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 1; /* Añadido para control de visibilidad */
    visibility: visible; /* Añadido para mejor control de visibilidad */
}

/* Estados de hover y active del botón */
.sidebar-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.sidebar-toggle:active {
    transform: translateY(0);
}

/* Cuando el sidebar está activo, el botón se desvanece y baja z-index */
.sidebar-toggle.active {
    z-index: 1042; /* Menor que sidebar y overlay */
    opacity: 0; /* Se desvanece cuando sidebar está abierto */
    visibility: hidden; /* Se oculta completamente */
    transform: scale(0.8) translateY(-2px); /* Efecto adicional de reducción y movimiento */
}

/* Líneas del hamburger */
.hamburger-line {
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animación del hamburger cuando está activo */
.sidebar-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.sidebar-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.sidebar-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 1045;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar.active {
    transform: translateX(0);
}

/* Header del sidebar */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(236, 240, 241, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px; /* Mismo altura que navbar */
}

.sidebar-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-close:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

/* Contenido del sidebar */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* ==========================================
   TOGGLE DE TEMA EN SIDEBAR
   ========================================== */

.theme-toggle-section {
    padding: 20px;
    border-bottom: 1px solid rgba(236, 240, 241, 0.1);
    display: flex;
    justify-content: center;
}

.theme-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--sidebar-text);
    font-size: 0.9rem;
}

.theme-icon-light, .theme-icon-dark {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Estados del toggle basado en el tema actual */
[data-theme="light"] .theme-icon-light {
    color: #ffc107;
}

[data-theme="light"] .theme-icon-dark {
    color: rgba(236, 240, 241, 0.4);
}

[data-theme="dark"] .theme-icon-light {
    color: rgba(236, 240, 241, 0.4);
}

[data-theme="dark"] .theme-icon-dark {
    color: #74c0fc;
}

/* Botón toggle */
.theme-toggle-btn {
    position: relative;
    width: 50px;
    height: 26px;
    background: rgba(236, 240, 241, 0.2);
    border: 2px solid rgba(236, 240, 241, 0.3);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.theme-toggle-btn:hover {
    background: rgba(236, 240, 241, 0.3);
    border-color: rgba(236, 240, 241, 0.5);
}

.theme-toggle-btn:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

/* Slider del toggle */
.theme-toggle-slider {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Estado tema oscuro */
[data-theme="dark"] .theme-toggle-btn {
    background: rgba(116, 192, 252, 0.2);
    border-color: rgba(116, 192, 252, 0.3);
}

[data-theme="dark"] .theme-toggle-btn:hover {
    background: rgba(116, 192, 252, 0.3);
    border-color: rgba(116, 192, 252, 0.5);
}

[data-theme="dark"] .theme-toggle-slider {
    transform: translateX(22px);
    background: linear-gradient(135deg, #74c0fc, #339af0);
}

/* Información del usuario */
.sidebar-user-info, .sidebar-guest-info {
    padding: 20px;
    border-bottom: 1px solid rgba(236, 240, 241, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar, .guest-avatar {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.user-details, .guest-details {
    flex: 1;
}

.user-name, .guest-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.user-status, .guest-status {
    font-size: 0.875rem;
    margin: 2px 0 0 0;
}

.guest-status a {
    text-decoration: none;
    font-weight: 500;
}

.guest-status a:hover {
    text-decoration: underline;
}

/* Navegación del sidebar */
.sidebar-nav {
    padding: 0;
    z-index: 9999;    
}

.nav-section {
    margin-bottom: 10px;
}

.nav-section-title {
    display: block;
    padding: 15px 20px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #95a5a6;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: white;
    border-left-color: var(--primary-color);
    transform: translateX(5px);
}

.nav-link i {
    width: 20px;
    margin-right: 12px;
    font-size: 1rem;
}

.nav-link span:first-of-type {
    flex: 1;
    font-weight: 500;
}

/* Badge en el menú */
.nav-badge {
    background: var(--danger-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

.nav-badge:empty {
    display: none;
}

/* Enlace de logout especial */
.nav-link.text-danger:hover {
    background: rgba(231, 76, 60, 0.1);
    border-left-color: var(--danger-color);
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 260px;
    }
    
    .sidebar-toggle {
        top: 12px;
        right: 12px; /* Cambiado de left a right */
        width: 45px;
        height: 45px;
    }
    
    .hamburger-line {
        width: 18px;
    }
}

/* Badge del carrito */
.badge {
    font-size: 0.75rem;
}

/* Cards de productos con soporte de temas */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    border: none;
    border-radius: 10px;
    overflow: hidden;
    background-color: var(--card-bg);
    box-shadow: 0 2px 8px var(--card-shadow);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow-hover);
}

.card, .card-body {
    background-color: var(--card-bg);
    color: var(--text-color);
    border-color: var(--card-border);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.product-image {
    height: 250px;
    object-fit: cover;
    width: 100%;
}

.product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--success-color);
}

.product-price-old {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 1rem;
}

/* Botones con soporte de temas */
.btn {
    border-radius: 25px;
    font-weight: 500;
    padding: 8px 20px;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--btn-bg);
    border-color: var(--btn-border);
    color: var(--btn-text);
}

.btn-secondary:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-color);
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), #0056b3);
    border: none;
}

.btn-success {
    background: linear-gradient(45deg, var(--success-color), #1e7e34);
    border: none;
}

.btn-cart {
    width: 100%;
    margin-top: 10px;
}

/* Hero section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: white;
    /* padding: 80px 0; */
    /* margin-bottom: 40px; */
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* Sección de categorías */
.category-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.category-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.category-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* Carrito de compras */
.cart-item {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.quantity-input {
    width: 80px;
    text-align: center;
}

.cart-summary {
    background: var(--light-color);
    border-radius: 10px;
    padding: 20px;
}

/* Formularios con soporte de temas */
.form-control {
    border-radius: 8px;
    border: 2px solid var(--input-border);
    padding: 12px 15px;
    transition: all 0.3s ease;
    background-color: var(--input-bg);
    color: var(--input-text);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem var(--input-focus);
    background-color: var(--input-bg);
    color: var(--input-text);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-weight: 600;
    color: var(--text-color);
}

.form-select {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--input-text);
    transition: all 0.3s ease;
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem var(--input-focus);
}

/* Alertas personalizadas */
.alert {
    border-radius: 10px;
    border: none;
    padding: 15px 20px;
}

/* Paginación */
.pagination {
    justify-content: center;
    margin-top: 30px;
}

.page-link {
    border-radius: 50%;
    margin: 0 5px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.page-link:hover {
    background-color: var(--primary-color);
    color: white;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Breadcrumb */
.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 30px;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: var(--secondary-color);
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal personalizado */
.modal-content {
    border-radius: 15px;
    border: none;
}

.modal-header {
    border-bottom: 1px solid #eee;
    border-radius: 15px 15px 0 0;
}

.modal-footer {
    border-top: 1px solid #eee;
    border-radius: 0 0 15px 15px;
}

/* Footer con soporte de temas */
footer {
    margin-top: auto;
    background-color: var(--navbar-bg) !important;
    color: var(--navbar-text) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

footer h5, footer h6, footer p, footer a {
    color: var(--navbar-text) !important;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--primary-color) !important;
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

/* Elementos adicionales con soporte de temas */
.modal-content {
    background-color: var(--card-bg);
    color: var(--text-color);
    border-color: var(--card-border);
}

.modal-header, .modal-footer {
    border-color: var(--border-color);
}

.table {
    color: var(--text-color);
    background-color: var(--card-bg);
}

.table-striped > tbody > tr:nth-of-type(odd) > td,
.table-striped > tbody > tr:nth-of-type(odd) > th {
    background-color: var(--bg-secondary);
    color: var(--text-color);
}

/* Asegurar que el texto en tablas tenga el color correcto */
.table td, .table th {
    color: var(--text-color);
    border-color: var(--border-color);
}

.breadcrumb-item a {
    color: var(--text-color);
}

.breadcrumb-item.active {
    color: var(--text-muted);
}

/* Lista desplegable con soporte de temas */
.dropdown-menu {
    background-color: var(--card-bg);
    border-color: var(--card-border);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.dropdown-item {
    color: var(--text-color);
}

.dropdown-item:hover {
    background-color: var(--bg-secondary);
    color: var(--text-color);
}

/* CORRECCIONES ESPECÍFICAS PARA PROBLEMAS DE CONTRASTE */

/* 1. Títulos y subtítulos en index.php */
.display-5, .display-4 {
    color: var(--text-color) !important;
}

.lead {
    color: var(--text-muted) !important;
}

/* 2. Títulos de sección y párrafos descriptivos */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-color);
}

.category-card h4 {
    color: var(--text-color);
}

.category-card p {
    color: var(--text-muted);
}

/* 3. Sección con fondo bg-light debe adaptarse a temas */
.bg-light {
    background-color: var(--bg-secondary) !important;
}

/* 4. Corrección para elementos de detalle del producto */
.product-title {
    color: var(--text-color) !important;
}

/* CORRECCIÓN ESPECÍFICA: Label "Cantidad" debe ser NEGRO en modo OSCURO */
[data-theme="dark"] .form-label, 
[data-theme="dark"] .form-label strong {
    color: #000000 !important; /* Negro para contrastar con fondo blanco del label */
}

/* En modo claro, mantener el color normal del tema */
[data-theme="light"] .form-label, 
[data-theme="light"] .form-label strong {
    color: var(--text-color) !important;
}

/* 5. Información de envío - debe usar colores del tema */
.shipping-info {
    background-color: var(--bg-secondary) !important;
    color: var(--text-color) !important;
}

.shipping-info h6 {
    color: var(--text-color) !important;
}

.shipping-info li {
    color: var(--text-color) !important;
}

/* 6. Pestañas de navegación - corrección de contraste */
.nav-tabs .nav-link {
    color: var(--text-muted);
    background-color: transparent;
    border-color: var(--border-color);
}

.nav-tabs .nav-link:not(.active) {
    color: var(--text-color) !important; /* Para pestañas inactivas */
}

/* CORRECCIÓN: Pestañas activas deben tener texto BLANCO sobre fondo azul */
.nav-tabs .nav-link.active {
    color: #ffffff !important; /* Blanco para contrastar con fondo azul */
    background-color: var(--primary-color) !important; /* Fondo azul para pestañas activas */
    border-color: var(--primary-color) !important;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    border-color: var(--border-color);
}

/* 7. Contenido de las pestañas */
.tab-content {
    background-color: var(--card-bg);
    color: var(--text-color);
}

/* 8. Controles de cantidad - asegurar contraste correcto */
/* Modo claro: texto normal */
[data-theme="light"] .quantity-controls .form-control {
    background-color: var(--input-bg);
    color: var(--input-text);
    border-color: var(--input-border);
}

/* Modo oscuro: texto NEGRO para contrastar */
[data-theme="dark"] .quantity-controls .form-control {
    background-color: var(--input-bg);
    color: #000000 !important; /* Negro para contrastar en modo oscuro */
    border-color: var(--input-border);
}

.quantity-controls .btn-outline-secondary {
    background-color: var(--btn-bg);
    color: var(--btn-text);
    border-color: var(--btn-border);
}

.quantity-controls .btn-outline-secondary:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-color);
    border-color: var(--border-color);
}

/* 9. Texto general y elementos con clases específicas */
.text-muted {
    color: var(--text-muted) !important;
}

/* 10. Elementos de características/features */
.feature-item h4 {
    color: var(--text-color);
}

.feature-item p {
    color: var(--text-muted);
}

/* 11. Cards de categorías */
.category-card {
    background-color: var(--card-bg);
    color: var(--text-color);
    border-color: var(--card-border);
}

/* 12. Hero section - mantener contraste en tema oscuro */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: white !important; /* Mantener texto blanco en hero */
}

.hero-section h1, 
.hero-section p, 
.hero-section .lead {
    color: white !important; /* Forzar texto blanco en hero section */
}

/* Texto y elementos generales */
.text-muted {
    color: var(--text-muted) !important;
}

.border {
    border-color: var(--border-color) !important;
}

.border-top {
    border-top-color: var(--border-color) !important;
}

.border-bottom {
    border-bottom-color: var(--border-color) !important;
}

/* ESTILOS ADICIONALES PARA CORRECCIÓN DE CONTRASTE */

/* Asegurar que todos los párrafos usen el color correcto */
p {
    color: var(--text-color);
}

p.text-muted {
    color: var(--text-muted) !important;
}

/* Labels y texto de formularios */
label {
    color: var(--text-color);
}

/* Contenido de tabs */
.tab-pane {
    color: var(--text-color);
}

.tab-pane h5 {
    color: var(--text-color);
}

/* Asegurar que las listas también usen colores correctos */
ul, ol, li {
    color: var(--text-color);
}

/* Específico para la lista de información de envío */
.shipping-info ul li {
    color: var(--text-color) !important;
}

/* Small text */
small {
    color: var(--text-muted);
}

/* Asegurar contraste en elementos con clase bg-light */
.bg-light, .bg-light * {
    background-color: var(--bg-secondary) !important;
    color: var(--text-color) !important;
}

/* Corrección específica para tablas en modo oscuro */
[data-theme="dark"] .table {
    --bs-table-bg: var(--card-bg);
    --bs-table-border-color: var(--border-color);
    --bs-table-striped-bg: var(--bg-secondary);
    --bs-table-active-bg: var(--bg-tertiary);
    --bs-table-hover-bg: var(--bg-secondary);
}

/* Strong y bold text */
strong, b {
    color: var(--text-color);
}

/* Corrección para elementos específicos de Bootstrap */
.list-unstyled li {
    color: var(--text-color);
}

/* Asegurar que los iconos de check mantengan su color */
.text-success {
    color: var(--success-color) !important;
}

/* Input group addons */
.input-group-text {
    background-color: var(--bg-secondary);
    border-color: var(--input-border);
    color: var(--text-color);
}

/* Badges con mejor contraste */
.badge {
    color: white !important; /* Forzar texto blanco en badges */
}

/* Corrección para el texto en cards */
.card-body, .card-text, .card-title {
    color: var(--text-color) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .product-card {
        margin-bottom: 20px;
    }
    
    .cart-image {
        width: 60px;
        height: 60px;
    }
    
    .quantity-input {
        width: 60px;
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .category-card {
        padding: 20px;
    }
    
    .category-icon {
        font-size: 2rem;
    }
}

/* Utilidades */
.text-primary-custom {
    color: var(--primary-color) !important;
}

.bg-primary-custom {
    background-color: var(--primary-color) !important;
}

.shadow-custom {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
}

.border-radius-custom {
    border-radius: 15px !important;
}

/* Animaciones */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* ============================================
   ESTILOS DEL CARRITO
   ============================================ */

/* Página del carrito */
.empty-cart {
    padding: 3rem 0;
}

.cart-product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-recommended-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-controls .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-display {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
}

.table td {
    vertical-align: middle;
}

/* Animaciones del carrito */
.cart-item-remove {
    animation: fadeOutRight 0.5s ease-out forwards;
}

@keyframes fadeOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ==================== ALERTAS PERSONALIZADAS ==================== */

/* Overlay para las alertas modales */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-alert-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Contenedor principal de la alerta */
.custom-alert {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.8) translateY(-20px);
    transition: all 0.3s ease;
}

.custom-alert-overlay.show .custom-alert {
    transform: scale(1) translateY(0);
}

/* Header de la alerta */
.custom-alert-header {
    padding: 20px 20px 15px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.custom-alert-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.custom-alert-icon.success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.custom-alert-icon.error {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
}

.custom-alert-icon.warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.custom-alert-icon.info {
    background: linear-gradient(135deg, #17a2b8, #007bff);
}

.custom-alert-icon.confirm {
    background: linear-gradient(135deg, #6f42c1, #007bff);
}

.custom-alert-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

/* Contenido de la alerta */
.custom-alert-body {
    padding: 20px;
    text-align: center;
}

.custom-alert-message {
    font-size: 1rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* Footer con botones */
.custom-alert-footer {
    padding: 15px 20px 20px;
    text-align: center;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.custom-alert-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.custom-alert-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.custom-alert-btn.primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.custom-alert-btn.success {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
}

.custom-alert-btn.danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.custom-alert-btn.secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.custom-alert-btn.secondary:hover {
    background: #e9ecef;
}

/* Notificaciones tipo toast */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 9998;
    max-width: 350px;
}

.custom-toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    overflow: hidden;
    transform: translateX(100%);
    transition: all 0.3s ease;
    border-left: 4px solid;
}

.custom-toast.show {
    transform: translateX(0);
}

/* Toast notifications mejoradas */
.custom-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 400px;
    background: white;
    border: 1px solid #dee2e6;
    border-left: 4px solid #007bff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.custom-toast.success {
    border-left-color: #28a745;
}

.custom-toast.error {
    border-left-color: #dc3545;
}

.custom-toast.warning {
    border-left-color: #ffc107;
}

.custom-toast.info {
    border-left-color: #17a2b8;
}

.toast-header {
    padding: 12px 15px 8px;
    display: flex;
    align-items: center;
}

/* Ajustes para evitar conflictos con sidebar */
.floating-cart {
    right: 20px;
    bottom: 20px;
    z-index: 1035; /* Menor que sidebar pero mayor que contenido */
}

/* Jerarquía de z-index del sidebar (de menor a mayor):
   1035: floating-cart (botón del carrito)
   1040: sidebar-overlay
   1042: sidebar-toggle.active (botón hamburger cuando sidebar abierto)
   1045: sidebar (el panel lateral)
   1050: sidebar-toggle (botón hamburger cuando sidebar cerrado)
*/

/* Animación de rebote mejorada */
@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

/* Animación del pulso del carrito */
@keyframes cartPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.floating-cart.pulse {
    animation: cartPulse 0.6s ease-in-out;
}

/* Mejoras responsive adicionales */
@media (max-width: 576px) {
    .floating-cart {
        right: 15px;
        bottom: 15px;
        width: 50px;
        height: 50px;
    }
    
    .floating-cart i {
        font-size: 1.1rem;
    }
    
    .floating-cart .cart-count {
        width: 20px;
        height: 20px;
        font-size: 11px;
        top: -3px;
        right: -3px;
    }
    
    .custom-toast {
        min-width: 280px;
        right: 15px;
        top: 15px;
    }
}
    /* gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
} */

.toast-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
}

.toast-body {
    padding: 0 15px 12px;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    color: #666;
}

/* ==================== ESTILOS PARA NOTIFICACIONES DE CARRITO ==================== */

/* Contenido del toast de carrito */
.cart-toast-content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.cart-toast-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #e9ecef;
}

.cart-toast-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-toast-details {
    flex-grow: 1;
    line-height: 1.4;
}

.cart-toast-details strong {
    color: #333;
    font-size: 14px;
}

.cart-toast-actions {
    margin-top: 8px;
}

.cart-toast-actions .btn {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Animación del ícono del carrito */
@keyframes cartBounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

.cart-bounce {
    animation: cartBounce 0.6s ease-in-out;
}

/* Mejoras en el toast para carrito */
.toast.success {
    border-left: 4px solid var(--success-color);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}

.toast.success .toast-header {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

/* Responsive para notificaciones de carrito */
@media (max-width: 768px) {
    .cart-toast-content {
        flex-direction: column;
        gap: 8px;
    }
    
    .cart-toast-image {
        align-self: center;
        width: 40px;
        height: 40px;
    }
    
    .cart-toast-details {
        text-align: center;
    }
}

/* Mejoras para selector de cantidad compacto */
.form-select-sm {
    font-size: 0.875rem;
    border-radius: 0.375rem;
}

.btn.flex-grow-1 {
    flex: 1;
}

/* Responsive para controles de producto */
@media (max-width: 576px) {
    .d-flex.gap-2 {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .form-select-sm {
        width: 100% !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .custom-alert {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .custom-alert-footer {
        flex-direction: column;
    }
    
    .custom-alert-btn {
        width: 100%;
    }
}

/* =============================
   BOTÓN FLOTANTE DEL CARRITO
   ============================= */

.floating-cart {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.floating-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    background: linear-gradient(135deg, #0056b3, #004085);
    color: white;
    text-decoration: none;
}

.floating-cart .cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: bounce 0.6s ease-in-out;
}

.floating-cart .cart-count.hidden {
    display: none;
}

.floating-cart.pulse {
    animation: cartPulse 0.6s ease-in-out;
}

@keyframes cartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Responsivo para móviles */
@media (max-width: 768px) {
    .floating-cart {
        width: 55px;
        height: 55px;
        bottom: 15px;
        right: 15px;
        font-size: 1.1rem;
    }
}

/* =============================
   SELECTORES DE CANTIDAD COMPACTOS
   ============================= */

.qty-selector {
    width: 80px !important;
    font-size: 0.875rem;
}

@media (max-width: 576px) {
    .qty-selector {
        width: 100% !important;
        max-width: 120px;
    }
}

/* ==============================================
   CORRECCIONES ESPECÍFICAS PARA PÁGINAS LEGALES
   ============================================== */

/* Títulos H3 en páginas de políticas y términos - Mayor contraste en modo oscuro */
[data-theme="dark"] .privacy-content h3,
[data-theme="dark"] .terms-content h3 {
    color: #ffffff !important; /* Blanco sólido para máximo contraste */
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Subtítulos H4 en páginas de políticas y términos - Mayor contraste en modo oscuro */
[data-theme="dark"] .privacy-content h4,
[data-theme="dark"] .terms-content h4 {
    color: #e9ecef !important; /* Gris muy claro para buen contraste */
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

/* En modo claro, mantener colores apropiados */
[data-theme="light"] .privacy-content h3,
[data-theme="light"] .terms-content h3 {
    color: var(--text-color);
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

[data-theme="light"] .privacy-content h4,
[data-theme="light"] .terms-content h4 {
    color: var(--text-color);
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

/* ==============================================
   ICONOS DE REDES SOCIALES MEJORADOS
   ============================================== */

/* Estilos base para los botones de redes sociales */
footer .btn-outline-light,
footer .btn-outline-success {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

/* Facebook - Hover con color original */
footer .btn-outline-light:has(.fa-facebook-f):hover {
    background: #1877f2 !important; /* Color oficial de Facebook */
    border-color: #1877f2 !important;
    color: #ffffff !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(24, 119, 242, 0.4);
}

/* Instagram - Hover con gradiente original */
footer .btn-outline-light:has(.fa-instagram):hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important;
    border-color: #e6683c !important;
    color: #ffffff !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(225, 48, 108, 0.4);
}

/* X (Twitter) - Actualizar icono y hover */
footer .btn-outline-light:has(.fa-x-twitter):hover {
    background: #000000 !important; /* Color de X (antes Twitter) */
    border-color: #000000 !important;
    color: #ffffff !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* Crear lo mismo para tiktok  */
footer .btn-outline-light:has(.fa-tiktok):hover {
    background: #ff0050 !important; /* Color oficial de TikTok */
    border-color: #ff0050 !important;
    color: #ffffff !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(255, 0, 80, 0.4);
}

/* WhatsApp - Hover con color original */
footer .btn-outline-success:hover {
    background: #25d366 !important; /* Color oficial de WhatsApp */
    border-color: #25d366 !important;
    color: #ffffff !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.4);
}

/* Efecto adicional para todos los botones sociales */
footer .btn-outline-light:hover,
footer .btn-outline-success:hover {
    transform: translateY(-3px) scale(1.05);
}
