/* Colores institucionales Mercal */
:root {
  --mercal-azul: #0052a5;
  --mercal-azul-rgb: 0, 82, 165;
  --mercal-rojo: #e31b23;
  --mercal-rojo-rgb: 227, 27, 35;
  --mercal-amarillo: #f9df18;
  --mercal-amarillo-rgb: 249, 223, 24;
  --mercal-blanco: #ffffff;
  --bs-primary: #0052a5;
  --bs-primary-rgb: 0, 82, 165;
  --bs-danger: #e31b23;
  --bs-danger-rgb: 227, 27, 35;
  --bs-warning: #f9df18;
  --bs-warning-rgb: 249, 223, 24;
}

#header,
#header.header-scrolled {
  background: rgba(0, 82, 165, 0.95) !important;
}

.navbar a:hover,
.navbar .active,
.navbar .active:focus,
.navbar li:hover > a {
  color: #f9df18 !important;
}

/* Modificado para asegurar la correcta posición respecto al menú */
.bg-mercal-panel {
  border-radius: 20px;
  background-color: #0052a5 !important;
  border: 2px solid #f9df18;
  margin-top: 20px !important;
  position: relative !important;
  top: 0 !important;
  transform: none !important;
}

.bg-mercal-accent {
  background-color: rgba(227, 27, 35, 0.10) !important;
  border: 1px solid #f9df18;
}

.btn-primary {
  background-color: #0052a5 !important;
  border-color: #0052a5 !important;
  color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: #004389 !important;
  border-color: #004389 !important;
  color: #ffffff !important;
}

.btn-danger {
  background-color: #e31b23 !important;
  border-color: #e31b23 !important;
  color: #ffffff !important;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active {
  background-color: #c0171e !important;
  border-color: #c0171e !important;
  color: #ffffff !important;
}

.modal-header.bg-primary {
  background-color: #0052a5 !important;
  border-bottom: 2px solid #f9df18;
  color: #ffffff !important;
}

.modal-body {
  background-color: #ffffff !important;
}

.modal-footer {
  background-color: #ffffff !important;
  border-top: 1px solid #f9df18;
}

.modal-content {
  border: 2px solid #f9df18;
}

.card {
  background-color: #ffffff !important;
  border: 1px solid #f9df18;
}

.card-header {
  background-color: #ffffff !important;
  border-bottom: 1px solid #f9df18;
}

.card-body {
  background-color: #ffffff !important;
}

.table-responsive {
  background-color: #ffffff !important;
}

.table {
  background-color: #ffffff !important;
}

.table thead th {
  background-color: #0052a5 !important;
  color: #ffffff !important;
  border-color: #f9df18 !important;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 82, 165, 0.05) !important;
}

.table-hover tbody tr:hover {
  background-color: rgba(249, 223, 24, 0.15) !important;
}

.section-title h2,
.h2-title {
  color: #ffffff !important;
}

body.pagina-principal #services .section-title h2,
body.pagina-principal #team .section-title h2,
body.pagina-principal #faq .section-title h2,
body.pagina-principal #contact .section-title h2 {
  color: #414c64 !important;
}

body.pagina-principal #services .section-title p,
body.pagina-principal #team .section-title p,
body.pagina-principal #faq .section-title p {
  color: #5f6b7a;
}

.alert-danger {
  background-color: rgba(227, 27, 35, 0.12) !important;
  border-color: #e31b23 !important;
  color: #212529 !important;
}

.alert-warning {
  background-color: rgba(249, 223, 24, 0.20) !important;
  border-color: #f9df18 !important;
  color: #212529 !important;
}

.badge-warning,
.bg-warning {
  background-color: #f9df18 !important;
  color: #212529 !important;
}

.form-control:focus {
  border-color: #0052a5;
  box-shadow: 0 0 0 0.2rem rgba(0, 82, 165, 0.25);
}

#mostrarmodal .modal-header {
  background-color: #0052a5 !important;
  color: #ffffff !important;
  border-bottom: 2px solid #f9df18;
}

/* ==========================================================================
   AGREGADO: CONTROL DE IMAGEN DE FONDO ATENUADA PARA TODO EL SISTEMA
   ========================================================================== */

/* Aplicamos el fondo negro y la estructura base a TODOS los bodies por defecto */
body {
  position: relative;
  background-color: #000000 !important; /* Profundidad negra para los módulos */
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  
  /* Buscamos la imagen unificada en la carpeta assets/img/ */
  background-image: url("../../../assets/img/antonio.jpeg"); 
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  
  /* Filtro de atenuación balanceado que calibramos */
  filter: brightness(45%) contrast(90%) saturate(80%);
  
  /* Fuerza a la capa a renderizarse estrictamente detrás de todo el HTML */
  z-index: -1 !important; 
}

/* ==========================================================================
   EXCLUSIÓN: SALVAGUARDAR EL LOGIN Y LA PÁGINA PRINCIPAL PÚBLICA
   ========================================================================== */

/* Si la etiqueta body tiene un ID o una clase específica de tu login/index público, 
   o si deseas identificar tu Login/Index, puedes agregarles la clase "vista-publica" en su HTML */
body.vista-publica, 
body#page-login {
  background-color: #ffffff !important; /* O el color original de tu pantalla de login */
}

body.vista-publica::before,
body#page-login::before {
  display: none !important; /* Desactiva por completo los camiones de Mercal en el login */
}