:root {
    --rm-footer-bg: var(--rmp-site-footer-bg, #1e293b);
    --rm-footer-text: var(--rmp-site-footer-text, #ffffff);
    --rm-footer-hover: var(--rmp-site-footer-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-footer-wrapper {
    background-color: var(--rm-footer-bg, #1e293b);
    color: var(--rm-footer-text, #ffffff);
    width: 100%;
    position: relative;
    z-index: var(--rmp-z-dropdown, 100);
    transition: var(--rmp-transition-slow, all 0.3s ease);
}

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

/* Container */
.rm-footer-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-footer-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-footer-menu,
.rm-footer-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;
}

/* Modules */
.rm-footer-module {
    flex: 1;
    min-width: 250px;
}

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

/* Nav Module */
.rm-footer-nav-module {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

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

/* Navigation */
.rm-footer-nav {
    width: 100%;
}
.rm-footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}
.rm-orientation-vertical .rm-footer-menu {
    flex-direction: column;
    gap: 4px;
}
.rm-footer-menu li {
    position: relative;
}
.rm-footer-menu a {
    padding: 5px 0;
    display: inline-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;
    opacity: 0.9;
}
.rm-footer-menu a:hover {
    opacity: 1;
    color: var(--rm-footer-hover) !important;
}

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

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

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

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

.rm-hover-scale .rm-footer-menu > li > a:hover,
.rm-hover-scale .rm-footer-menu > li > a:focus {
    transform: translateX(5px); /* En pie de página, movemos a la derecha en lugar de escalar */
    color: var(--rm-footer-hover) !important;
}

.rm-hover-underline.rm-style-simple .rm-footer-menu > li > a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--rm-footer-hover);
    transition: width 0.3s ease;
}
.rm-hover-underline.rm-style-simple .rm-footer-menu > li > a:hover::after,
.rm-hover-underline.rm-style-simple .rm-footer-menu > li > a:focus::after {
    width: 100%;
}
.rm-hover-underline.rm-style-simple .rm-footer-menu > li > a:hover,
.rm-hover-underline.rm-style-simple .rm-footer-menu > li > a:focus {
    color: var(--rm-footer-hover) !important;
}

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

/* Submenus en footer (si los hay) */
.rm-footer-menu .sub-menu {
    padding-left: 15px;
    margin-top: 5px;
    font-size: 0.9em;
    list-style: none;
}
.rm-footer-menu .sub-menu a {
    opacity: 0.7;
}

/* Custom Shortcode Module */
.rm-footer-custom-shortcode {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Bottom Bar */
.rm-footer-bottom-bar {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
}
.rm-footer-bottom-container {
    width: 100%;
    padding: 0 20px;
    text-align: center;
    font-size: 0.9em;
    opacity: 0.8;
}

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

/* =============== MOBILE RESPONSIVE =============== */
@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;
    }
    
    .rm-mobile-hamburger .rm-footer-mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px 0;
    flex-direction: column;
    gap: 5px;
}
.rm-hamburger-bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--rm-footer-text, #ffffff);
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    /* General Stacked Fallback */
    .rm-footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0;
    }
    .rm-footer-module {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    /* Behavior: Hamburger */
    .rm-mobile-hamburger .rm-footer-mobile-toggle {
        display: flex;
        margin: 0 auto;
    }
    .rm-mobile-hamburger .rm-footer-nav {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
        width: 100%;
    }
    .rm-mobile-hamburger .rm-footer-nav.rm-nav-open {
        max-height: 1000px;
        padding-top: 15px;
    }
    .rm-mobile-hamburger .rm-footer-menu {
        flex-direction: column;
        align-items: center;
    }

    /* Behavior: Scroll Horizontal */
    .rm-mobile-scroll .rm-footer-nav {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
    }
    .rm-mobile-scroll .rm-footer-menu {
        flex-direction: row;
        width: max-content;
        margin: 0 auto;
        flex-wrap: nowrap;
    }

    /* Behavior: Stack (Default mobile behavior for footer) */
    .rm-mobile-stack .rm-footer-menu {
        flex-direction: column;
        align-items: center;
    }

    .rm-hover-scale .rm-footer-menu > li > a:hover {
        transform: none;
    }
}
}
