/* =======================================================
 * ESTILOS GENERALES Y FUENTES
 * ======================================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-primary: #e74c3c;
    --color-secondary: #2c3e50;
    --color-text-dark: #333;
    --bg-white: #ffffff;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-white);
    color: var(--color-text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* =======================================================
 * NAVEGACIÓN PRINCIPAL
 * ======================================================= */
.main-header {
    background-color: var(--bg-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.main-nav a {
    text-decoration: none;
    color: var(--color-secondary);
    font-weight: 600;
    transition: color 0.3s;
    white-space: nowrap;
}

.main-nav a:hover {
    color: var(--color-primary);
}

.company-switch-item {
    display: flex;
    align-items: center;
}

.company-switch-link {
    display: inline-flex !important;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1px;
    padding: 7px 11px !important;
    border: 1px solid rgba(231, 76, 60, 0.28);
    border-radius: 8px;
    color: var(--color-secondary) !important;
    line-height: 1.15;
    white-space: nowrap;
    background: #fff;
}

.company-switch-link:hover {
    border-color: var(--color-primary);
    color: var(--color-primary) !important;
}

.company-switch-kicker {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0;
}

/* =======================================================
 * ESTILOS DE LA BARRA DE BÚSQUEDA
 * ======================================================= */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    border: 2px solid #ddd;
    border-radius: 25px;
    padding: 5px 15px;
    transition: all 0.3s ease;
    width: 300px;
}

.search-box:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.3);
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    padding: 8px 0;
    font-size: 1rem;
    color: var(--color-text-dark);
}

.search-button {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: 1.2rem;
}

.search-button:hover {
    color: var(--color-primary);
}

/* Estilos para la caja de sugerencias del buscador */
.suggestions-box {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-white);
    border: 1px solid #ddd;
    border-top: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 8px 8px;
    z-index: 999;
    max-height: 250px;
    overflow-y: auto;
}

.suggestions-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.suggestions-box li {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.suggestions-box li:hover {
    background-color: #f0f0f0;
}

.suggestions-box li a {
    text-decoration: none;
    color: var(--color-secondary);
    display: block;
}

.technical-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.technical-table th,
.technical-table td {
    padding: 0.85rem 1rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.technical-table th {
    background: #f8f9fa;
    color: var(--color-secondary);
}

/* =======================================================
 * ESTILOS DEL MENÚ DESPLEGABLE DE PRODUCTOS
 * ======================================================= */
.has-dropdown {
    position: relative;
}

.dropdown-arrow {
    cursor: pointer;
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

@media (min-width: 769px) {
    .company-switch-link {
        padding: 5px 8px !important;
        font-size: 0.82rem;
    }

    .company-switch-kicker {
        font-size: 0.58rem;
    }

    .has-dropdown {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

    .dropdown-arrow {
        margin-left: 0;
    }
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-white);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    border-radius: 12px;
    z-index: 1000;
    min-width: 250px;
    /* --- LÍNEAS AÑADIDAS PARA EL SCROLL --- */
    max-height: 50vh; 
    overflow-y: auto;
}

/* La clave: Aseguramos que la lista sea un bloque */
.main-categories-list {
    list-style: none;
    display: block;
    padding: 0;
    margin: 0;
}

.has-sub-menu {
    display: flex;
    /* justify-content: space-between; <-- Eliminamos esta línea */
    align-items: center;
    padding: 8px 0;
    position: relative;
}

.category-link {
    display: block;
    cursor: pointer;
    font-weight: 600;
    color: var(--color-secondary);
    transition: color 0.3s;
    font-size: 1em;
    text-decoration: none;
    padding: 0;
}

.category-link:hover {
    color: var(--color-primary);
}

.category-toggle {
    cursor: pointer;
    color: var(--color-primary);
    transition: transform 0.3s ease;
    padding: 5px; 
    margin-left: 10px; /* <--- Añade esta línea */
}

.category-toggle.active {
    transform: rotate(90deg);
}

.sub-menu {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    background-color: var(--bg-white);
    box-shadow: 8px 0 25px rgba(0, 0, 0, 0.15);
    padding: 1.5rem;
    border-radius: 12px;
    min-width: 250px;
    max-height: 60vh;
    overflow-y: auto;
    z-index: 1001;
}

.sub-menu li {
    list-style-type: none; 
}

.sub-menu a {
    font-weight: 400;
    color: #666;
    padding: 0.25rem 0;
    transition: color 0.3s ease;
    text-decoration: none; 
}

.sub-menu a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.show-dropdown {
    display: block;
}

.dropdown-menu > .main-categories-list {
    display: block;   /* vertical */
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 0;
}
/* --- Submenús ocultos por defecto --- */
.sub-menu {
    display: none;
    background: #fff;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-top: 0.25rem;
}

/* --- Cuando se abre --- */
.sub-menu.show-sub-menu {
    display: block;
}

/* --- Flechita normal --- */
.category-toggle {
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 0.5rem;
    color: #e74c3c; /* rojo, cambia si quieres */
    transition: transform 0.3s ease;
}

/* --- Flechita girada cuando está activo --- */
.category-toggle.active {
    transform: rotate(90deg);
}

/* Estilo para el logo */
.logo {
    height: 60px;  /* Ajusta esta altura a tu gusto */
    width: auto;   /* Esto mantiene la proporción de la imagen */
}

/* =======================================================
 * RESPONSIVE: MÓVIL (Max-width 768px)
 * ======================================================= */
/* =======================================================
 * RESPONSIVE: MÓVIL (Max-width 768px)
 * ======================================================= */
@media (max-width: 768px) {

    /* --- Header: logo a la izquierda, hamburguesa a la derecha --- */
    .header-container {
        padding: 0.75rem 1.5rem;
        justify-content: space-between;
        position: relative;
    }

    /* --- Ocultar buscador en móvil (ocupa demasiado espacio) --- */
    .search-box {
        display: none;
    }

    /* --- Botón hamburguesa --- */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 28px;
        height: 20px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1000000;
    }

    .menu-toggle span {
        display: block;
        width: 100%;
        height: 3px;
        background-color: var(--color-secondary);
        border-radius: 3px;
        transition: all 0.3s ease;
    }

    /* Animación de la X al abrir */
    .menu-toggle.active span:nth-child(1) {
        transform: translateY(8.5px) rotate(45deg);
    }
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-8.5px) rotate(-45deg);
    }

    /* --- Panel de navegación lateral --- */
    .main-nav {
        display: block;
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background-color: #ffffff;
        z-index: 999999;
        transition: left 0.3s ease-in-out;
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.2);
        padding-top: 70px;
        overflow-y: auto;
    }

    .main-nav.active {
        left: 0;
    }

    /* --- Lista de enlaces en columna --- */
    .main-nav .nav-links {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .main-nav .nav-links li {
        width: 100%;
        border-bottom: 1px solid #eee;
        position: relative;
    }

    .main-nav .nav-links a {
        display: block;
        padding: 15px 20px;
        text-align: left;
    }

    /* --- Dropdown de Productos: estático (no flotante) --- */
    .has-dropdown {
        position: relative;
    }

    .dropdown-arrow {
        position: absolute;
        right: 0;
        top: 0;
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--color-primary);
        cursor: pointer;
        z-index: 10;
    }

    .dropdown-menu {
        display: none;
        position: static;   /* â† clave: empuja hacia abajo, no flota */
        width: 100%;
        max-height: none;
        box-shadow: none;
        border-radius: 0;
        background-color: #f9f9f9;
        padding: 0;
    }

    .dropdown-menu.show-dropdown {
        display: block;
    }

    /* --- Submenús: también estáticos --- */
    .sub-menu {
        display: none;
        position: static;
        width: 100%;
        box-shadow: none;
        border-radius: 0;
        background-color: #f0f0f0;
        padding: 0;
        border: none;
        margin: 0;
    }

    .sub-menu.show-sub-menu {
        display: block;
    }

    /* --- Flechas de categoría --- */
    .category-toggle {
        position: static;
        width: auto;
        height: auto;
        display: inline-flex;
        margin-left: 8px;
        color: var(--color-primary);
    }

    /* --- Overlay oscuro detrás del menú --- */
    .nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999998;
    }

    .nav-overlay.active {
        display: block;
    }
}

/* Ajuste 2026-04: navegación móvil consistente */
.menu-toggle {
    display: none;
}
@media (max-width: 768px) {
    .dropdown-menu.show-mobile,
    .dropdown-menu.show-dropdown {
        display: block;
    }
    .sub-menu.show-mobile,
    .sub-menu.show-sub-menu {
        display: block;
    }
    .main-categories-list .has-sub-menu {
        display: grid;
        grid-template-columns: 1fr 48px;
        align-items: center;
        padding: 0;
    }
    .category-link {
        padding: 13px 18px !important;
    }
    .category-toggle {
        min-width: 48px;
        min-height: 48px;
        align-items: center;
        justify-content: center;
        margin-left: 0;
    }
    .sub-menu a {
        display: block;
        padding: 12px 28px;
    }
    .company-switch-item {
        display: block;
        padding: 12px 18px;
    }
    .company-switch-link {
        width: 100%;
        padding: 10px 12px !important;
    }
}
/* Correccion 2026-04: hamburguesa visible en movil */
@media (min-width: 769px) {
    .menu-toggle { display: none !important; }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        width: 28px;
        height: 20px;
        padding: 0;
        border: 0;
        background: transparent;
        cursor: pointer;
        z-index: 1000000;
    }
    .menu-toggle span {
        display: block;
        width: 100%;
        height: 3px;
        border-radius: 3px;
        background-color: var(--color-secondary, #2c3e50);
    }
    .main-nav {
        display: block !important;
        position: fixed;
        top: 0;
        left: -100%;
        width: min(86vw, 320px);
        height: 100vh;
        padding-top: 70px;
        overflow-y: auto;
        background: #fff;
        z-index: 999999;
        transition: left 0.3s ease-in-out;
    }
    .main-nav.active { left: 0 !important; }
    .nav-overlay.active { display: block; }
}

/* Estado inicial cerrado: las subcategorías solo se muestran con el toggle JS */
.sub-menu:not(.show-mobile):not(.show-sub-menu):not(.show-pc-dropdown) {
    display: none !important;
}

.sub-menu.show-mobile,
.sub-menu.show-sub-menu,
.sub-menu.show-pc-dropdown {
    display: block !important;
}

@media (min-width: 769px) {
    .dropdown-menu.show-dropdown {
        width: min(360px, calc(100vw - 32px));
        max-height: calc(100vh - 130px);
        overflow-x: hidden;
        overflow-y: auto;
        left: 50%;
        transform: translateX(-50%);
        padding: 16px;
    }

    .dropdown-menu.show-dropdown > .main-categories-list {
        display: flex;
        flex-direction: column;
        gap: 4px;
        align-items: stretch;
    }

    .main-categories-list .has-sub-menu {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        padding: 8px 0;
        text-align: left;
    }

    .main-categories-list .category-link {
        padding-left: 0 !important;
        text-align: left;
        justify-self: start;
        width: 100%;
    }

    .has-sub-menu > .sub-menu {
        grid-column: 1 / -1;
        position: static !important;
        min-width: 0;
        max-height: none;
        overflow: visible;
        box-shadow: none;
        border: 0;
        border-left: 2px solid #e74c3c;
        border-radius: 0;
        margin: 8px 0 0;
        padding: 8px 0 0 12px;
        background: transparent;
        text-align: left;
    }

    .has-sub-menu > .sub-menu.show-sub-menu {
        display: flex !important;
        flex-direction: column;
        gap: 4px;
    }

    .has-sub-menu > .sub-menu li {
        margin: 0;
    }

    .has-sub-menu > .sub-menu a {
        display: block;
        padding: 4px 0;
        white-space: normal;
        text-align: left;
    }
}

/* Ajuste final: CTA de producto centrado en móvil y llamada adaptativa */
.product-actions-buttons,
.product-actions-full-width .action-buttons {
    justify-content: center;
    align-items: center;
}

.call-desktop {
    cursor: default;
}

@media (min-width: 769px) {
    .call-mobile {
        display: none !important;
    }

    .call-desktop {
        display: inline-flex !important;
    }
}

@media (max-width: 768px) {
    .product-actions-full-width,
    .product-actions-full-width h2 {
        text-align: center;
    }

    .product-actions-buttons,
    .product-actions-full-width .action-buttons {
        display: flex;
        flex-direction: column;
        justify-content: center !important;
        align-items: center !important;
        gap: 12px;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

    .product-actions-buttons .btn,
    .product-actions-full-width .action-buttons .btn {
        display: inline-flex;
        width: min(100%, 280px);
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .call-mobile {
        display: inline-flex !important;
    }

    .call-desktop {
        display: none !important;
    }
}

