/* Layout Principal - Estilos del Header, Footer y Dropdowns */

/* ============================================================================
   TIPOGRAFÍAS PERSONALIZADAS
   ============================================================================
   Implementación de fuentes Non Bureau y Helvetica Neue según requerimientos:
   - Non Bureau: Usada para títulos, menú, botones y enlaces
   - Helvetica Neue: Usada para párrafos, listas y texto general

   Fecha de implementación: Noviembre 2025
   ============================================================================ */

/* Non Bureau - Regular (400) */
@font-face {
    font-family: 'NonBureau';
    src: url('../fonts/non-bureau/NonBureau-Regular-BF67107aef52442.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

/* Non Bureau - SemiBold (600) */
@font-face {
    font-family: 'NonBureau';
    src: url('../fonts/non-bureau/NonBureau-SemiBold-BF67107aef345d9.otf') format('opentype');
    font-weight: 600;
    font-style: normal;
}

/* Non Bureau - Bold (700) */
@font-face {
    font-family: 'NonBureau';
    src: url('../fonts/non-bureau/NonBureau-Bold-BF67107aef55bf1.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

/* Helvetica Neue - Regular (400) */
@font-face {
    font-family: 'HelveticaNeue';
    src: url('../fonts/helvetica-neue-5/HelveticaNeueRoman.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

/* Helvetica Neue - Bold (700) */
@font-face {
    font-family: 'HelveticaNeue';
    src: url('../fonts/helvetica-neue-5/HelveticaNeueBold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

/* ============================================================================
   ESTILOS GENERALES DEL SITIO
   ============================================================================ */

/* Fuente base para todo el sitio - Helvetica Neue Regular */
body {
    font-family: "HelveticaNeue", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Títulos en todo el sitio - Non Bureau Bold */
h1, h2, h3, h4, h5, h6 {
	font-family: "NonBureau", sans-serif;
    font-weight: 700; /* Bold */
}

/* Párrafos, listas e items - Helvetica Neue Regular */
p, ul, li {
    font-family: "HelveticaNeue", sans-serif;
}

/* Enlaces y botones - Non Bureau Semi Bold */
a, .btn {
    font-family: "NonBureau", sans-serif;
    font-weight: 600; /* Semi Bold */
    letter-spacing: 1px;
}

/* ============================================================================
   PRE HEADER (Barra superior con contacto y redes sociales)
   ============================================================================
   Requerimiento: Helvetica Neue Regular a 20px (desktop)
   Responsive: Se adapta desde 14px (móvil) hasta 20px (desktop)
   Fórmula clamp: clamp(min, preferido, max)
   ============================================================================ */
header.sticky-top .top-bar {
    font-family: "HelveticaNeue", sans-serif;
    font-size: clamp(14px, 1.25vw, 20px);
    background-color: #1b1e34 !important;
    padding: 0.35rem 0;
}

/* ============================================================================
   MENÚ PRINCIPAL
   ============================================================================
   Requerimiento: Non Bureau Bold a 24px (desktop)
   Responsive: Se adapta desde 16px (móvil) hasta 24px (desktop)
   - Menú primer nivel (nav-link)
   - Submenús (dropdown-item)
   ============================================================================ */

/* Menú primer nivel - Non Bureau Bold responsive */
.navbar-nav .nav-link {
    font-family: "NonBureau", sans-serif !important;
    font-weight: 600 !important; /* SemiBold para mejor renderizado en Windows */
    font-size: 18px !important; /* Aumentado de 16px para mejor renderizado en pantallas 1x */
    letter-spacing: 1px !important;
}

/* ============================================================================
   FIX PARA PANTALLAS DE BAJA DENSIDAD (devicePixelRatio = 1)
   ============================================================================
   En pantallas Windows estándar (1366x768, 1920x1080 sin escalado),
   las fuentes OTF como NonBureau tienen problemas de renderizado donde
   el punto de la "i" se pega al cuerpo debido a la falta de subpíxeles.

   Esta media query detecta pantallas con ratio 1x y aplica correcciones.
   ============================================================================ */
@media screen and (-webkit-min-device-pixel-ratio: 1) and (-webkit-max-device-pixel-ratio: 1.25),
       screen and (min-resolution: 96dpi) and (max-resolution: 120dpi) {
    .navbar-nav .nav-link {
        font-size: 17px !important;
        letter-spacing: 1.2px !important;
        /* Forzar antialiasing subpixel en Windows */
        -webkit-font-smoothing: subpixel-antialiased !important;
        font-smooth: always !important;
    }
}

/* Submenús - Non Bureau Bold responsive */
.dropdown-menu .dropdown-item {
    font-family: "NonBureau", sans-serif !important;
    font-weight: normal !important; /* Bold */
    font-size: clamp(14px, 1.25vw, 18px) !important;
}

/* ============================================================================
   FOOTER
   ============================================================================
   Requerimientos responsive:
   - Títulos: Non Bureau Bold desde 24px (móvil) hasta 36px (desktop)
   - Párrafos y Submenú: Non Bureau Regular desde 16px (móvil) hasta 30px (desktop)
   - Barra de copyright: Helvetica Neue Regular desde 14px (móvil) hasta 20px (desktop)
   ============================================================================ */

/* Títulos del footer - Non Bureau Bold responsive */
.site-footer h5 {
    font-family: "NonBureau", sans-serif;
    font-weight: 700; /* Bold */
    font-size: clamp(24px, 2.25vw, 36px);
}

/* Párrafos y enlaces del footer - Non Bureau Regular responsive */
.site-footer p, .site-footer .footer-links a {
    font-family: "NonBureau", sans-serif;
    font-weight: 400; /* Regular */
    font-size: clamp(16px, 1.875vw, 30px);
}

/* Barra de copyright - Helvetica Neue Regular responsive */
.copyright-bar {
    font-family: "HelveticaNeue", sans-serif;
    font-size: 13px;
}

/* Logo del footer responsive */
.site-footer .logo-footer {
    max-width: clamp(150px, 20vw, 250px);
    height: auto;
}

/* Títulos de contacto en footer - responsive */
.site-footer .contact-blocks h6 {
    font-family: "NonBureau", sans-serif;
    font-weight: 700;
    font-size: clamp(16px, 1.5vw, 24px);
}

/* Iconos sociales del footer - responsive */
.social-icons-footer {
    font-size: clamp(18px, 1.75vw, 28px);
}

/* Botones del formulario de newsletter */
.site-footer .btn {
    font-size: clamp(14px, 1.125vw, 18px);
}

/* Inputs del formulario */
.site-footer .form-control {
    font-size: clamp(14px, 1vw, 16px);
}

/* Critical CSS for Sticky Header */
header.sticky-top {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1050 !important;
    width: 100% !important;
    background: transparent !important;
}

header.sticky-top .top-bar {
    background-color: #000000 !important;
    padding: 0.35rem 0;
}

header.sticky-top .navbar {
    background-color: #fff !important;
}

/* Logo responsive - se ajusta según el viewport */
.navbar-brand .logo-header {
    max-width: clamp(120px, 15vw, 200px);
    height: auto;
}

header.sticky-top .top-bar .container {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

header.sticky-top .top-bar .contact-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 1.25rem;
    /* Heredará el font-size responsive del .top-bar */
}

header.sticky-top .top-bar .contact-info a,
header.sticky-top .top-bar .contact-info span {
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

header.sticky-top .top-bar .social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 1rem;
    margin-left: auto;
}

header.sticky-top .top-bar .social-icons a {
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

header.sticky-top .top-bar .exchange-rates {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    /* Font-size ajustado automáticamente con el .top-bar */
}

header.sticky-top .top-bar .social-icons {
    margin-left: auto;
}

/* Hover Dropdown Styles */
.dropdown-hover .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0;
    font-size: 1rem;
    color: #212529;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
    transition: opacity 0.15s ease-in-out, visibility 0.15s ease-in-out;
}

.dropdown-hover .dropdown-menu.show {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Solo aplicar hover en desktop */
@media (min-width: 992px) {
    .dropdown-hover:hover .dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
    }
}

.dropdown-hover .dropdown-item {
    display: block;
    width: 100%;
    padding: 0.25rem 1rem;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    transition: background-color 0.15s ease-in-out;
}
.dropdown-hover .dropdown-item:hover {
    color: #1e2125;
    background-color: #e9ecef;
}

.dropdown-hover .dropdown-item:focus {
    color: #1e2125;
    background-color: #e9ecef;
}

/* ============================================================================
   FIX PARA OUTLINE EN ELEMENTOS DEL NAVBAR (iOS/Safari y móviles)
   ============================================================================
   Elimina el outline azul que aparece al tocar elementos del menú,
   especialmente visible en dispositivos Apple (iOS Safari).
   ============================================================================ */
.navbar-nav .nav-link,
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link:active,
.navbar-nav .dropdown-toggle,
.navbar-nav .dropdown-toggle:focus,
.navbar-nav .dropdown-toggle:active,
.dropdown-hover .dropdown-item:focus,
.dropdown-hover .dropdown-item:active {
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* Eliminar outline en el contenedor del dropdown también */
.navbar-nav .nav-item,
.navbar-nav .nav-item:focus,
.navbar-nav .nav-item:active,
.navbar-nav .dropdown,
.navbar-nav .dropdown:focus,
.navbar-nav .dropdown:active {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* ============================================================================
   MEDIA QUERIES - TABLET Y MÓVIL
   ============================================================================
   Ajustes específicos para resoluciones menores a 992px
   ============================================================================ */
@media (max-width: 991.98px) {
    /* Dropdown en móvil mantiene comportamiento de click */
    .dropdown-hover .dropdown-menu {
        position: static;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: transparent;
        border: 0;
        box-shadow: none;
    }

    .dropdown-hover .dropdown-item {
        padding: 0.5rem 1rem;
        color: #6c757d;
        text-align: center;
    }

    .dropdown-hover .dropdown-item:hover {
        color: #495057;
        background-color: transparent;
    }

    /* Ajustes del top-bar para tablet/móvil */
    header.sticky-top .top-bar .container {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    header.sticky-top .top-bar .contact-info {
        justify-content: center;
        row-gap: 0.5rem;
        width: 100%;
        flex-direction: row;
    }

    header.sticky-top .top-bar .contact-info a {
        flex: 0 1 auto;
        justify-content: center;
        text-align: center;
    }

    /* Ocultar tipo de cambio en resoluciones pequeñas */
    header.sticky-top .top-bar .exchange-rates {
        display: none !important;
    }

    header.sticky-top .top-bar .social-icons {
        justify-content: center;
        font-size: clamp(16px, 2vw, 20px);
        gap: 0.75rem;
        margin-left: 0;
    }
}

/* ============================================================================
   MEDIA QUERIES - MÓVILES PEQUEÑOS
   ============================================================================
   Ajustes específicos para resoluciones menores a 576px
   ============================================================================ */
@media (max-width: 575.98px) {
    header.sticky-top .top-bar {
        padding: 0.5rem 0;
    }

    header.sticky-top .top-bar .contact-info {
        display: none;
    }

    header.sticky-top .top-bar .contact-info {
        gap: 0.65rem;
        flex-direction: column;
    }

    header.sticky-top .top-bar .contact-info a {
        flex: 0 1 auto;
        justify-content: center;
        text-align: center;
        width: auto;
    }

    header.sticky-top .top-bar .exchange-rates {
        display: none !important;
    }

    /* Ajuste adicional para íconos sociales en móviles muy pequeños */
    header.sticky-top .top-bar .social-icons {
        font-size: clamp(14px, 3vw, 18px);
    }
}
