/* ==========================================================================
   HEADER Y NAVEGACIÓN DESKTOP - CON 3 NIVELES DE SUBMENÚS
   ========================================================================== */

/* Prevención de overflow horizontal */
html {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
}

#page {
    overflow-x: hidden;
    max-width: 100vw;
}


/* ==========================================================================
PAGE HEADER FORMA
========================================================================== */
.header-info,
.header-info p,
.header-info h1,
.header-info h2,
.header-info h3,
.header-info h4,
.header-info h5,
.header-info h6,
.header-info a {
    margin-bottom: 0px;
    margin-top: 0px;
}

.header-info {
    padding: 0px;
    margin: 0px;
    height: 37px;
    position: relative;
    z-index: 10;
}

.header-info, .header-info .header-info-content {
    display: flex;
    margin: 0px;
    justify-content: center;
    border-radius: 0px;
}

.header-info .header-info-content {
    padding-block-end: 5px;
    padding-block-start: 5px;
    padding-bottom: 5px;
    padding-inline-end:5px;
    padding-inline-start:5px;
    padding-left:5px;
    padding-right:5px;
    padding-top:5px;
    width: 100%;
    position: relative;
}


.header-info .btn-close {
    position: absolute;
    top: 0.5em;
    right: 15px;
    z-index: 2;
    padding: 0.6rem 5rem;
    background-color: transparent;
    border-radius: 50%;
    width: 10px;
    height: 10px;
    display: block;
    border: 2px solid #000000;
    padding-block-end: 5px;
    padding-block-start: 5px;
    padding-bottom: 5px;
    padding-inline-end: 5px;
    padding-inline-start: 5px;
    padding-left: 5px;
    padding-right: 5px;
    padding-top: 5px;
    font-size: 10px;
    color: #FFF;
}

.header-info .btn-close button svg {
    fill: #FFF;
}

/* Header Container */
.site-header {
    background: #0000008a;
    border-bottom: 1px solid #ffffff30;
    box-shadow: rgba(0, 0, 0, 0.16) 0px 10px 36px 0px, rgba(0, 0, 0, 0.06) 0px 0px 0px 1px;
    position: relative;
    top: 0;
    z-index: 1000;
    max-width: 100vw;
    /* overflow-x: hidden; ← COMENTADO - Causa que submenús no se vean */
    /* Overflow solo se aplica en móvil - ver media query abajo */
}

.site-header .r1 {
    position: relative;
    padding-top: 1.2rem;
    padding-bottom: 2rem;
    margin-bottom: 0.5rem;
}

.site-header .r1 p {
    margin: 0;
    color: #f0f0f0;
    font-weight: 300;
}

.site-header .r1 div {
    display: flex;
    align-items: center;
    position: relative;
    width: auto;
}

.site-header .r1 :last-child {
    justify-content: end;
}

.site-header .container .r1::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 15px;
  right: 15px; /* Deja 15px libres de cada lado */
  height: 1px; /* Grosor del borde */
  background-color: #ffffff30; /* Color del borde */
}

.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    max-width: 100%;
    position: relative; /* Contexto para elementos absolute */
    /* NO usar overflow-x: hidden aquí porque esconde submenús */
}

/* Le damos un espacio correcto al enlace del logo */
.site-branding .custom-logo-link {
  display: inline-block;
  max-width: 280px;  /* Controla aquí qué tan grande quieres que se vea en web */
  width: 100%;
}

/* Forzamos que la etiqueta img dibuje el SVG matemáticamente */
.site-branding img.custom-logo {
  width: 100% !important;
  height: auto !important;
  display: block;
  object-fit: contain; /* Evita cualquier deformación o pixelado */
}

.site-identity {
    margin: 0;
}

.site-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.site-title a {
    color: #d8d8d8;
    text-decoration: none;
}

.site-title a:hover {
    color: #007bff;
}

.site-description {
    margin: 5px 0 0;
    font-size: 14px;
    color: #919191;
}

/* ==========================================================================
   SEARCH FORM
   ========================================================================== */

.search-form__wrapper {
    position: relative;
}

.search-form__field {
    width: 100%;
    height: 40px;
    padding-right: 55px;
    border: 1px solid #535353a3;
    background-color: #535353a3;
    border-radius: 50px;
    padding-left: 16px;
    color: #f0f0f0;
    transition: all 0.5s ease;
    font-weight: 300;
}

.search-form__field:focus-visible,
.search-form__field:focus,
.search-form__field:active {
    border: 1px solid #000000;
    background-color: #000000;
    color: #f0f0f0;
    transition: all 0.5s ease;
    font-weight: 300;
    outline: none;

}

.search-form__submit {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    color: #bbbbbb;
}

/* ==========================================================================
   NAVEGACIÓN DESKTOP
   ========================================================================== */
.menu-primary-container > ul > li:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -18px;
    width: 2px;
    height: 15px;
    background: #494949;
    transform: translateY(-50%);
}

.main-navigation {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    position: static; /* Permite que submenús escapen del overflow */
}

.second-navigation {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    position: static; /* Permite que submenús escapen del overflow */
}

.menu-primary-container {
    display: flex;
}

.primary-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}

.primary-menu li {
    margin: 0;
    position: relative;
}

.primary-menu a {
    color: #e9e9e9;
    text-decoration: none;
    font-weight: 300;
    padding: 8px 0;
    display: block;
    transition: color 0.3s ease;
    position: relative;
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a {
    color: #8d8d8d;
}

/* ==========================================================================
   TRIÁNGULOS INDICADORES DE SUBMENÚS
   ========================================================================== */

/**
 * NIVEL 1: Triángulo hacia ABAJO (▼)
 * Aparece en los items principales del menú que tienen hijos
 */
.primary-menu > .menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 8px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform 0.3s ease;
}

/* Rotar triángulo al hacer hover (efecto visual) */
.primary-menu > .menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}

/**
 * NIVEL 2 y 3: Triángulo hacia la DERECHA (▶)
 * Aparece en los submenús que tienen más hijos
 */
.primary-menu .sub-menu .menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: auto;
    float: right;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 5px solid currentColor;
    transition: transform 0.3s ease;
}

/* Mover triángulo un poco al hacer hover */
.primary-menu .sub-menu .menu-item-has-children:hover > a::after {
    transform: translateX(3px);
}

/* ==========================================================================
   DESACTIVAR ENLACES PADRES (que tienen hijos)
========================================================================== */

/**
 * Los enlaces que tienen submenús NO deben ser clickeables
 * Solo actúan como triggers para mostrar el submenú
**/

/*
.primary-menu .menu-item-has-children > a {
    cursor: default;
    pointer-events: none;
}
*/

/* Regla más específica para desactivar por completo el clic: 
cambiar en JS y en CSS a default si no se quiere mostrar pointer */
.primary-menu .menu-item-has-children > a[href="#"],
.primary-menu .menu-item-has-children > a[href=""],
.primary-menu .menu-item-has-children > a:not([href]) {
    cursor: pointer;
}

/* Los enlaces con URLs reales mantienen comportamiento normal */
.primary-menu .menu-item-has-children > a[href]:not([href="#"]):not([href=""]) {
    cursor: pointer;
}

/* Mantener el hover funcional visualmente */
.primary-menu .menu-item-has-children > a:hover {
    color: #007bff;
}

/* El item padre (li) SÍ debe reaccionar al hover para mostrar el submenú */
.primary-menu .menu-item-has-children {
    cursor: pointer;
}

/* Clase auxiliar para forzar hover con teclado */
.primary-menu .menu-item-has-children.force-hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ==========================================================================
   SUBMENÚS - NIVEL 1 (Dropdown principal)
   ========================================================================== */

.primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    padding: 10px 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 99999; /* Muy alto para estar sobre todo */
    border-radius: 4px;
}

.primary-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.primary-menu .sub-menu a {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;
    pointer-events: auto; /* Re-habilitar el clic en los items del submenú */
}

.primary-menu .sub-menu li {
    position: relative;
    border-bottom: 1px solid #f0f0f0;
}

.primary-menu .sub-menu li:last-child {
    border-bottom: none;
}

/* ==========================================================================
   SUBMENÚS - NIVEL 2 (Submenú del submenú)
   ========================================================================== */

/**
 * Los submenús de segundo nivel aparecen a la DERECHA del submenú padre
 */
.primary-menu .sub-menu .sub-menu {
    position: absolute;
    top: 0;
    left: 100%; /* Aparece a la derecha */
    margin-left: 2px; /* Pequeño espacio */
    transform: translateX(-10px);
}

.primary-menu .sub-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* ==========================================================================
   SUBMENÚS - NIVEL 3 (Tercer nivel)
   ========================================================================== */

/**
 * El tercer nivel también aparece a la derecha
 */
.primary-menu .sub-menu .sub-menu .sub-menu {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 2px;
}

/* ==========================================================================
   EFECTOS DE HOVER Y ESTADOS ACTIVOS
   ========================================================================== */

.primary-menu .sub-menu a:hover {
    background: #f8f9fa;
    color: #007bff;
    padding-left: 25px;
}

/* Item activo en submenús */
.primary-menu .sub-menu .current-menu-item > a {
    background: #e9ecef;
    color: #007bff;
    border-left: 3px solid #007bff;
}

/* ==========================================================================
   AJUSTES PARA SUBMENÚS EN EL BORDE DERECHO
   ========================================================================== */

/**
 * Si un submenú se sale del viewport por la derecha,
 * lo mostramos hacia la izquierda
 */
.primary-menu .sub-menu .menu-item-has-children.align-right > .sub-menu {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: 2px;
}

/* ==========================================================================
   BOTÓN HAMBURGUESA (aparece en móvil)
   ========================================================================== */

.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    position: relative;
    width: 40px;
    height: 40px;
}

.menu-toggle-icon {
    display: block;
    position: relative;
    width: 30px;
    height: 2px;
    left: -10px;
    background: #c2c0c0;
    transition: all 0.3s ease;
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 2px;
    background: #c2c0c0;
    left: 0;
    transition: all 0.3s ease;
}

.menu-toggle-icon::before {
    top: -8px;
}

.menu-toggle-icon::after {
    bottom: -8px;
}

.menu-toggle.toggled .menu-toggle-icon {
    background: transparent;
}

.menu-toggle.toggled .menu-toggle-icon::before {
    transform: rotate(45deg);
    top: 0;
}

.menu-toggle.toggled .menu-toggle-icon::after {
    transform: rotate(-45deg);
    bottom: 0;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 992px) {
    /* Prevenir overflow en móvil */
    body {
        overflow-x: hidden !important;
    }
    
    .site-header {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    .header-wrapper {
        overflow-x: hidden;
        max-width: 100%;
    }
    
    .container {
        overflow-x: hidden;
        max-width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Mostrar botón hamburguesa en móvil */
    .menu-toggle {
        display: block;
        flex-shrink: 0;
    }
    
    /* Ocultar menú desktop en móvil */
    .menu-primary-container {
        display: none;
    }

    .entry-header {
        background-position-y: bottom;
    }
}

@media (max-width: 768px) {
    .header-wrapper {
        gap: 15px;
        padding: 0;
    }

    .site-header .r1 {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
    }

    .site-header .r1 {
        justify-content: center;
    }

    .site-header .r1 .col form {
        margin-top: 20px;
    }

    .site-header .r1 .col-5 {
        display: none;
    }

    .site-header .r2 {
        padding: 0 20px;
    }
    
    .custom-logo {
        max-height: 40px;
    }
    
    .site-title {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .header-wrapper {
        gap: 10px;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .custom-logo {
        max-height: 35px;
    }
    
    .site-title {
        font-size: 16px;
    }
}

/* ==========================================================================
   VARIANTE CON FONT AWESOME (Opcional)
   ========================================================================== */

/**
 * Si prefieres usar iconos de Font Awesome en lugar de triángulos CSS,
 * descomenta este bloque y comenta el bloque de triángulos de arriba
 */

/*
.primary-menu > .menu-item-has-children > a::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-left: 8px;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.primary-menu > .menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}

.primary-menu .sub-menu .menu-item-has-children > a::after {
    content: '\f105';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    float: right;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.primary-menu .sub-menu .menu-item-has-children:hover > a::after {
    transform: translateX(3px);
}
*/
/* ==========================================================================
   HEADER CON WOOCOMMERCE
   ========================================================================== */

/* Cuando WooCommerce está activo, usar grid de 3 columnas */
.site-header.has-woocommerce .header-wrapper {
    display: grid !important;
    grid-template-columns: minmax(auto, 200px) 1fr minmax(auto, max-content);
    align-items: center;
    gap: 40px;
    max-width: 100%;
    position: relative;
    /* NO usar overflow aquí - los submenús necesitan escapar */
}

/* Logo con límite de ancho */
.site-header.has-woocommerce .site-branding {
    max-width: 200px;
    min-width: 0;
    flex-shrink: 1;
}

/* Centrar el menú principal */
.site-header.has-woocommerce .main-navigation {
    justify-content: center;
    min-width: 0;
    max-width: 100%;
    position: static; /* Permite que submenús escapen */
}

/* Menú WooCommerce no debe comprimirse */
.site-header.has-woocommerce .woocommerce-menu {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Reducir gap en pantallas medianas */
@media (max-width: 1200px) {
    .site-header.has-woocommerce .header-wrapper {
        gap: 30px;
    }
}

@media (max-width: 1024px) {
    .site-header.has-woocommerce .header-wrapper {
        gap: 20px;
    }
}


/* =============================================
   MEGA MENU — nube-theme
   ============================================= */

/* El ítem padre que contiene el mega menú */
.mega-menu-parent {
    position: relative; /* Necesario para que el dropdown se posicione relativo a este */
}

/* El panel del mega menú (oculto por defecto) */
.mega-menu-dropdown {
    display: none;
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 1100px;
    max-width: 95vw;
    background: #fff;
    border-top: 1px solid #1a1a1a;
    z-index: 1000;
    border-radius: 7px;
    box-shadow: rgb(38, 57, 77) 0px 20px 30px -10px;
}

/* Mostrar el mega menú al hacer hover en el padre */
.mega-menu-parent:hover .mega-menu-dropdown,
.mega-menu-parent.is-active .mega-menu-dropdown {
    display: block;
}

/* Contenedor interior con padding */
.mega-menu-inner {
    display: flex;
    padding: 22px;
    gap: 0;
}

/* Las 4 columnas en fila */
.mega-menu-columns {
    display: flex;
    flex: 1;
    gap: 0;
}

/* Cada columna de menú */
.mega-menu-col {
    flex: 1;
    padding: 0 20px;
    border-right: 1px solid #e8e8e8;
}

.mega-menu-col:first-child {
    padding-left: 0;
}

/* Columna del widget (la 4ta) */
.mega-menu-col-widget {
    flex: 0 0 220px;  /* Ancho fijo para la imagen */
    border-right: none;
    padding-right: 0;
}

/* Títulos de columna (Tipo de evento, Renta por color, etc.) */
.mega-menu-col-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #1a1a1a;
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8e8e8;
}

.mega-menu-col-title a {
    color: inherit;
    text-decoration: none;
    font-weight: 400;
}

/* Lista de links dentro de cada columna */
.mega-menu-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-menu-links li {
    margin: 0;
}

.mega-menu-links li a {
    display: block;
    padding: 5px 0;
    font-size: 14px;
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s ease;
    transition: all ease-in-out 0.3s;
}

/* El guión decorativo antes de cada link (como en tu mockup) */
.mega-menu-links li a::before {
    content: "– ";
    color: #aaa;
}

.mega-menu-links li a:hover {
    color: #1a1a1a;
    transform: translate(3px);
    transition: all ease-in-out 0.2s;
}

/* Widget dentro del mega menú */
.mega-menu-widget a {
    padding: 0;
    transition: all ease-in-out 0.2s;
}

.mega-menu-widget a:hover {
    transform: scale(103%) rotate(0.8deg);
    transition: all ease-in-out 0.2s;
}

.mega-menu-widget img {
    width: 100%;
    height: auto;
    border-radius: 7px;
    display: block;
    transition: all ease-in-out 0.2s;
}

.mega-menu-widget-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 8px 0 4px;
    color: #1a1a1a;
}

/* Flecha indicadora de sub-menú */
.mega-menu-arrow {
    display: inline-block;
    font-size: 8px;
    margin-left: 5px;
    vertical-align: middle;
    transition: transform 0.2s ease;
    color: currentColor; /* Hereda el color del enlace padre */
}

/* Cuando el mega menú está abierto, rota la flecha hacia arriba */
.mega-menu-parent.is-active .mega-menu-arrow,
.mega-menu-parent:hover .mega-menu-arrow {
    transform: rotate(180deg);
}