/* rm-header-builder CSS */
:root {
    --rm-header-bg: var(--rmp-site-header-bg, #ffffff);

    --rm-header-text: var(--rmp-site-header-text, #333333);
    --rm-header-hover: var(--rmp-site-header-hover, #50b785);
    --rm-border-radius: var(--rmp-border-radius, 4px);
    --rm-menu-font-size: var(--rmp-font-size-base);
    --rm-menu-font-family: var(--rmp-font-family-base);
}

.rm-custom-header-wrapper {
    background-color: var(--rm-header-bg, #ffffff);
    color: var(--rm-header-text, #333333);
    width: 100%;
    position: relative;
    z-index: var(--rmp-z-sticky, 1000);
    transition: var(--rmp-transition-slow, all 0.3s ease);
    box-shadow: var(--rmp-shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
}

.rm-custom-header-wrapper a {
    color: var(--rm-header-text, #333333);
    text-decoration: none;
}



/* Container */
.rm-header-container {
    width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: auto;
}

/* Ocultar párrafos inyectados por WordPress (nunca son contenido legítimo del grid) */
.rm-header-container > p {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
    overflow: hidden !important;
}

/* Grid row: gap controlado por slots */
.rm-grid-row {
    gap: 10px;
}

/* Grid slot: sin padding/margin por defecto */
.rm-grid-slot {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.rm-header-menu,
.rm-header-menu * {
    line-height: 1;
}
.rm-grid-slot p,
.rm-grid-slot h1,
.rm-grid-slot h2,
.rm-grid-slot h3,
.rm-grid-slot h4,
.rm-grid-slot h5,
.rm-grid-slot h6,
.rm-grid-slot ul,
.rm-grid-slot ol {
    margin: 0;
    padding: 0;
}
.rm-grid-slot {
    padding: 0;
    margin: 0;
    min-height: 0;
}

/* Logo */
.rm-header-logo-module {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}
.rm-header-logo-module img {
    max-height: 50px;
    width: auto;
    display: block;
    margin: 0 !important;
    padding: 0 !important;
}
.rm-header-logo-module a {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    padding: 0;
}
.rm-header-site-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
    padding: 0;
}

/* Nav Module (holds menu + shortcode) */
.rm-header-nav-module {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

/* Text Module */
.rm-header-text-module {
}

/* Standard WP Menu Styling */
.rm-header-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0;
    align-items: center;
}
.rm-header-menu li {
    position: relative;
}
.rm-header-menu a {
    padding: 6px 12px;
    display: block;
    font-size: var(--rm-menu-font-size);
    font-family: var(--rm-menu-font-family);
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    position: relative;
    white-space: nowrap;
}
.rm-header-menu a:hover {
    opacity: 1;
    color: var(--rm-header-hover) !important;
}

/* Orientation Vertical */
.rm-orientation-vertical .rm-header-menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

/* =============== MENU STYLES =============== */
/* Simple */
.rm-style-simple .rm-header-menu a {
    background: transparent;
    border-radius: 0;
}

/* Buttons */
.rm-style-buttons .rm-header-menu > li > a {
    background-color: color-mix(in srgb, var(--rm-header-text) 5%, transparent);
    border: 1px solid color-mix(in srgb, var(--rm-header-text) 10%, transparent);
    border-radius: var(--rm-border-radius, 4px);
    margin: 0 2px;
}

/* Pills */
.rm-style-pills .rm-header-menu > li > a {
    background-color: color-mix(in srgb, var(--rm-header-text) 5%, transparent);
    border-radius: 50px;
    padding: 6px 16px;
    margin: 0 2px;
}

/* =============== HOVER EFFECTS =============== */
/* Background Fade */
.rm-hover-bg_fade .rm-header-menu > li > a:hover,
.rm-hover-bg_fade .rm-header-menu > li > a:focus {
    background-color: color-mix(in srgb, var(--rm-header-hover) 15%, transparent);
    color: var(--rm-header-hover);
}

/* Scale */
.rm-hover-scale .rm-header-menu > li > a:hover,
.rm-hover-scale .rm-header-menu > li > a:focus {
    transform: scale(1.05);
    color: var(--rm-header-hover);
}

/* Underline (Animated) */
.rm-hover-underline.rm-style-simple .rm-header-menu > li > a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--rm-header-hover);
    transition: width 0.3s ease;
}
.rm-hover-underline.rm-style-simple .rm-header-menu > li > a:hover::after,
.rm-hover-underline.rm-style-simple .rm-header-menu > li > a:focus::after {
    width: 100%;
}
.rm-hover-underline.rm-style-simple .rm-header-menu > li > a:hover,
.rm-hover-underline.rm-style-simple .rm-header-menu > li > a:focus {
    color: var(--rm-header-hover);
}

/* Dropdown Caret for items with submenus */
.rm-header-menu .menu-item-has-children > a::after {
    content: " ▾";
    font-size: 0.8em;
    opacity: 0.7;
    display: inline-block;
    margin-left: 5px;
    transition: transform 0.2s ease;
}

/* =============== SUBMENUS (DROPDOWNS) =============== */
.rm-header-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--rm-header-bg, #ffffff);
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-radius: var(--rm-border-radius, 4px);
    list-style: none;
    margin: 10px 0 0 0;
    padding: 10px;
    z-index: 1001;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Invisible bridge so mouse doesn't leave hover area */
.rm-header-menu .sub-menu::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 10px;
}

.rm-header-menu .sub-menu li {
    width: 100%;
}
.rm-header-menu .sub-menu a {
    padding: 12px 15px;
    border-radius: var(--rm-border-radius, 4px);
    background: transparent !important; /* Override button styles in dropdown */
    border: none !important;
}

/* Empty Slot */
.rm-empty-slot {
    min-height: 0;
    pointer-events: none;
}

/* Submenu Hover */
.rm-header-menu .sub-menu a:hover {
    background-color: color-mix(in srgb, var(--rm-header-hover) 10%, transparent) !important;
    color: var(--rm-header-hover) !important;
}

/* Hover Interaction Mode */
[data-interaction="hover"] .rm-header-menu li:hover > .sub-menu {
    display: block;
    animation: exDropdownFade 0.2s ease forwards;
}

@keyframes exDropdownFade {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Click Interaction Class (handled by JS) */
.rm-menu-dropdown-open > .sub-menu {
    display: block !important;
    animation: exDropdownFade 0.2s ease forwards;
}

/* =============== LAYOUT VARIATIONS =============== */
/* Legacy layouts (inactive with grid system) */

/* Dark Mode Toggle */
.rm-header-dark-mode-toggle-container {
    display: flex;
    align-items: center;
    margin-left: 10px;
}
.rm-dark-mode-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--rm-header-text, #333333);
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}
.rm-dark-mode-toggle:hover {
    transform: scale(1.1);
}

/* =============== RESPONSIVE & MOBILE =============== */
@media (max-width: 768px) {
    /* Mobile stack para el grid */
    .rm-grid-row.rm-mobile-stack {
        grid-template-columns: 1fr !important;
    }
    .rm-grid-row.rm-mobile-stack .rm-empty-slot {
        display: none;
    }
}

/* Resto de estilos base para mobile toggle */
.rm-header-mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    flex-direction: column;
    gap: 5px;
}
.rm-hamburger-bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--rm-header-text, #333333);
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    /* Behavior: Hamburger */
    .rm-mobile-hamburger .rm-header-mobile-toggle {
        display: flex;
    }
    .rm-mobile-hamburger .rm-header-nav-module {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--rm-header-bg, #ffffff);
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
        box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    }
    .rm-mobile-hamburger .rm-header-nav-module.rm-nav-open {
        max-height: 1000px;
        padding: 20px;
    }
    .rm-mobile-hamburger .rm-header-menu {
        flex-direction: column;
        width: 100%;
        gap: 5px;
        align-items: stretch;
    }
    
    /* Behavior: Scroll Horizontal */
    .rm-mobile-scroll .rm-header-nav-module {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
    }
    .rm-mobile-scroll .rm-header-nav {
        width: max-content;
    }
    
    /* Behavior: Stack */
    .rm-mobile-stack .rm-header-container {
        flex-direction: column;
        height: auto;
        padding: 0;
    }
    .rm-mobile-stack .rm-header-nav-module {
        flex-direction: column;
        width: 100%;
    }
    .rm-mobile-stack .rm-header-menu {
        flex-direction: column;
        width: 100%;
        align-items: center;
        text-align: center;
    }

    /* Common mobile overrides */
    .rm-mobile-hamburger .rm-header-menu > li > a,
    .rm-mobile-stack .rm-header-menu > li > a {
        margin: 0;
        border-radius: var(--rm-border-radius, 4px) !important;
    }
    .rm-header-menu .sub-menu {
        position: static;
        box-shadow: none;
        padding: 10px;
        margin: 5px 0 10px 15px;
        background: rgba(0,0,0,0.03);
        border: none;
    }
}
