/* 🌙 Modo Oscuro Completo - Visualmente Fiel al Estilo Original */
body.dark-mode {
    background-color: #1c1c1e;
    color: #e4e4e4;
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    padding-top: 100px;
}

/* Header y Footer */
.dark-mode .header,
.dark-mode footer {
    background-color: #1c1c1e;
    color: #ffffff;
}

/* Hero Section */
.dark-mode .hero {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85), rgba(44, 44, 44, 0.85)), url('../images_sitio/hero/hero-background.jpg') center/cover no-repeat;
    color: #fff;
}

.dark-mode .hero-details {
    background: rgba(30, 30, 30, 0.8);
    border-radius: 10px;
}

/* Botones */
.dark-mode .btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.dark-mode .btn-primary:hover {
    background-color: #0a58ca;
    border-color: #084298;
}

/* Tarjetas */
.dark-mode .card,
.dark-mode .product-card,
.dark-mode .video-item,
.dark-mode .drawer,
.dark-mode .modal-content,
.dark-mode pre {
    background-color: #1f1f1f;
    color: #e0e0e0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

.content-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #343a40;
    margin: 0;
    padding: 8px 0;
}

.content-description {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-family: 'Poppins', sans-serif;
    line-height: 1.5;
    color: #f7f4f4;
    font-size: 14px;
}

.content-detail {
    background-color: #1f1f1f;
    color: #e0e0e0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    font-size: 13px;
    padding: 10px;
    border-radius: 5px;
    border-left: 3px solid #007bff;
}


/* Card Hover */
.dark-mode .card:hover,
.dark-mode .video-item:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.8);
}

/* Imagenes - sin filtro destructivo */
.dark-mode .card-img-top,
.dark-mode .product-image img,
.dark-mode .video-item img {
    border-radius: 8px;
}

/* Drawer */
.dark-mode .drawer {
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.5);
}

.dark-mode .close-btn {
    color: #ffffff;
}

.dark-mode .close-btn:hover {
    color: #0d6efd;
}

/* Títulos */
.dark-mode h2,
.dark-mode h3,
.dark-mode .video-title {
    color: #ffffff;
}

/* Etiquetas */
.dark-mode .offer-badge,
.dark-mode .soldout-badge {
    color: #fff;
    background-color: #b00020;
}

/* Sold Out Overlay */
.dark-mode .soldout-overlay {
    background: rgba(0, 0, 0, 0.65);
    color: white;
}

/* Secciones */
.dark-mode .section-light,
.dark-mode .section-dark {
    background-color: #1c1c1e !important;
    color: #e4e4e4 !important;
    background: linear-gradient(to bottom, #1c1c1e, #2d2d2e);
}

body.dark-mode .section-dark {
    background: linear-gradient(to bottom, #1c1c1e, #2d2d2e);
    color: #dcdcdc;
    padding: 60px 20px;
}

body.dark-mode .section-dark h2 {
    color: #64b5f6;
    border-bottom-color: #42a5f5;
}

/* Separador */
.dark-mode .section-divider {
    background: linear-gradient(to right, transparent, #0d6efd, transparent) !important;
}

/* ================================================
   CONTACT CARD & MAP - DARK MODE
   ================================================ */

.dark-mode .contact-card {
    background: #1f1f1f;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.dark-mode .contact-item {
    border-bottom: 1px solid #2d2d2d;
}

.dark-mode .contact-label {
    color: #9ca3af;
}

.dark-mode .contact-value {
    color: #e0e0e0;
}

.dark-mode .contact-value a {
    color: #4d9fff;
}

.dark-mode .contact-value a:hover {
    color: #6eb0ff;
}

.dark-mode .map-container {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
}

.dark-mode .open-maps-btn {
    background: #2d2d2d;
    color: #e0e0e0;
}

.dark-mode .open-maps-btn:hover {
    background: #3a3a3a;
    color: #ffffff;
}

/* Casa Matriz - modo oscuro (destacada) */
.dark-mode .casa-matriz-card {
    background: linear-gradient(#1f1f1f, #1f1f1f) padding-box,
                linear-gradient(135deg, #667eea 0%, #764ba2 100%) border-box;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
}

.dark-mode .casa-matriz-card:hover {
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.35);
}

.dark-mode .casa-matriz-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.dark-mode .casa-matriz-card__title {
    color: #e0e0e0;
}

/* Sucursales - modo oscuro */
.dark-mode .sucursales-section {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .sucursales-section .h4,
.dark-mode .sucursales-section .text-muted {
    color: #e0e0e0;
}

.dark-mode .sucursales-section .text-muted {
    color: #9ca3af;
}

.dark-mode .sucursal-card {
    background: #1f1f1f;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.dark-mode .sucursal-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8);
}

.dark-mode .sucursal-card__title {
    color: #e0e0e0;
}

.dark-mode .sucursal-card .contact-item.sucursal-card__item {
    border-bottom-color: #2d2d2d;
}

.dark-mode .sucursal-card .contact-label {
    color: #9ca3af;
}

.dark-mode .sucursal-card .contact-value,
.dark-mode .sucursal-card .contact-value a {
    color: #e0e0e0;
}

.dark-mode .sucursal-card__link,
.dark-mode .sucursal-card .contact-value a {
    color: #4d9fff;
}

.dark-mode .sucursal-card__link:hover,
.dark-mode .sucursal-card .contact-value a:hover {
    color: #6eb0ff;
}

.dark-mode .sucursal-card__actions .btn-outline-primary {
    border-color: #4d9fff;
    color: #4d9fff;
}

.dark-mode .sucursal-card__actions .btn-outline-primary:hover {
    background: rgba(77, 159, 255, 0.2);
    color: #6eb0ff;
}

/* ================================================
   GALERÍA DE VIDEO - DARK MODE
   ================================================ */

.dark-mode .video-gallery {
    background-color: transparent;
}

/* Reproductor principal */
.dark-mode .main-video .player-wrapper {
    background: #0a0a0a;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
}

.dark-mode .main-video .player-wrapper > div,
.dark-mode .main-video .player-wrapper iframe,
.dark-mode #playerGallery {
    border-radius: 12px;
}

/* Items de video */
.dark-mode .video-item {
    background-color: #1f1f1f;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.dark-mode .video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.8);
}

/* Estado activo en dark mode */
.dark-mode .video-item.active {
    border: 2px solid #4d9fff;
    box-shadow: 0 4px 12px rgba(77, 159, 255, 0.5);
}

.dark-mode .video-item.active .video-title {
    color: #4d9fff;
    font-weight: 600;
}

/* Miniaturas */
.dark-mode .video-item img {
    background: #2a2a2a;
    border: 1px solid #333;
}

/* Títulos */
.dark-mode .video-title {
    color: #dddddd;
}

/* Scrollbar para lista de videos en dark mode */
.dark-mode .video-list::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.dark-mode .video-list::-webkit-scrollbar-thumb {
    background: #555;
}

.dark-mode .video-list::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Carrusel */
.dark-mode .carousel-control-prev,
.dark-mode .carousel-control-next {
    filter: invert(1);
}

/* Zoom Hover */
.dark-mode .zoom-hover img {
    transition: transform 0.4s ease;
}

.dark-mode .zoom-hover:hover img {
    transform: scale(1.1);
}

.text-muted {
    --bs-text-opacity: 1;
    color: #dddddd !important;
    font-size: smaller !important;
}

.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, transform;
}

.fade-in-section.visible {
    opacity: 1;
    transform: none;
}

/* Ajustes de contraste adicionales para vistaEmpresa / detalleProducto */
.dark-mode, .dark-mode .container { color: #e4e4e4; }

.dark-mode .content-text { color: #e4e4e4 !important; }
.dark-mode .section-dark { color: #dcdcdc !important; }

.dark-mode a, .dark-mode a:link, .dark-mode a:visited { color: #67aef8; }
.dark-mode a:hover { color: #9fd0ff; text-decoration: underline; }

.dark-mode .btn-outline-primary { color: #dcefff; border-color: rgba(220,235,255,0.12); }
.dark-mode .btn-outline-primary:hover { background-color: rgba(102,175,255,0.08); }

.dark-mode .product-title, .dark-mode .product-category a { color: #ffffff; }
.dark-mode .product-price .current-price { color: #ffd966; font-weight: 700; }

.dark-mode .product-description p,
.dark-mode .tab-content-wrapper p,
.dark-mode .product-details-tabs .tab-pane { color: #e0e0e0; }

.dark-mode .breadcrumb, .dark-mode header { background: #111 !important; color: #e4e4e4 !important; }
.dark-mode .breadcrumb a { color: #bcd7ff !important; }

.dark-mode .badge-descuento { background: #ff6b6b; color: #fff; }
.dark-mode .badge-agotado { background: #b00020; color: #fff; }

/* Small tweaks for readability */
.dark-mode .related-product-info h5 { color: #f1f1f1; }
.dark-mode .drawer, .dark-mode .drawer-content { background: #141414; color: #e6e6e6; }

/* ============================================ */
/* COMPREHENSIVE DARK-MODE STYLES FOR noticiaDrawer */
/* ============================================ */

body.dark-mode .drawer {
    background-color: #1f1f1f !important;
    background: #1f1f1f !important;
}

body.dark-mode .drawer-content {
    background-color: #1c1c1e !important;
    color: #e0e0e0 !important;
}

body.dark-mode #noticiaDrawer {
    background-color: #1f1f1f !important;
}

body.dark-mode #noticiaDrawer .text-primary {
    color: #67aef8 !important;
}

body.dark-mode #noticiaDrawer .text-muted {
    color: #b0b0b0 !important;
}

body.dark-mode #noticiaDrawer .text-secondary {
    color: #9e9e9e !important;
}

body.dark-mode #noticiaDrawer .noticia-contenido {
    background: #1c1c1e !important;
    color: #e0e0e0 !important;
}

body.dark-mode #noticiaDrawer p,
body.dark-mode #noticiaDrawer span,
body.dark-mode #noticiaDrawer div:not([class*='bg-']) {
    color: #e0e0e0 !important;
}

body.dark-mode #noticiaDrawer .display-6,
body.dark-mode #noticiaDrawer h2,
body.dark-mode #noticiaDrawer h3,
body.dark-mode #noticiaDrawer h4,
body.dark-mode #noticiaDrawer h5,
body.dark-mode #noticiaDrawer h6 {
    color: #ffffff !important;
}

body.dark-mode #noticiaDrawer img {
    border: 1px solid #444 !important;
    background-color: #2a2a2a !important;
}

body.dark-mode #noticiaDrawer iframe {
    border: 1px solid #444 !important;
    background-color: #2a2a2a !important;
}

body.dark-mode #noticiaDrawer a {
    color: #67aef8 !important;
    text-decoration: none;
}

body.dark-mode #noticiaDrawer a:hover {
    color: #9fd0ff !important;
    text-decoration: underline;
}

body.dark-mode #noticiaDrawer pre {
    background-color: #0d0d0d !important;
    color: #e0e0e0 !important;
    border: 1px solid #3a3a3a !important;
    padding: 15px !important;
    border-radius: 5px !important;
}

body.dark-mode #noticiaDrawer code {
    background-color: #0d0d0d !important;
    color: #e0e0e0 !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
}

body.dark-mode #noticiaDrawer blockquote {
    background-color: #2a2a2a !important;
    border-left: 4px solid #0056B3 !important;
    color: #e0e0e0 !important;
    padding: 15px !important;
    margin: 15px 0 !important;
}

body.dark-mode #noticiaDrawer hr {
    border-color: #3a3a3a !important;
    opacity: 1;
}

body.dark-mode #noticiaDrawer .lead {
    color: #e0e0e0 !important;
}

/* Tabs minimalistas en modo oscuro */
body.dark-mode .productos-tabs {
    background: transparent;
    border: none;
}

body.dark-mode .productos-tabs::-webkit-scrollbar-track {
    background: #2a2a2a;
}

body.dark-mode .productos-tabs::-webkit-scrollbar-thumb {
    background: #4a4a4a;
}

body.dark-mode .productos-tabs::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

body.dark-mode .productos-tabs .nav-link {
    color: #adb5bd;
}

body.dark-mode .productos-tabs .nav-link:hover {
    color: #64b5f6;
}

body.dark-mode .productos-tabs .nav-link.active {
    color: #64b5f6;
}

body.dark-mode .productos-tabs .nav-link::after {
    background: linear-gradient(90deg, #64b5f6, #42a5f5);
}

/* ============================================ */
/* PÁGINA PRODUCTOS (productos.php)            */
/* ============================================ */

body.dark-mode .contenedor {
    background-color: transparent;
    color: #e4e4e4;
}

body.dark-mode .section-light,
body.dark-mode #resena.section-light {
    background-color: #1c1c1e !important;
    color: #e4e4e4;
}

body.dark-mode .section-resena-title {
    color: #ffffff !important;
}

body.dark-mode .filters-panel {
    background-color: #1f1f1f !important;
    border: 1px solid #333;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

body.dark-mode .filters-panel h3,
body.dark-mode .filters-panel .h5 {
    color: #e4e4e4 !important;
}

body.dark-mode .filtro label {
    color: #d0d0d0 !important;
}

body.dark-mode .filtro .form-control,
body.dark-mode .filtro .form-select {
    background-color: #2a2a2a !important;
    color: #e4e4e4 !important;
    border-color: #444 !important;
}

body.dark-mode .filtro .form-control:focus,
body.dark-mode .filtro .form-select:focus {
    background-color: #333 !important;
    border-color: #4d9fff !important;
    box-shadow: 0 0 0 0.2rem rgba(77, 159, 255, 0.25);
}

body.dark-mode .productos {
    color: #e4e4e4;
}

/* Cards unificadas en modo oscuro (vistaEmpresa, productos, detalleProducto) */
body.dark-mode .card-unified {
    background-color: #1f1f1f !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

body.dark-mode .card-unified:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

body.dark-mode .card-unified__body,
body.dark-mode .card-unified__title,
body.dark-mode .card-unified__description {
    color: #e4e4e4 !important;
}

body.dark-mode .card-unified__image-wrapper {
    background-color: #2a2a2a !important;
}

body.dark-mode .card-unified a.text-dark,
body.dark-mode .card-unified .card-title-link {
    color: #9fd0ff !important;
}

body.dark-mode .card-unified a.text-dark:hover,
body.dark-mode .card-unified .card-title-link:hover {
    color: #b8dcff !important;
}

body.dark-mode .card-unified .text-primary,
body.dark-mode .card-unified__price {
    color: #ffd966 !important;
}

body.dark-mode .card-unified .text-muted {
    color: #b0b0b0 !important;
}

/* Mini-preview carrito y diálogo éxito */
body.dark-mode .mini-carrito-preview {
    background-color: #1f1f1f !important;
    color: #e4e4e4 !important;
    border: 1px solid #444;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

body.dark-mode .mini-carrito-preview div[style*="color: #667eea"] {
    color: #7ba3ff !important;
}

body.dark-mode #msjeDialogo {
    background-color: #1f1f1f !important;
    color: #e4e4e4 !important;
    border: 1px solid #444;
}

body.dark-mode #msjeDialogo p {
    color: #e4e4e4 !important;
}

body.dark-mode #msjeDialogo button {
    color: #fff !important;
}

/* Paginación productos */
body.dark-mode .pagination .page-link {
    background-color: #2a2a2a !important;
    color: #e4e4e4 !important;
    border-color: #444 !important;
}

body.dark-mode .pagination .page-item.active .page-link {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #fff !important;
}

body.dark-mode .pagination .page-link:hover {
    background-color: #333 !important;
    color: #9fd0ff !important;
}

/* Detalle producto: compartir y sección relacionados */
body.dark-mode .share-label {
    color: #e4e4e4 !important;
}

body.dark-mode .related-products {
    background-color: #1c1c1e !important;
    border: 1px solid #333;
}

body.dark-mode .related-products .section-title {
    color: #ffffff !important;
}

body.dark-mode .stock-info.out-of-stock {
    color: #ff6b6b !important;
}