/* ========================================
   NUEVO HEADER - CSS AISLADO
   Todos los estilos con prefijo .header-nuevo-
   para evitar conflictos con estilos existentes
   ======================================== */

/* Contenedor principal del header */
.header-nuevo-container {
    width: 100%;
    height: 153px;
    background-color: #FFFFFF;
    position: relative;
    display: flex;
    align-items: center;
    z-index: 998;
}

/* Logo PMC */
.header-nuevo-logo {
    position: absolute;
    left: 116px;
    top: 29px;
    width: 153px;
    height: 86px;
    overflow: hidden;
}

.header-nuevo-logo a {
    display: block;
    width: 100%;
    height: 100%;
}

.header-nuevo-logo img {
    width: 100%;
    height: auto;
    display: block;
}

/* Texto descriptivo superior */
.header-nuevo-descripcion {
    position: absolute;
    right: 115px;
    top: 21px;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: 16px;
    color: #3A4F39;
    text-align: right;
    white-space: nowrap;
    line-height: normal;
}

/* Línea separadora horizontal */
.header-nuevo-separador {
    position: absolute;
    right: 115px;
    top: 55px;
    width: 1469px;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.12);
}

/* Contenedor de navegación y búsqueda */
.header-nuevo-nav-busqueda {
    position: absolute;
    left: 336px;
    top: 93px;
    right: 434px;
    display: flex;
    align-items: center;
    gap: 50px;
}

/* Menú de navegación (Productos, Servicios) */
.header-nuevo-menu-nav {
    display: flex;
    gap: 50px;
    align-items: center;
    flex-shrink: 0;
}

.header-nuevo-menu-nav span {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.5px;
    color: #2D2E2E;
    cursor: pointer;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.header-nuevo-menu-nav span:hover {
    color: #3CAA36;
}

/* Barra de búsqueda inline */
.header-nuevo-busqueda-inline {
    display: flex;
    align-items: center;
    gap: 22px;
    flex: 1;
    min-width: 0;
}

.header-nuevo-busqueda-icono {
    width: 24px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.header-nuevo-busqueda-icono:hover {
    transform: scale(1.1);
}

.header-nuevo-busqueda-icono img {
    width: 100%;
    height: 100%;
    display: block;
}

.header-nuevo-busqueda-linea-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}

.header-nuevo-busqueda-linea-wrapper::before {
    content: 'Buscar por producto o referencia';
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #9E9E9E;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.header-nuevo-busqueda-linea-wrapper:has(.header-nuevo-busqueda-input.visible)::before {
    opacity: 0;
}

.header-nuevo-busqueda-linea {
    width: 100%;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.12);
}

.header-nuevo-busqueda-input {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    right: 24px;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.25px;
    color: #2D2E2E;
    padding: 0;
    display: none;
}

.header-nuevo-busqueda-input.visible {
    display: block;
}

.header-nuevo-busqueda-input::placeholder {
    color: #9E9E9E;
}

/* Sugerencias de búsqueda */
.header-nuevo-busqueda-sugerencias {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 400px;
    overflow-y: auto;
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999;
    display: none;
}

.header-nuevo-busqueda-sugerencias.visible {
    display: block;
}

.header-nuevo-sugerencia-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #F5F5F5;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background-color 0.2s ease;
}

.header-nuevo-sugerencia-item:last-child {
    border-bottom: none;
}

.header-nuevo-sugerencia-item:hover {
    background-color: #F5F5F5;
}

.header-nuevo-sugerencia-imagen {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.header-nuevo-sugerencia-icono {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F5F5F5;
    border-radius: 4px;
    font-size: 20px;
    flex-shrink: 0;
}

.header-nuevo-sugerencia-texto {
    flex: 1;
    min-width: 0;
}

.header-nuevo-sugerencia-nombre {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #2D2E2E;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-nuevo-sugerencia-referencia {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 12px;
    color: #9E9E9E;
}

.header-nuevo-sugerencia-precio {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #3CAA36;
    margin-left: 8px;
}

.header-nuevo-sugerencia-tipo {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 11px;
    color: #9E9E9E;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Contenedor de iconos de acción (carrito, favoritos, login) */
.header-nuevo-iconos-accion {
    position: absolute;
    right: 115px;
    top: 93px;
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Icono individual */
.header-nuevo-icono {
    width: 24px;
    height: 24px;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease;
}

.header-nuevo-icono:hover {
    transform: scale(1.1);
}

.header-nuevo-icono img {
    width: 100%;
    height: 100%;
    display: block;
}

/* Badge de contador (para carrito y favoritos) */
.header-nuevo-icono.items::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: #3CAA36;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
}

/* Botón Log In / Sign Up */
.header-nuevo-boton-login {
    background: transparent;
    border: 1px solid #3CAA36;
    border-radius: 5px;
    height: 46px;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.header-nuevo-boton-login span {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.15px;
    color: #3CAA36;
}

.header-nuevo-boton-login:hover {
    background-color: #3CAA36;
}

.header-nuevo-boton-login:hover span {
    color: #FFFFFF;
}

/* Menú de usuario (cuando está logueado) */
.header-nuevo-usuario-menu {
    position: relative;
}

.header-nuevo-usuario-nombre {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.header-nuevo-usuario-nombre:hover {
    background-color: #F5F5F5;
}

.header-nuevo-usuario-nombre .welcome-text {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: 14px;
    color: #9E9E9E;
}

.header-nuevo-usuario-nombre .user-display-name {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #2D2E2E;
}

.header-nuevo-usuario-nombre i {
    font-size: 12px;
    color: #9E9E9E;
    transition: transform 0.3s ease;
}

.header-nuevo-usuario-nombre:hover i {
    transform: rotate(180deg);
}

/* Overlay para cerrar menús */
.header-nuevo-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 996;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.header-nuevo-overlay.active {
    display: block;
    opacity: 1;
}

/* Menús desplegables (productos, servicios) */
.header-nuevo-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #FFFFFF;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 8px 8px;
    z-index: 999;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.header-nuevo-dropdown.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 1600px) {
    .header-nuevo-separador {
        width: calc(100% - 336px - 115px);
    }
    
    .header-nuevo-nav-busqueda {
        right: 200px;
    }
}

@media (max-width: 1200px) {
    .header-nuevo-logo {
        left: 50px;
    }
    
    .header-nuevo-descripcion {
        right: 50px;
        font-size: 14px;
    }
    
    .header-nuevo-separador {
        right: 50px;
    }
    
    .header-nuevo-nav-busqueda {
        left: 220px;
        right: 150px;
    }
    
    .header-nuevo-iconos-accion {
        right: 50px;
    }
}

/* Ocultar elementos responsive del header antiguo */
#menuIcon,
#menuResponsive {
    display: none !important;
}

/* ========================================
   MENÚS DESPLEGABLES - PRODUCTOS Y SERVICIOS
   ======================================== */

/* Menú de productos */
.productos-menu-container {
    position: absolute !important;
    top: 153px !important;
    left: 56svw !important;
    margin-top: 0px !important;
    right: 0 !important;
    background: #FFFFFF;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 997;
    display: none !important;
    grid-template-columns: 300px 1fr;
}

.productos-menu-container.visible {
    display: grid !important;
}

/* Menú de servicios */
.servicios-menu-container {
    position: fixed !important;
    top: 153px !important;
    left: 0 !important;
    right: 0 !important;
    background: #FFFFFF;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 997;
    display: none !important;
    grid-template-columns: 300px 1fr;
}

.servicios-menu-container.visible {
    display: grid !important;
}

/* Estilos para las categorías principales */
#primary_categories {
    background-color: #FFFFFF;
    padding: 20px 0;
}

.promociones-mes {
    background: linear-gradient(90deg, #3CAA36 0%, #2e8a2a 100%);
    color: #FFFFFF;
    padding: 15px 20px;
    cursor: pointer;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    font-size: 16px;
    transition: transform 0.2s ease;
}


.familias-titulo {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #757575;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.categoria-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.categoria-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background-color: #3CAA36;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.categoria-item:hover,
.categoria-item.selected {
    background-color: #f2f2f2;
}

.categoria-item:hover::before,
.categoria-item.selected::before {
    opacity: 1;
}

.categoria-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.categoria-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.categoria-text {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #2D2E2E;
}

/* Panel de subcategorías */
#subcategories_panel {
    background-color: #f2f2f2;
    padding: 30px;
    overflow-y: auto;
    max-height: calc(100vh - 153px);
}

.subcategories {
    display: none;
}

.subcategories.active {
    display: grid;
}

/* Servicios */
#servicios_categories {
    background-color: #FFFFFF;
    padding: 30px 20px;
}

#servicios_categories h3 {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: #2D2E2E;
    margin-bottom: 20px;
}

.servicios-image-area {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    min-height: 400px;
}

.servicios-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 30px;
    color: #FFFFFF;
}

#service-overlay-title {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    font-size: 32px;
    margin-bottom: 10px;
}

#service-overlay-description {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.cta-button {
    display: inline-block;
    background: #3CAA36;
    color: #FFFFFF;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    font-size: 16px;
    transition: background 0.3s ease;
}

.cta-button:hover {
    background: #2e8a2a;
}
