/* ═══════════════════════════════════════════════════════════
   Tema oscuro  ·  html[data-theme="dark"]
   (Bootstrap ya recibe data-bs-theme="dark"; aquí van las piezas propias de la tienda)
═══════════════════════════════════════════════════════════ */
html[data-theme="dark"] {
  --lc-surface: #161f33; --lc-surface-2: #1e2a44; --lc-texto: #e8eefa; --lc-muted: #a9b8d3; --lc-borde: #2b3b5c; --lc-link: #8db6f5; --lc-fondo: #0e1524;
  --az: #6fa0ec; --az-osc: #a9c6f5; --az-claro: #1b2b4a; --tinta: #e8eefa; --gris: #a9b8d3; --linea: #2b3b5c;
  --color-negro: #e8eefa; --color-gris-claro: #1e2a44;
  --sombra-1: 0 1px 2px rgba(0,0,0,.4), 0 8px 18px -10px rgba(0,0,0,.6);
  --sombra-2: 0 2px 4px rgba(0,0,0,.4), 0 24px 44px -20px rgba(0,0,0,.75);
  color-scheme: dark;
}
html[data-theme="dark"] body { background: #0e1524 !important; color: var(--lc-texto); }
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3, html[data-theme="dark"] h4, html[data-theme="dark"] h5 { color: #f1f5fd; }
html[data-theme="dark"] main h2, html[data-theme="dark"] .container > h2, html[data-theme="dark"] section > .container > h2 { color: #dbe7fb; }
html[data-theme="dark"] a { color: var(--lc-link); }
html[data-theme="dark"] .text-muted, html[data-theme="dark"] .text-secondary { color: var(--lc-muted) !important; }

/* Cabecera y menús */
html[data-theme="dark"] .header { background: rgba(16,24,41,.98) !important; box-shadow: 0 1px 0 var(--lc-borde), 0 10px 26px -16px rgba(0,0,0,.8) !important; }
html[data-theme="dark"] .nav a, html[data-theme="dark"] .nav > a { color: var(--lc-texto); }
html[data-theme="dark"] .nav > a:hover { color: #fff; }
html[data-theme="dark"] .header .container i, html[data-theme="dark"] .mobile-menu-btn, html[data-theme="dark"] .search-toggle, html[data-theme="dark"] .carrito-icono-link, html[data-theme="dark"] .user-btn, html[data-theme="dark"] .user-dropdown-btn { color: var(--lc-texto); }
html[data-theme="dark"] .search-container .form-control, html[data-theme="dark"] .search-bar input, html[data-theme="dark"] .search-bar { background: var(--lc-surface-2); border-color: var(--lc-borde); color: var(--lc-texto); }
html[data-theme="dark"] .search-bar input::placeholder, html[data-theme="dark"] .form-control::placeholder { color: #8195b6; }
html[data-theme="dark"] .dropdown-menu, html[data-theme="dark"] .user-dropdown-menu, html[data-theme="dark"] .search-suggestions, html[data-theme="dark"] #searchSuggestions { background: var(--lc-surface) !important; border: 1px solid var(--lc-borde) !important; box-shadow: var(--sombra-2) !important; }
html[data-theme="dark"] .dropdown-menu a, html[data-theme="dark"] .user-dropdown-menu a { color: var(--lc-texto) !important; }
html[data-theme="dark"] .dropdown-menu a:hover, html[data-theme="dark"] .user-dropdown-menu a:hover { background: var(--lc-surface-2) !important; color: #fff !important; }

/* Portada */
html[data-theme="dark"] .hero { background: radial-gradient(900px 420px at 85% -20%, rgba(111,160,236,.22), transparent 60%), radial-gradient(700px 380px at 5% 110%, rgba(242,183,5,.14), transparent 60%), linear-gradient(135deg, #0c1a38 0%, #15305f 55%, #1f4584 100%) !important; }
html[data-theme="dark"] .hero::after, html[data-theme="dark"] .footer::before { background: #0e1524; }

/* Tarjetas de producto */
html[data-theme="dark"] .producto-card { background: var(--lc-surface) !important; border-color: var(--lc-borde) !important; }
html[data-theme="dark"] .producto-info { background: var(--lc-surface); }
html[data-theme="dark"] .producto-titulo a { color: var(--lc-texto) !important; }
html[data-theme="dark"] .producto-precio { color: #8db6f5 !important; }
html[data-theme="dark"] .producto-imagen { background: #fff; }                /* las fotos de producto tienen fondo blanco */
html[data-theme="dark"] .producto-card .btn-agregar-carrito, html[data-theme="dark"] .btn-primary { background: linear-gradient(180deg, #3f78cf, #2f62b5); border-color: #2f62b5; color: #fff; }
html[data-theme="dark"] .alert-info { background: #14264a; color: #cfe0ff; border-left-color: #6fa0ec; }
html[data-theme="dark"] .page-link { background: var(--lc-surface); color: #cfe0ff; }
html[data-theme="dark"] .page-item.active .page-link { background: #3f78cf; color: #fff; }
html[data-theme="dark"] .page-link:hover { background: var(--lc-surface-2); }

/* Pie de página */
html[data-theme="dark"] .footer { background: linear-gradient(170deg, #0a1226 0%, #101c38 60%, #14264b 100%) !important; }

/* Formularios y tarjetas genéricas */
html[data-theme="dark"] .card, html[data-theme="dark"] .login-card, html[data-theme="dark"] .registro-card, html[data-theme="dark"] .auth-card, html[data-theme="dark"] .modal-content, html[data-theme="dark"] .list-group-item { background: var(--lc-surface) !important; border-color: var(--lc-borde) !important; color: var(--lc-texto); }
html[data-theme="dark"] .form-control, html[data-theme="dark"] .form-select, html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background-color: var(--lc-surface-2); border-color: var(--lc-borde); color: var(--lc-texto); }
html[data-theme="dark"] .form-control:focus, html[data-theme="dark"] input:focus, html[data-theme="dark"] select:focus, html[data-theme="dark"] textarea:focus { background-color: #223155; border-color: #6fa0ec; color: #fff; }
html[data-theme="dark"] input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #1e2a44 inset; -webkit-text-fill-color: #e8eefa; }
html[data-theme="dark"] label { color: var(--lc-texto); }
html[data-theme="dark"] .btn-google { background: var(--lc-surface-2) !important; border-color: var(--lc-borde) !important; color: #cfe0ff !important; }
html[data-theme="dark"] .table { --bs-table-bg: transparent; color: var(--lc-texto); border-color: var(--lc-borde); }
html[data-theme="dark"] .breadcrumb a { color: #8db6f5; } html[data-theme="dark"] .breadcrumb-item.active { color: var(--lc-muted); }
html[data-theme="dark"] hr { border-color: var(--lc-borde); opacity: 1; }

/* Piezas propias: cookies, modales, barra de compra, errores, avisos */
html[data-theme="dark"] .lc-cookie, html[data-theme="dark"] .lc-modal-box, html[data-theme="dark"] .lc-buybar { background: var(--lc-surface); color: var(--lc-texto); border-color: var(--lc-borde); }
html[data-theme="dark"] .lc-cookie-txt p, html[data-theme="dark"] .lc-row small { color: var(--lc-muted); }
html[data-theme="dark"] .lc-cookie-txt a { color: #8db6f5; }
html[data-theme="dark"] .lc-modal-box h2, html[data-theme="dark"] .lc-cookie-txt strong { color: #f1f5fd; }
html[data-theme="dark"] .lc-row { border-bottom-color: var(--lc-borde); }
html[data-theme="dark"] .lc-btn-sec { background: transparent; color: #8db6f5; border-color: #6fa0ec; }
html[data-theme="dark"] .lc-btn-link { color: var(--lc-muted); }
html[data-theme="dark"] .lc-btn-main, html[data-theme="dark"] .lc-bb-main { background: #3f78cf; }
html[data-theme="dark"] .lc-error-card { background: var(--lc-surface); color: var(--lc-texto); }
html[data-theme="dark"] .lc-error-card p { color: var(--lc-muted); }
html[data-theme="dark"] .lc-error-card input[type=search] { background: var(--lc-surface-2); border-color: var(--lc-borde); color: var(--lc-texto); }
html[data-theme="dark"] .lc-error-links a { color: #8db6f5; }
html[data-theme="dark"] .lc-error-page { background: radial-gradient(900px 500px at 15% -10%, #1f4584 0, transparent 60%), linear-gradient(160deg, #0a1226, #15305f); }
html[data-theme="dark"] .lc-error { color: #ff9aa2; }
html[data-theme="dark"] img.cargada { background: none; }
html[data-theme="dark"] img[loading="lazy"]:not(.cargada), html[data-theme="dark"] img.lazyload:not(.cargada) { background: linear-gradient(90deg, #1e2a44 25%, #253456 37%, #1e2a44 63%) 0 0 / 400% 100%; }
html[data-theme="dark"] .whatsapp-flotante-opcion, html[data-theme="dark"] .whatsapp-flotante-menu { background: var(--lc-surface) !important; color: var(--lc-texto) !important; border: 1px solid var(--lc-borde); }

/* Páginas legales sueltas (cuando se abren sin el modal) */
html[data-theme="dark"] body > h1, html[data-theme="dark"] body > h2 { color: #f1f5fd; }
html[data-theme="dark"] body > p, html[data-theme="dark"] body > ul li { color: var(--lc-texto); }
html[data-theme="dark"] .rnc-box { background: var(--lc-surface-2) !important; border-color: var(--lc-borde) !important; color: var(--lc-texto); }
html[data-theme="dark"] .subtitulo { color: var(--lc-muted) !important; }

/* Secciones y piezas específicas de cada página (detectadas en pruebas) */
html[data-theme="dark"] .ofertas-section, html[data-theme="dark"] .productos-section, html[data-theme="dark"] .section-light { background: transparent !important; }
html[data-theme="dark"] .fila-carrito, html[data-theme="dark"] .carrito-resumen, html[data-theme="dark"] .resumen-card, html[data-theme="dark"] .carrito-vacio { background: var(--lc-surface) !important; border-color: var(--lc-borde) !important; color: var(--lc-texto); }
html[data-theme="dark"] .instagram-card, html[data-theme="dark"] .instagram-cta, html[data-theme="dark"] .info-ubicacion, html[data-theme="dark"] .redes-card, html[data-theme="dark"] .contacto-card { background: var(--lc-surface) !important; border-color: var(--lc-borde) !important; color: var(--lc-texto) !important; }
html[data-theme="dark"] .btn-mapa { background: var(--lc-surface-2) !important; color: #cfe0ff !important; border-color: var(--lc-borde) !important; }
html[data-theme="dark"] .pedido-cliente-card, html[data-theme="dark"] .pedido-card, html[data-theme="dark"] .checkout-seccion, html[data-theme="dark"] .checkout-resumen, html[data-theme="dark"] .aceptar-garantia-box { background: var(--lc-surface) !important; border-color: var(--lc-borde) !important; color: var(--lc-texto) !important; }
html[data-theme="dark"] .pill-option { background: var(--lc-surface-2) !important; color: var(--lc-texto) !important; border-color: var(--lc-borde) !important; }
html[data-theme="dark"] .pill-option.active { background: #1b3a72 !important; border-color: #6fa0ec !important; color: #fff !important; }
html[data-theme="dark"] .checkout-seccion h2, html[data-theme="dark"] .checkout-seccion h3, html[data-theme="dark"] .pedido-cliente-card h3 { color: #e8eefa; }
html[data-theme="dark"] .header-login, html[data-theme="dark"] .header-registro, html[data-theme="dark"] .login-header, html[data-theme="dark"] .registro-header { background: #101829 !important; box-shadow: 0 1px 0 var(--lc-borde) !important; }
html[data-theme="dark"] .btn-volver, html[data-theme="dark"] .volver-tienda, html[data-theme="dark"] .btn-back { background: var(--lc-surface-2) !important; color: var(--lc-texto) !important; }
html[data-theme="dark"] .login-info, html[data-theme="dark"] .info-box, html[data-theme="dark"] .requisitos-password { background: var(--lc-surface-2) !important; color: var(--lc-texto) !important; }

/* Textos secundarios y etiquetas (login, registro, redes) */
html[data-theme="dark"] .form-label, html[data-theme="dark"] .form-group label, html[data-theme="dark"] .form-check-label { color: var(--lc-texto) !important; }
html[data-theme="dark"] .login-card p, html[data-theme="dark"] .login-container p, html[data-theme="dark"] .auth-card p, html[data-theme="dark"] .registro-card p, html[data-theme="dark"] .login-box p,
html[data-theme="dark"] .instagram-subtitle, html[data-theme="dark"] .info-ubicacion p, html[data-theme="dark"] .instagram-card p, html[data-theme="dark"] .redes-section p, html[data-theme="dark"] .estrellas-total { color: var(--lc-muted) !important; }
html[data-theme="dark"] .separador span, html[data-theme="dark"] .divider span, html[data-theme="dark"] .separator span, html[data-theme="dark"] [class*="separador"] span { background: var(--lc-surface) !important; color: var(--lc-muted) !important; }

/* Precios, códigos y enlaces azul-oscuro que en fondo oscuro no se leían */
html[data-theme="dark"] .fc-precio, html[data-theme="dark"] .pedido-cliente-codigo, html[data-theme="dark"] .checkout-seccion a, html[data-theme="dark"] .checkout-seccion strong.precio, html[data-theme="dark"] .checkout-total, html[data-theme="dark"] .resumen-total { color: #8db6f5 !important; }
html[data-theme="dark"] .estado-pedido-badge { filter: brightness(1.25) saturate(1.1); }
html[data-theme="dark"] .checkout-seccion span[style*="color"], html[data-theme="dark"] .checkout-seccion a { color: #8db6f5 !important; }
html[data-theme="dark"] .lcl-tabs button.on { background: #3f78cf; color: #fff; }
html[data-theme="dark"] .lcl-aparte, html[data-theme="dark"] .lcl-contenido a { color: #8db6f5; }
