/* ========================================
   DESIGN TOKENS MASTER (CPL)
======================================== */
:root {
  /* ===== Brand ===== */
  --primary-color: #0A1A3A;
  --primary-light: #1E3A6F;

  /* ⚠️ dorado refinado (recomendado) */
  --secondary-color: #B8963A;
  --secondary-light: #C6A85A;

  /* ===== Text ===== */
  --text-color: #2C3E50;
  --text-light: #5A6F8A;

  /* ===== Surfaces ===== */
  --menu-bg: #0A1A3A;
  --submenu-bg: #12264A;
  --bg-light: #F8F9FC;
  --border-color: #E5E9F0;

  /* ===== Neutrals ===== */
  --white: #FFFFFF;
  --black: #1A1A1A;

  /* ===== Motion ===== */
  --transition-speed: 0.3s;

  /* ===== Elevation ===== */
  --menu-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);

  /* ===== Z-Index ===== */
  --overlay-zindex: 1000;
  --menu-zindex: 1001;
  --header-zindex: 100;

  /* ===== Layout ===== */
  --topheader-height: 40px;
  --main-header-height: 50px;
}

/*------  RESET Y ESTILOS BASE  ------*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.5;
  color: #333;
  overflow-x: hidden;
  position: relative;
  margin: 0;
  padding-top: 0;
}

/*------  ESTRUCTURA PRINCIPAL  ------*/
.main-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/*------  HEADER SUPERIOR (CONTACTO Y ENLACES)  ------*/
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
   background-color: var(--primary-color);
  color: white;
  z-index: 1001;
  height: var(--topheader-height);
  transform: translateY(0);
  transition: transform 0.3s ease, opacity 0.3s ease;
  will-change: transform;
}

.top-header.hidden {
  transform: translateY(-100%);
}

.top-header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 20px;
  height: var(--topheader-height);
}

.top-header-contacts,
.top-header-links {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.top-header a {
  color: white;
  text-decoration: none;
  transition: opacity 0.2s;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.top-header a:hover {
    color: var(--secondary-color);
  opacity: 1;
}

/*------  HEADER PRINCIPAL (LOGO Y MENÚ)  ------*/
.main-header {
  position: fixed;
  top: var(--topheader-height);
  left: 0;
  right: 0;
  background-color: white;
  z-index: 1000;
  transition: top 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
  box-shadow: none;
}

.main-header.collapsed {
  top: 0 !important;
  box-shadow: 0 4px 10px rgba(95, 95, 95, 0.394);
}

.top-header.hidden + .main-header,
.top-header.hidden ~ .main-header {
  top: 0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  position: relative;
}

/*------  LOGO  ------*/
.logo-header-container {
 width: 220px;
  height: 74px;
  background: linear-gradient(to bottom, #000f2d 0%, #001c57 50%, #000f2d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.75rem;
  margin-left: 0;
 transition: color .25s ease, transform .25s ease, opacity .25s ease;
}

.logo img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/*------  CONTENIDO PRINCIPAL  ------*/
main {
  margin-top: calc(var(--topheader-height) + var(--main-header-height));
  transition: margin-top 0.3s ease;
  min-height: 50vh;
}

body.header-collapsed main {
  margin-top: var(--main-header-height);
}

/*------  MENÚ DESKTOP  ------*/
.desktop-menu {
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
  position: relative;
}

.desktop-menu > li {
  position: static;
  list-style: none;
}

.desktop-menu > li > a {
  color: var(--primary-color);
  text-decoration: none;
    padding: 14px 10px;
      font-size: 0.95rem;
  letter-spacing: 0.3px;
  position: relative;
  display: block;
  white-space: nowrap;
  transition: color var(--transition-speed);
  font-weight: 500;
}

.desktop-menu > li > a::after {
  content: "";
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--secondary-color);
  transition: width .28s cubic-bezier(.4,0,.2,1);
}

.desktop-menu > li:hover > a::after,
.desktop-menu > li.active > a::after,
.desktop-menu > li.active-parent > a::after {
  width: 100%;
}

.desktop-menu > li > a:hover::after,
.desktop-menu > li.active > a::after {
  width: 100%;
}

.desktop-menu > li > a::before {
  content: "\e8c8";
  font-family: "Fontello";
  font-size: 14px;
  color: var(--text-color);
  position: absolute;
  right: -15px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform var(--transition-speed);
}

.desktop-menu > li > a:hover::before {
  transform: translateY(-50%) rotate(96deg);
}

/*------  SUBMENÚS DESKTOP  ------*/
.submenu-container {
  position: absolute;
  left: 0;
  right: 0;
  display: none;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-speed);
  z-index: var(--header-zindex);
}

.desktop-menu > li:hover .submenu-container {
  display: flex;
  opacity: 1;
}

.submenu-wrapper {
  position: relative;
  left: 45%;
  transform: translateX(-45%);
  min-width: 1085px;
  padding: 0;
  box-sizing: border-box;
}

.submenu-content {
  background-color: var(--bg-light);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
 border-top: 3px solid var(--secondary-color);
  padding: 20px;
  margin-top: 19px; /* separacion de submenu*/
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
   border-bottom-left-radius: 12px;  /* ← esquinba inferior izquierda*/
  border-bottom-right-radius: 12px; /* ← esquina inferior derecha */
}

.submenu-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.submenu-column li a {
    color: #1F2A37;
  font-weight: 400;
  letter-spacing: 0.2px;
  position: relative;
  text-decoration: none;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-speed);
  font-size: 0.9rem;
}

.submenu-column li a::before {
  content: "\e8c8";
  font-family: "fontello";
  font-size: 1em;
  display: inline-block;
color: var(--secondary-color);
  transition: transform var(--transition-speed);
}

.submenu-column li a:hover {
  color: var(--secondary-color);
   background-color: transparent;
 padding-left: 0;
}

.submenu-column li a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 0;
  height: 1px;
  background: var(--secondary-color);
  transition: width .25s ease;
}

.submenu-column li a:hover::after {
  width: 100%;
}

.submenu-column li a:hover::before {
  transform: translateX(4px);
  color: var(--secondary-color);
}

/*------  BOTÓN MENÚ MÓVIL  ------*/
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #000000;
  padding: 5px 10px;
  transition: transform var(--transition-speed);
  z-index: calc(var(--menu-zindex) + 1);
}

.mobile-menu-btn:hover {
  transform: scale(1.1);
}

/*------  MENÚ MÓVIL - ESTRUCTURA  ------*/
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 80%;
  max-width: 300px;
  height: 100vh;
  background-color: var(--menu-bg);
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
  z-index: var(--menu-zindex);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  visibility: hidden;
  will-change: transform;
}

.mobile-menu.active {
  transform: translateX(0);
  visibility: visible;
}

.mobile-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-menu > ul > li {
  position: relative;
}

/*------  ELEMENTOS DEL MENÚ MÓVIL  ------*/
.mobile-menu li a {
  display: block;
  padding: 15px 20px;
 color: var(--white);
  text-decoration: none;
  border-bottom: 1px solid rgba(200, 159, 76, 0.2);
  transition: background-color var(--transition-speed);
}

.mobile-menu li a:hover {
  background-color: var(--primary-light);
}

.mobile-menu .has-submenu > a::after {
  content: "+";
  position: absolute;
  right: 20px;
  font-size: 18px;
  transition: transform var(--transition-speed);
}

.mobile-menu .has-submenu.active > a::after {
  content: "-";
}

.mobile-menu .submenu {
  background-color: var(--submenu-bg);
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-speed) ease-out;
}

.mobile-menu > ul > li > a,
.mobile-menu > ul > li > .menu-toggle {
  color: #ffffff;
  font-weight: 500;
}

.mobile-menu .submenu li a {
 color: #E0E7FF;
  padding-left: 30px;
  font-size: 0.9rem;
}

.mobile-menu .submenu li a:hover {
  background-color: var(--secondary-color);
  color: var(--white);
}

.mobile-menu .submenu.active {
  max-height: 1200px;
}

/*------  SUBMENÚS MÓVILES (CONTROLES)  ------*/
.mobile-menu .has-submenu > .menu-toggle,
.mobile-menu .has-submenu > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}

.mobile-menu .has-submenu > .menu-toggle::after,
.mobile-menu .has-submenu > a::after {
  content: '+';
  margin-left: auto;
  color: var(--secondary-color);
  font-weight: bold;
  font-size: 18px;
}

.mobile-menu .has-submenu.active > .menu-toggle::after,
.mobile-menu .has-submenu.active > a::after {
  content: '–';
}

.mobile-menu .submenu {
  display: none;
  padding-left: 5px;
  background-color: var(--submenu-bg);
}

.mobile-menu .submenu.active {
  display: block;
}

.mobile-menu .submenu li {
  padding: 0;
  margin: 0;
  font-size: 15px;
  color: #eee;
}

/*------  OPCIONES EXTRA DEL MENÚ MÓVIL  ------*/
.extra-options {
  border-top: 1px solid #445a85;
  margin-top: 2rem;
  padding-top: 1.5rem;
  text-align: center;
  color: #ccc;
  font-size: 1rem;
}

.extra-options p {
  margin-bottom: 1.5rem;
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 1px;
  color: #aaa;
}

.extra-options a {
  display: block;
  margin: 0.7rem 0;
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
}

.extra-options img {
  margin-right: 0.4rem;
  vertical-align: middle;
}

/*------  BOTONES ESPECIALES (PDF, BANDERA)  ------*/
.extra-hover-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  margin: 0.5rem auto;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  border: 1px solid transparent;
  background-color: transparent;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
  width: fit-content;
  max-width: 100%;
}

.extra-hover-btn img {
  width: 20px;
  height: auto;
  margin-right: 8px;
  vertical-align: middle;
}

.extra-hover-btn span {
  display: inline-block;
}

.extra-hover-btn:hover {
    background-color: var(--secondary-color);
  color: var(--white);
  border-color: var(--secondary-color);
}

.extra-hover-btn:hover img {
  filter: brightness(0.8);
}

.hnz-icon-pdf {
   color: var(--secondary-color);
  font-size: 1.1rem;
  margin-right: 8px;
}
.extra-hover-btn:hover .hnz-icon-pdf {
  color: var(--white);
}
.centered-btn {
  display: flex;
  justify-content: center;
}

/*------  OVERLAY DEL MENÚ MÓVIL  ------*/
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(4px);
  background-color: rgba(10, 26, 58, 0.35);
  z-index: var(--overlay-zindex);
  opacity: 0;
  transition: opacity var(--transition-speed);
  pointer-events: none;
  backdrop-filter: blur(2px);
}

.menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/*------  ANIMACIONES  ------*/
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.top-header.animate {
  animation: fadeInDown 0.3s ease-out forwards;
}

/*------  ACCESIBILIDAD  ------*/
.desktop-menu > li > a,
.mobile-menu li a {
  outline: none;
}

.desktop-menu > li > a:focus-visible,
.submenu-column li a:focus-visible,
.mobile-menu li a:focus-visible {
  outline: 2px solid var(--secondary-color);
  outline-offset: 3px;
  border-radius: 2px;
}

:focus-visible {
  outline: 2px solid var(--secondary-color);
  outline-offset: 3px;
}

[aria-current="page"] {
   color: var(--secondary-color) !important;
  font-weight: 600;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
}

.mobile-menu[aria-hidden="true"] {
  display: none;
}

/*------  ESTADOS ACTIVOS PARA EL MENÚ  ------*/
.desktop-menu > li.active > a,
.desktop-menu > li.active-parent > a {
    color: var(--secondary-color) !important;
    font-weight: 600;
}

.desktop-menu > li.active > a::after,
.desktop-menu > li.active-parent > a::after {
    width: 100%;
    background-color: var(--secondary-color) !important;
}

.desktop-menu > li.active > a::before,
.desktop-menu > li.active-parent > a::before {
    color: var(--secondary-color) !important;
}

.submenu-column li a.active {
    color: var(--secondary-color) !important;
    background-color: rgba(200, 159, 76, 0.1);
    padding-left: 5px;
    border-radius: 4px;
}

.submenu-column li a.active::before {
    color: var(--secondary-color) !important;
    transform: translateX(4px);
}

.mobile-menu li a.active {
    color: var(--secondary-color) !important;
    background-color: rgba(200, 159, 76, 0.2);
    border-left: 4px solid var(--secondary-color);
}

.mobile-menu .has-submenu.active-parent > a,
.mobile-menu .has-submenu.active-parent > .menu-toggle {
    color: var(--secondary-color) !important;
}

.mobile-menu .submenu li a.active {
    color: var(--secondary-color) !important;
    background-color: rgba(200, 159, 76, 0.15);
}

.category-title {
  font-weight: 600;
  padding: 6px 0 10px 0;
  color: #0A1A3A;
  font-size: 0.95rem;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 6px;
}

/*------  MEDIA QUERIES - DISEÑO RESPONSIVO  ------*/

/* Punto de quiebre para menú móvil (≤1242px) */
@media (max-width: 1242px) {
  #mobileMenuBtn {
    display: block;
  }

  .desktop-menu {
    display: none;
  }
 
  #mobileMenu {
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    height: 100vh;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1001;
  }

  #mobileMenu.active {
    transform: translateX(0);
  }

  #menuOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
  }

  #menuOverlay.active {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Tablet (≤994px) - Ocultar top-header */
@media (max-width: 994px) {
  .top-header {
    display: none;
    height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
  }
  
  body.has-top-header {
    padding-top: 0 !important;
  }
  
  .main-header {
    top: 0 !important;
  }
  
  .mobile-menu-btn {
    display: block;
  }
}

/* Móviles pequeños (≤768px) - Ajustar top-header */
@media (max-width: 768px) {
  .top-header-container {
    padding: 0.5rem 15px;
  }
  
  .top-header-contacts,
  .top-header-links {
    gap: 0.7rem;
  }
  
  .top-header a {
    font-size: 0.8rem;
  }
}

/*------  COMPATIBILIDAD CON OTROS COMPONENTES  ------*/
.mobile-menu {
  z-index: 1002;
}

.mobile-menu.active {
  transform: translateX(0);
}

.main-content {
  padding-top: calc(var(--header-height) + 20px);
}

/*------  AJUSTES ESPECÍFICOS PARA EL LOGO EN MÓVILES  ------*/

/* Ajustes solo para móviles - solución CSS-only */
@media (max-width: 992px) {
    .logo-header-container {
        width: 250px;
        height: 85px;
        padding: 0.4rem 0.9rem;
    }
    
    .logo img {
        max-width: 250px;
        max-height: 85px;
    }
}

@media (max-width: 768px) {
    .logo-header-container {
        width: 220px;
        height: 75px;
        padding: 0.3rem 0.8rem;
    }
    
    .logo img {
        max-width: 220px;
        max-height: 75px;
    }
    
    .header-content {
        padding: 5px 0;
    }
}

@media (max-width: 480px) {
    .logo-header-container {
        width: 180px;
        height: 65px;
        padding: 0.2rem 0.6rem;
    }
    
    .logo img {
        max-width: 180px;
        max-height: 65px;
    }
}

/* Asegurar que el logo siempre sea visible y no se superponga */
@media (max-width: 768px) {
    .header-content {
        justify-content: space-between;
        padding: 0 10px;
    }
    
    .mobile-menu-btn {
        margin-left: auto;
    }
}

/*------  CAMBIOS ESPECÍFICOS PARA MÓVIL - DEGRADADO Y BOTÓN BLANCO  ------*/

/* Desktop grande (≥1200px) - Medidas originales */
@media (min-width: 1200px) {
  .logo-header-container {
    width: 290px;
    height: 98px;
    padding: 0.5rem 1rem;
  }
  
  .logo img {
    max-width: 100%;
    max-height: 100%;
  }
}

/* En desktop (>992px) - mantener diseño original */
@media (min-width: 993px) {
    .main-header {
        background-color: white;
    }
    
    .logo-header-container {
       width: 260px;
    height: 88px;
    padding: 0.45rem 0.9rem;
        background: linear-gradient(to bottom, #000f2d 0%, #001c57 50%, #000f2d 100%);
    }
    
    .mobile-menu-btn {
        color: #000000;
    }
}

/* En móvil/tablet (≤992px) - aplicar cambios */
@media (max-width: 992px) {
    .main-header {
        background: linear-gradient(to bottom, #000f2d 0%, #001c57 50%, #000f2d 100%) !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .logo-header-container {
           width: 220px;
    height: 74px;
    padding: 0.4rem 0.75rem;
    background: transparent !important;
    }
    
    .mobile-menu-btn {
        color: white !important;
    }
    
    .mobile-menu-btn .menu-icon {
        color: white;
    }
    
    .logo img {
      max-width: 220px;
    max-height: 74px;
    }
}

/* Ajustes para móviles más pequeños */
@media (max-width: 768px) {
   .logo-header-container {
    width: 200px;
    height: 68px;
    padding: 0.35rem 0.7rem;
  }
  
  .logo img {
    max-width: 200px;
    max-height: 68px;
  }
}

/* Móviles grandes (≤576px) */
@media (max-width: 576px) {
  .logo-header-container {
    width: 180px;
    height: 61px;
    padding: 0.3rem 0.6rem;
  }
  
  .logo img {
    max-width: 180px;
    max-height: 61px;
  }
}

@media (max-width: 480px) {
  .logo-header-container {
    width: 160px;
    height: 54px;
    padding: 0.25rem 0.5rem;
  }
  
  .logo img {
    max-width: 160px;
    max-height: 54px;
  }
}

/*------  WPO HEADER STABILITY  ------*/
.main-header,
.top-header {
  contain: layout style;
}

.logo-header-container {
  contain: layout paint;
}

.submenu-content {
  will-change: opacity, transform;
}