/**
 * Header Modern Styles
 * Estilos modernos para el header de MegaGadgets
 * Basado en el prototipo: Plugins/TemplateMega/header-prototype.html
 */

/* ============================================
   HEADER BOTTOM GRADIENT
   ============================================ */

.header-2 .header-bottom {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%) !important;
}

/* ============================================
   BOTON CATEGORIAS
   ============================================ */

.catmenu-trigger {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 14px 24px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    color: #fff !important;
    min-width: 140px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 10px rgba(249, 115, 22, 0.3);
}

.catmenu-trigger span {
    color: #fff !important;
}

/* Ocultar flecha original del span::after */
.catmenu-trigger span::after {
    display: none !important;
    content: none !important;
    border: none !important;
    width: 0 !important;
    height: 0 !important;
}

.catmenu-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.5) !important;
}

.catmenu-body {
    border-radius: 8px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15) !important;
}

/* ============================================
   NAVEGACION
   ============================================ */

.ho-navigation-2 ul li a {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    padding: 15px 18px !important;
    position: relative;
    transition: all 0.3s ease;
}

.ho-navigation-2 ul li a::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 18px;
    right: 18px;
    height: 2px;
    background: #f97316;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.ho-navigation-2 ul li a:hover {
    color: #fff !important;
}

.ho-navigation-2 ul li a:hover::after {
    transform: scaleX(1);
}

/* ============================================
   GRADIENTES PERSONALIZADOS
   ============================================ */

.gradient-orange {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

/* ============================================
   INFO DE CONTACTO EN HEADER BOTTOM
   ============================================ */

.header-contactinfo {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.header-contactinfo i,
.header-contactinfo .flaticon-support {
    font-size: 28px !important;
    color: #f97316 !important;
}

.header-contactinfo span {
    color: rgba(255,255,255,0.7) !important;
    font-size: 12px !important;
}

.header-contactinfo a {
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    display: block !important;
}

.header-contactinfo a:hover {
    color: #f97316 !important;
}

/* ============================================
   MOBILE MENU - Hamburguesa
   ============================================ */

/* Boton hamburguesa - oculto por defecto */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.mobile-menu-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.mobile-menu-toggle .hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 22px;
}

.mobile-menu-toggle .hamburger-icon span {
    display: block;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Overlay de fondo */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Drawer de navegacion movil */
.mobile-nav-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.15);
}

.mobile-nav-drawer.active {
    left: 0;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
    border-bottom: 3px solid #f97316;
}

.mobile-nav-header img {
    max-height: 35px;
}

.mobile-nav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-nav-close:hover {
    background: #f97316;
}

.mobile-nav-menu {
    padding: 0;
    margin: 0;
    list-style: none;
}

.mobile-nav-menu li {
    border-bottom: 1px solid #eee;
}

.mobile-nav-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: #333;
    font-weight: 500;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mobile-nav-menu li a i {
    font-size: 18px;
    color: #f97316;
    width: 24px;
    text-align: center;
}

.mobile-nav-menu li a:hover {
    background: #f5f5f5;
    padding-left: 25px;
}

.mobile-nav-contact {
    padding: 20px;
    background: #f5f5f5;
    margin-top: 20px;
}

.mobile-nav-contact-title {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.mobile-nav-contact a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1e3a5f;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
}

.mobile-nav-contact a i {
    color: #f97316;
}

/* ============================================
   RESPONSIVE - MOBILE (991px y menos)
   ============================================ */

@media (max-width: 991px) {
    /* Header middle */
    .header-middle {
        padding: 10px 0 !important;
    }

    .header-middle .row {
        flex-wrap: wrap;
        align-items: center;
    }

    /* Header icons - alinear a la derecha */
    .header-icons {
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
        gap: 10px !important;
    }

    /* Ocultar navegacion horizontal en movil */
    .ho-navigation,
    .ho-navigation-2 {
        display: none !important;
    }

    /* Header bottom en columna */
    .header-bottom {
        padding: 10px 0 !important;
    }

    .header-bottom .row {
        flex-direction: column;
    }

    .header-bottom .col-lg-10,
    .header-bottom .col-lg-2,
    .header-bottom .col-md-5,
    .header-bottom .col-sm-5 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* Catmenu en movil - ancho completo */
    .header-catmenu,
    .catmenu {
        width: 100%;
        margin-bottom: 10px;
        position: relative;
        z-index: 100;
    }

    .catmenu-trigger {
        width: 100% !important;
        padding: 12px 20px !important;
        position: relative;
        z-index: 101;
    }

    .catmenu-body {
        z-index: 102 !important;
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        top: 100% !important;
    }

    /* Info contacto en movil - centrada */
    .header-contactinfo {
        justify-content: center !important;
        padding: 15px 0 !important;
        margin-top: 10px;
    }

    /* Mostrar boton hamburguesa */
    .mobile-menu-toggle {
        display: flex !important;
    }

    /* Mobile nav drawer y overlay */
    .mobile-nav-drawer {
        display: block !important;
    }

    /* Overlay solo visible cuando tiene clase active */
    .mobile-nav-overlay {
        display: block !important;
        pointer-events: none;
        visibility: hidden;
    }

    .mobile-nav-overlay.active {
        pointer-events: auto;
        visibility: visible;
    }
}

/* ============================================
   RESPONSIVE - EXTRA SMALL (575px y menos)
   ============================================ */

@media (max-width: 575px) {
    /* Ajustes extra para pantallas muy pequenas */
    .header-middle {
        padding: 10px 0 !important;
    }

    .header-logo img {
        max-height: 40px;
        width: auto;
    }

    /* Search box aun mas compacto */
    .header-middle .col-lg-6 > div {
        padding-left: 10px !important;
        padding-right: 3px !important;
    }

    .header-middle .col-lg-6 input {
        font-size: 13px !important;
        padding: 8px !important;
    }

    .header-middle .col-lg-6 button {
        width: 36px !important;
        height: 36px !important;
    }

    /* Iconos header */
    .header-account button {
        padding: 8px !important;
        border-radius: 50% !important;
    }

    .header-cart a {
        width: 36px !important;
        height: 36px !important;
    }

    .header-cart .count {
        min-width: 16px !important;
        height: 16px !important;
        font-size: 9px !important;
    }
}

/* ============================================
   FIX: Bootstrap Collapse vs Tailwind Collapse
   Tailwind aplica visibility: collapse a .collapse
   Bootstrap necesita visibility: visible en .collapse.show
   ============================================ */

.collapse.show {
    visibility: visible !important;
}

.collapse:not(.show) {
    display: none;
}

/* ============================================
   FOOTER - Servicio al Cliente contrast fix
   ============================================ */

.footer-widget.widget-customerservice {
    background: #1e3a5f; /* Navy — matches site design system */
}

.footer-widget.widget-customerservice .info h2,
.footer-widget.widget-customerservice .info h3,
.footer-widget.widget-customerservice .info h4,
.footer-widget.widget-customerservice .info h5,
.footer-widget.widget-customerservice .info h6 {
    color: #e5e7eb; /* Light gray — ~10:1 contrast on navy */
}

.footer-widget.widget-customerservice .info h5 a,
.footer-widget.widget-customerservice .info h6 a {
    color: #f97316; /* Orange — matches design system */
}