/* --- VARIABLES GLOBALES ELDBAR 3D --- */
:root {
  --blue-eldbar: #00A3FF;
  --blue-hover: #0089D6;
  --dark-bg: #121417;
  --card-bg: #1E2226;
  --text-light: #E0E0E0;
  --text-muted: #9AA0A6;
  --wireframe-border: #2A3036;
}

/* --- ESTILOS BASE --- */
body {
  background-color: var(--dark-bg);
  color: var(--text-light);
  font-family: 'Rajdhani', 'Montserrat', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  color: #FFFFFF;
}

/* --- DESTRUCCIÓN DE FONDOS BLANCOS (Cassiopeia & Bootstrap) --- */
.card,
.card-body,
.bg-white,
.bg-light,
.p-3,
.container-sidebar-right > div,
.moduletable,
.ph-checkout-box,
.ph-box,
.item-page {
  background-color: var(--card-bg) !important;
  background: var(--card-bg) !important;
  color: var(--text-light) !important;
  border-color: var(--wireframe-border) !important;
  box-shadow: none !important;
}

/* Cabeceras de módulos y pasos de checkout */
.card-header,
.moduletable h3,
.ph-step-header {
  background-color: #000000 !important;
  color: var(--blue-eldbar) !important;
  border-bottom: 1px solid var(--wireframe-border) !important;
  background-image: none !important;
}

/* --- ENLACES Y MENÚS LATERALES --- */
a {
  color: var(--blue-eldbar);
  text-decoration: none;
}
a:hover {
  color: var(--blue-hover);
}

.container-sidebar-right ul {
  background-color: transparent !important;
  padding-left: 0;
}

.container-sidebar-right li {
  background-color: transparent !important;
  border-bottom: 1px solid var(--wireframe-border) !important;
}

.container-sidebar-right a {
  color: #FFFFFF !important;
  display: block;
  padding: 5px 0;
}

.container-sidebar-right a:hover {
  color: var(--blue-eldbar) !important;
}

/* --- FORMULARIOS --- */
.form-control, 
.form-select {
  background-color: var(--dark-bg) !important;
  color: var(--text-light) !important;
  border: 1px solid var(--wireframe-border) !important;
}

.form-check-label,
.login-greeting {
  color: var(--text-light) !important;
}

/* --- METADATOS Y TEXTOS MUTADOS --- */
.text-muted,
.article-info,
.article-info dd,
dl.article-info dd {
  color: var(--text-muted) !important;
}

/* --- PARCHE DEFINITIVO: COLORES HEXADECIMALES DIRECTOS Y BOTONES AZULES --- */

/* 1. Forzar fondo oscuro con color HEX directo (ignora variables rotas) */
html body div.card, 
html body div.card-body, 
html body div.bg-white, 
html body div.p-3,
html body .ph-checkout-box,
html body .ph-box,
html body .container-sidebar-right .moduletable {
    background-color: #1E2226 !important;
    background: #1E2226 !important;
    color: #E0E0E0 !important;
}

/* 2. Recuperar el azul eléctrico de los botones (anula el granate del tema) */
html body .btn-primary, 
html body .btn-secondary, 
html body button.btn, 
html body .ph-btn,
html body .ph-checkout-box .btn {
    background-color: #00A3FF !important;
    border-color: #00A3FF !important;
    color: #FFFFFF !important;
}
html body .btn-primary:hover, 
html body .btn-secondary:hover, 
html body button.btn:hover, 
html body .ph-btn:hover,
html body .ph-checkout-box .btn:hover {
    background-color: #0089D6 !important;
    border-color: #0089D6 !important;
}

/* 3. Hacer visibles los enlaces del menú principal */
html body .container-sidebar-right ul.mod-menu a,
html body .container-sidebar-right ul.nav a,
html body .container-sidebar-right .list-group-item a {
    color: #FFFFFF !important;
}
html body .container-sidebar-right ul.mod-menu a:hover,
html body .container-sidebar-right ul.nav a:hover,
html body .container-sidebar-right .list-group-item a:hover {
    color: #00A3FF !important;
}

/* 4. Asegurar que textos como "Recuérdeme" se lean bien */
html body .form-check-label {
    color: #E0E0E0 !important;
}

/* --- MEJORA DE CONTRASTE: CAJAS MÁS CLARAS --- */
/* Damos un color gris más claro (#2A3036) a todos los recuadros para que destaquen del fondo negro */
html body div.card, 
html body div.card-body, 
html body .container-sidebar-right .moduletable {
    background-color: #2A3036 !important;
    border: 1px solid #454D55 !important; /* Borde sutil para enmarcar */
}

/* --- DESTRUCCIÓN DEL BLANCO EN EL CHECKOUT DE PHOCACART --- */
/* Atacamos las clases internas específicas que usa PhocaCart para construir esa tabla blanca */
html body #phocacart,
html body #phocacart-checkout,
html body .ph-checkout-step,
html body .ph-checkout-step-body,
html body .ph-checkout-login,
html body .ph-checkout-register,
html body #phocacart-checkout .row,
html body #phocacart-checkout .col-md-6,
html body #phocacart-checkout form {
    background-color: #2A3036 !important;
    background: #2A3036 !important;
    color: #E0E0E0 !important;
}

/* Títulos internos del checkout ("LOGIN", "REGISTER") */
html body .ph-checkout-step-body h3,
html body .ph-checkout-step-body legend {
    color: #00A3FF !important;
    border-bottom: 1px solid #454D55 !important;
}

/* Campos de texto dentro del checkout para que no se queden blancos */
html body #phocacart-checkout input[type="text"],
html body #phocacart-checkout input[type="password"],
html body #phocacart-checkout input[type="email"] {
    background-color: #121417 !important;
    color: #FFFFFF !important;
    border: 1px solid #454D55 !important;
}

/* --- ATAQUE DIRECTO AL FONDO BLANCO DEL CHECKOUT --- */
html body .ph-checkout-box,
html body .ph-checkout-step,
html body .ph-checkout-step-body,
html body .ph-checkout-step-body > div,
html body .ph-checkout-step-body .row > div,
html body form[name="adminForm"] .row > div,
html body #phocacart .bg-white,
html body #phocacart-checkout {
    background-color: #2A3036 !important;
    color: #E0E0E0 !important;
    border-color: #454D55 !important;
}

/* Oscurecer los campos de texto del checkout para que no desentonen */
html body .ph-checkout-step-body input[type="text"],
html body .ph-checkout-step-body input[type="password"] {
    background-color: #121417 !important;
    color: #FFFFFF !important;
    border: 1px solid #454D55 !important;
}

/* --- ATAQUE QUIRÚRGICO AL CHECKOUT DE PHOCACART --- */
/* Apuntamos al ID exacto y a todos sus bloques internos revelados en el inspector */
:root body #ph-pc-checkout-box,
:root body #ph-pc-checkout-box div[class*="ph-checkout-box-"],
:root body #ph-pc-checkout-box .row,
:root body #ph-pc-checkout-box .pc-view {
    background-color: #2A3036 !important;
    background: #2A3036 !important;
    color: #E0E0E0 !important;
}

/* Arreglar los bordes separadores internos (para que no destaquen en blanco o gris claro) */
:root body #ph-pc-checkout-box .ph-left-border,
:root body #ph-pc-checkout-box .ph-right-border {
    border-color: #454D55 !important;
}

/* Oscurecer los inputs dentro de este bloque específico */
:root body #ph-pc-checkout-box input[type="text"],
:root body #ph-pc-checkout-box input[type="password"],
:root body #ph-pc-checkout-box input[type="email"] {
    background-color: #121417 !important;
    color: #FFFFFF !important;
    border: 1px solid #454D55 !important;
}

/* --- PARCHE PARA DESPLEGABLES BLANCOS EN PRODUCTOS --- */
html body select.form-select,
html body select.inputbox,
html body .ph-category-box select,
html body select {
    background-color: #121417 !important;
    color: #FFFFFF !important;
    border: 1px solid #454D55 !important;
}

/* --- CORRECCIÓN DEFINITIVA PARA SELECTORES Y DESPLEGABLES --- */
html body select,
html body .choices__inner,
html body .choices__list--dropdown,
html body select.form-select,
html body select.inputbox {
    background-color: #121417 !important;
    color: #FFFFFF !important;
    border: 1px solid #454D55 !important;
}

html body select option {
    background-color: #121417 !important;
    color: #FFFFFF !important;
}

/* --- FORZAR OSCURO EN CONTENEDORES DE SELECCIÓN --- */
html body .choices,
html body .choices__inner,
html body .choices__list,
html body div.choices__inner,
html body .ph-category-box .choices__inner,
html body select,
html body .form-select {
    background-color: #121417 !important;
    background: #121417 !important;
    color: #FFFFFF !important;
    border-color: #454D55 !important;
}

html body .choices__input {
    background-color: transparent !important;
    color: #FFFFFF !important;
}

html body .choices__list--dropdown, 
html body .choices__list[aria-expanded] {
    background-color: #121417 !important;
    color: #FFFFFF !important;
    border-color: #454D55 !important;
}

html body .choices__item--choice {
    color: #FFFFFF !important;
}

html body .choices__item--choice:hover {
    background-color: #00A3FF !important;
    color: #FFFFFF !important;
}

/* --- CORRECCIÓN DE ALERTAS Y AVISOS EN MODO OSCURO --- */

/* Estilos base para todos los contenedores de alerta */
.alert {
    border: 1px solid #454D55 !important;
    border-radius: 4px;
    color: #FFFFFF !important;
}

/* Alerta de Error (Fondo rojo oscuro, borde rojo claro, texto blanco) */
.alert-error,
.alert-danger {
    background-color: #721c24 !important;
    color: #F8D7DA !important;
    border-color: #F5C6CB !important;
}

/* Alerta de Éxito (Fondo verde oscuro, borde verde claro, texto verde muy claro) */
.alert-success {
    background-color: #155724 !important;
    color: #D4EDDA !important;
    border-color: #C3E6CB !important;
}

/* Alerta de Información/Aviso (Fondo azul oscuro, borde azul claro, texto azul muy claro) */
.alert-info,
.alert-warning {
    background-color: #004085 !important;
    color: #CCE5FF !important;
    border-color: #B8DAFF !important;
}

/* Ajuste de color para los iconos dentro de las alertas */
.alert .alert-icon,
.alert .icon-remove,
.alert .close {
    color: #FFFFFF !important;
    opacity: 0.8;
}
.alert .close:hover {
    opacity: 1;
}

/* --- CORRECCIÓN GLOBAL DE FONDOS BLANCOS EN PHOCACART --- */

/* Afecta a las vistas de cuenta, checkout, listas de productos, etc. */
html body .ph-site-wrap,
html body .ph-category-box,
html body .ph-product-box,
html body .ph-account-box,
html body .ph-checkout-box,
html body .ph-cart-box,
html body .com_phocacart .content-main,
html body #ph-pc-account-box,
html body #ph-pc-user-orders-box,
html body #ph-pc-user-details-box {
    background-color: #121417 !important;
    color: #FFFFFF !important;
}

/* Paneles internos y cabeceras de bloque */
html body .ph-box,
html body .ph-account-header,
html body .ph-checkout-header,
html body .ph-body-el {
    background-color: #181A1F !important;
    border-color: #454D55 !important;
    color: #FFFFFF !important;
}

/* Tablas dentro de PhocaCart (ej. historial de pedidos) */
html body .ph-table,
html body .ph-table td,
html body .ph-table th {
    background-color: #121417 !important;
    color: #FFFFFF !important;
    border-color: #454D55 !important;
}

/* Etiquetas de formulario y texto grisáceo */
html body .ph-label,
html body .ph-legend,
html body .ph-account-box .control-label {
    color: #9AA0A6 !important;
}

/* Campos de texto dentro de los paneles */
html body .ph-account-box input[type="text"],
html body .ph-account-box input[type="password"],
html body .ph-account-box input[type="email"],
html body .ph-account-box select,
html body .ph-account-box textarea {
    background-color: #181A1F !important;
    border-color: #454D55 !important;
    color: #FFFFFF !important;
}

/* --- CORRECCIÓN DE PRECISIÓN PARA PANELES DE CUENTA (Mi Cuenta) --- */

/* Fuerza fondo y color de texto en todos los cuadros internos de dirección */
html body .ph-account-box .ph-box,
html body .ph-account-box .ph-table {
    background-color: #181A1F !important;
    color: #FFFFFF !important;
    border: 1px solid #454D55 !important;
}

/* Asegura que las filas del grid dentro del formulario tengan fondo oscuro */
html body .ph-account-box .row {
    background-color: transparent !important;
}

html body .ph-account-box .col-sm-6 {
    background-color: transparent !important;
}

/* Oculta la línea divisoria por defecto de los bloques si la hubiera */
html body .ph-account-box hr {
    border-top: 1px solid #454D55 !important;
}

/* --- FORZAR OSCURO ABSOLUTO EN VISTA DE CUENTA --- */
html body .com_phocacart.view-account,
html body .com_phocacart.view-account main,
html body #ph-pc-account-box,
html body .ph-account-box {
    background-color: #121417 !important;
    background: #121417 !important;
    color: #FFFFFF !important;
}

/* --- CORRECCIÓN DEFINITIVA DE FILAS Y ACCIONES DE CUENTA --- */
html body .ph-account-box .row.ph-account-box-action,
html body .ph-account-box-row,
html body .ph-account-box .form-horizontal,
html body div.row.ph-account-box-action {
    background-color: #121417 !important;
    background: #121417 !important;
    color: #FFFFFF !important;
}

/* --- CORRECCIÓN DE CABECERAS Y BLOQUES BLANCOS EN CUENTA --- */
html body #phaccountaddressedit,
html body .ph-account-box-header,
html body div[id*="phaccount"],
html body .com_phocacart .ph-box,
html body .com_phocacart .ph-box-header {
    background-color: #181A1F !important;
    background: #181A1F !important;
    color: #FFFFFF !important;
    border-color: #454D55 !important;
}

/* --- CORRECCIÓN DE BORDES EXTERIORES EN VISTA DE CUENTA --- */
html body .ph-account-box,
html body #ph-pc-account-box,
html body .com_phocacart .ph-box {
    border: 1px solid #454D55 !important;
    box-shadow: none !important;
}

/* --- ELIMINACIÓN TOTAL DE BORDES CLAROS EN ACCIONES DE CUENTA Y PERFIL --- */
html body .ph-account-box-action,
html body .ph-checkout-box-action,
html body div.row.ph-account-box-action,
html body .com_phocacart .ph-account-box .row {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    box-shadow: none !important;
    background-color: #121417 !important;
}

/* --- CORRECCIÓN DE ALERTAS NATIVAS DE JOOMLA (Modo Oscuro) --- */
html body joomla-alert[type="success"],
html body .alert-success,
html body #system-message-container joomla-alert {
    background-color: #155724 !important;
    color: #D4EDDA !important;
    border: 1px solid #28a745 !important;
    --alert-accent-color: #28a745 !important;
    --alert-heading-text: #ffffff !important;
}

html body joomla-alert[type="success"] .alert-message,
html body joomla-alert[type="success"] .alert-heading {
    color: #D4EDDA !important;
}

/* --- CORRECCIÓN DIFERENCIADA PARA ALERTAS DE JOOMLA Y PHOCACART --- */

/* Mensajes de Éxito (Verde) */
html body joomla-alert[type="success"],
html body .alert-success {
    background-color: #155724 !important;
    color: #D4EDDA !important;
    border: 1px solid #28a745 !important;
    --alert-accent-color: #28a745 !important;
    --alert-heading-text: #ffffff !important;
}

/* Mensajes de Error, Advertencia o Sin Permisos (Rojo / Granate) */
html body joomla-alert[type="danger"],
html body joomla-alert[type="warning"],
html body joomla-alert[type="error"],
html body .alert-error,
html body .alert-danger,
html body .alert-warning {
    background-color: #721c24 !important;
    color: #F8D7DA !important;
    border: 1px solid #f5c6cb !important;
    --alert-accent-color: #dc3545 !important;
    --alert-heading-text: #ffffff !important;
}

html body joomla-alert .alert-message,
html body joomla-alert .alert-heading {
    color: inherit !important;
}

/* --- FORZAR ROJO EN ALERTAS DE ERROR Y PERMISOS --- */
html body joomla-alert[type="warning"],
html body joomla-alert[type="danger"],
html body joomla-alert[type="error"],
html body .alert-error,
html body .alert-danger,
html body .alert-warning,
html body div.alert-error,
html body div.alert-danger {
    background-color: #721c24 !important;
    color: #F8D7DA !important;
    border-color: #f5c6cb !important;
}

html body joomla-alert[type="warning"] *,
html body joomla-alert[type="danger"] *,
html body joomla-alert[type="error"] *,
html body .alert-error *,
html body .alert-danger * {
    color: #F8D7DA !important;
}

/* --- ANULACIÓN TOTAL DE ALERTAS DE JOOMLA Y PHOCACART --- */
html body joomla-alert,
html body .ph-alert,
html body div[class*="alert"] {
    background-color: #721c24 !important;
    color: #F8D7DA !important;
    border-color: #f5c6cb !important;
    --alert-background: #721c24 !important;
    --alert-text: #F8D7DA !important;
    --alert-border: #f5c6cb !important;
    --alert-accent-color: #dc3545 !important;
}

html body joomla-alert *,
html body .ph-alert * {
    color: #F8D7DA !important;
}

/* --- CORRECCIÓN DE VISTA DE PEDIDOS Y ENVÍOS (Orders) --- */
html body .com_phocacart.view-orders,
html body #ph-pc-user-orders-box,
html body .ph-order-box,
html body .ph-orders-box,
html body .ph-table,
html body .ph-table tr,
html body .ph-table td,
html body .ph-table th {
    background-color: #121417 !important;
    color: #FFFFFF !important;
    border-color: #454D55 !important;
}

/* Filas expandibles de información de envío en pedidos */
html body .ph-table tr td[style*="background"],
html body .ph-order-details,
html body .ph-shipping-info,
html body tr.ph-row-details,
html body td.ph-row-details,
html body div.ph-shipping-info {
    background-color: #181A1F !important;
    color: #D1D5DB !important;
    border-color: #454D55 !important;
}

/* Texto de etiquetas secundarias en los detalles de envío */
html body .ph-table .text-muted,
html body .ph-order-details span {
    color: #9AA0A6 !important;
}

/* --- CORRECCIÓN DEFINITIVA DE CAJA DE INFORMACIÓN DE ENVÍO --- */
html body .ph-shipping-info-box,
html body div.ph-shipping-info-box {
    background-color: #181A1F !important;
    background: #181A1F !important;
    color: #FFFFFF !important;
    border-color: #454D55 !important;
}

html body .ph-shipping-info-box * {
    color: #FFFFFF !important;
}
