/* ==========================================================================
   LAR DO REGUEIRO - RESPONSIVE STYLES (MÓVIL Y TABLETS)
   ========================================================================== */

/* 1. Reset y contención de desbordamiento horizontal */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

body.nav-open {
    overflow: hidden !important;
    touch-action: none;
}

/* 2. Logo visible y clickable */
.logo, nav .logo {
    display: flex !important;
    align-items: center;
    color: #ffffff !important;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px;
    z-index: 1002;
}

.logo a, nav .logo a {
    color: #ffffff !important;
    text-decoration: none !important;
    display: inline-block;
    transition: color 0.2s ease;
}

.logo a:hover, nav .logo a:hover {
    color: #2ecc71 !important;
}

/* 3. Botón hamburguesa */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px 8px;
    width: 44px;
    height: 44px;
    position: relative;
    z-index: 1002;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    border-radius: 6px;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.menu-toggle:hover,
.menu-toggle:focus {
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2.5px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease,
                background-color 0.3s ease;
    transform-origin: center;
}

/* Animación a 'X' cuando el menú está abierto */
.menu-toggle.active span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
    background-color: #2ecc71;
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
    background-color: #2ecc71;
}

/* /* 4. Fondo de superposición (Overlay) - Sin blur para evitar desenfoque en el menú */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.65) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 9998 !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.nav-overlay.active {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* 5. Comportamiento en Escritorio (> 860px) */
@media (min-width: 861px) {
    .menu-toggle,
    .nav-overlay,
    .dropdown-toggle-btn {
        display: none !important;
    }
}

/* 6. Comportamiento Responsive del Menú en Móvil y Tablet (<= 860px) */
@media (max-width: 860px) {
    nav {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 60px !important;
        background: #111111 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        filter: none !important;
        z-index: 10000 !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 16px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
    }

    .logo, nav .logo {
        display: flex !important;
        font-size: 0.9rem !important;
        z-index: 10002 !important;
    }

    .menu-toggle {
        display: flex !important;
        z-index: 10002 !important;
    }

    /* Panel lateral deslizante (Drawer) */
    nav ul {
        display: block !important;
        position: fixed !important;
        top: 60px !important;
        right: -100% !important;
        width: 320px !important;
        max-width: 88vw !important;
        height: calc(100vh - 60px) !important;
        height: calc(100dvh - 60px) !important;
        background: #141414 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        filter: none !important;
        padding: 10px 0 60px !important;
        margin: 0 !important;
        list-style: none !important;
        box-shadow: -8px 0 30px rgba(0, 0, 0, 0.8) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        z-index: 10001 !important;
        transition: right 0.32s cubic-bezier(0.4, 0, 0.2, 1) !important;
        border-left: 1px solid rgba(255, 255, 255, 0.12) !important;
        box-sizing: border-box !important;
    }

    nav ul.active {
        right: 0 !important;
    }

    /* Cada fila o elemento de menú es un bloque en flujo normal (evita solapamientos) */
    nav ul li,
    nav ul li.dropdown,
    nav ul li.nav-item,
    .dropdown,
    .nav-item {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: unset !important;
        max-height: none !important;
        position: relative !important;
        float: none !important;
        clear: both !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        box-sizing: border-box !important;
        flex: none !important;
        filter: none !important;
    }

    /* Encabezado de categoría con submenú */
    nav ul li.dropdown > a,
    .dropdown > a {
        display: block !important;
        width: 100% !important;
        padding: 15px 52px 15px 20px !important; /* Espacio a la derecha para la flecha */
        font-size: 0.88rem !important;
        font-weight: 700 !important;
        letter-spacing: 0.8px !important;
        text-transform: uppercase !important;
        color: #2ecc71 !important; /* Destacar las categorías en verde */
        text-decoration: none !important;
        line-height: 1.4 !important;
        box-sizing: border-box !important;
        cursor: pointer !important;
        transition: background 0.2s ease !important;
    }

    nav ul li.dropdown > a:hover,
    nav ul li.dropdown > a:active,
    .dropdown > a:hover,
    .dropdown > a:active {
        background: rgba(255, 255, 255, 0.05) !important;
    }

    /* Botón flecha acordeón interactiva */
    .dropdown-toggle-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: absolute !important;
        top: 0 !important;
        right: 0 !important;
        width: 52px !important;
        height: 50px !important;
        background: transparent !important;
        border: none !important;
        color: #2ecc71 !important;
        padding: 0 !important;
        margin: 0 !important;
        cursor: pointer !important;
        z-index: 2 !important;
        -webkit-tap-highlight-color: transparent !important;
        outline: none !important;
    }

    .dropdown-toggle-btn::after {
        content: '▼' !important;
        display: inline-block !important;
        font-size: 0.72rem !important;
        transition: transform 0.25s ease, color 0.2s ease !important;
    }

    /* Cuando está cerrado el acordeón, la flecha rota hacia la derecha */
    nav ul li.dropdown.closed .dropdown-toggle-btn::after,
    .dropdown.closed .dropdown-toggle-btn::after {
        transform: rotate(-90deg) !important;
        color: #888888 !important;
    }

    /* Contenedor del submenú desplegable en móvil */
    nav ul li.dropdown .dropdown-content,
    .dropdown-content,
    html body nav ul .dropdown-content,
    html body nav ul li.dropdown .dropdown-content {
        display: block !important;
        position: static !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: #1c1c1c !important;
        padding: 4px 0 6px 0 !important;
        width: 100% !important;
        min-width: unset !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        border: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.04) !important;
        border-left: 4px solid #27ae60 !important;
    }

    /* Si se pulsa para cerrar la categoría */
    nav ul li.dropdown.closed .dropdown-content,
    .dropdown.closed .dropdown-content,
    nav ul li.dropdown.closed:hover .dropdown-content,
    .dropdown.closed:hover .dropdown-content,
    html body nav ul .dropdown.closed .dropdown-content,
    html body nav ul li.dropdown.closed .dropdown-content {
        display: none !important;
    }

    /* Enlaces internos de los desplegables: nítidos y con buen área táctil */
    html body nav ul .dropdown-content a,
    html body nav ul li.dropdown .dropdown-content a,
    nav ul .dropdown-content a,
    .dropdown-content a {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        color: #e5e5e5 !important;
        padding: 12px 20px 12px 24px !important;
        font-size: 0.86rem !important;
        font-weight: 400 !important;
        line-height: 1.4 !important;
        text-align: left !important;
        text-decoration: none !important;
        text-transform: none !important;
        background: transparent !important;
        border: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
        transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease !important;
    }

    nav ul .dropdown-content a:last-child,
    .dropdown-content a:last-child {
        border-bottom: none !important;
    }

    html body nav ul .dropdown-content a:hover,
    html body nav ul .dropdown-content a:active,
    .dropdown-content a:hover,
    .dropdown-content a:active {
        background: rgba(46, 204, 113, 0.16) !important;
        color: #2ecc71 !important;
        padding-left: 28px !important;
    }

    /* Enlaces directos sin submenú (ej. Preguntas frecuentes) */
    nav ul li.nav-item > a:not(.btn-contacto),
    .nav-item > a:not(.btn-contacto) {
        display: block !important;
        width: 100% !important;
        padding: 15px 20px !important;
        box-sizing: border-box !important;
        font-size: 0.88rem !important;
        font-weight: 700 !important;
        letter-spacing: 0.8px !important;
        text-transform: uppercase !important;
        color: #ffffff !important;
        text-decoration: none !important;
        line-height: 1.4 !important;
        transition: background 0.2s ease, color 0.2s ease !important;
    }

    nav ul li.nav-item > a:not(.btn-contacto):hover,
    nav ul li.nav-item > a:not(.btn-contacto):active,
    .nav-item > a:not(.btn-contacto):hover,
    .nav-item > a:not(.btn-contacto):active {
        background: rgba(255, 255, 255, 0.05) !important;
        color: #2ecc71 !important;
    }

    /* Botón de Contacto en móvil */
    nav ul li.nav-item a.btn-contacto,
    .nav-item .btn-contacto,
    .btn-contacto {
        display: block !important;
        width: calc(100% - 36px) !important;
        margin: 20px 18px 24px !important;
        padding: 13px 20px !important;
        background: #27ae60 !important;
        color: #ffffff !important;
        border-radius: 8px !important;
        font-size: 0.9rem !important;
        font-weight: 700 !important;
        text-align: center !important;
        text-transform: uppercase !important;
        letter-spacing: 1px !important;
        box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4) !important;
        box-sizing: border-box !important;
        border: none !important;
        line-height: 1.4 !important;
        transition: background 0.2s ease, transform 0.15s ease !important;
    }

    nav ul li.nav-item a.btn-contacto:hover,
    nav ul li.nav-item a.btn-contacto:active,
    .btn-contacto:hover,
    .btn-contacto:active {
        background: #2ecc71 !important;
        color: #ffffff !important;
        transform: translateY(-1px) !important;
    }
}

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

/* Contenedor general para desplazamiento horizontal táctil */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
    border-radius: 8px;
}

/* Scrollbar sutil para el contenedor responsive */
.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #27ae60;
    border-radius: 3px;
}

/* Estilos de tabla en móvil */
@media (max-width: 640px) {
    .capacity-section {
        padding: 24px 16px !important;
        margin-top: 25px !important;
        border-radius: 12px !important;
    }

    .capacity-section h2 {
        font-size: 1.35rem !important;
    }

    .capacity-section p {
        font-size: 0.9rem !important;
        margin-bottom: 15px !important;
    }

    /* Transformación de la tabla de capacidad en tarjetas */
    .capacity-table {
        border: none !important;
        margin-top: 10px !important;
        width: 100% !important;
    }

    .capacity-table thead {
        display: none !important;
    }

    .capacity-table tbody, 
    .capacity-table tr, 
    .capacity-table td {
        display: block !important;
        width: 100% !important;
    }

    .capacity-table tr {
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-left: 5px solid #27ae60 !important;
        border-radius: 10px !important;
        margin-bottom: 16px !important;
        padding: 10px 14px !important;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04) !important;
    }

    .capacity-table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 4px !important;
        border-bottom: 1px solid #edf2f7 !important;
        font-size: 0.9rem !important;
        text-align: right !important;
    }

    .capacity-table td:last-child {
        border-bottom: none !important;
    }

    .capacity-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #2c3e50;
        font-family: 'Montserrat', sans-serif;
        font-size: 0.82rem;
        text-align: left;
        margin-right: 15px;
        flex-shrink: 0;
    }

    /* Tablas genéricas que no sean capacity-table */
    table:not(.capacity-table) th,
    table:not(.capacity-table) td {
        padding: 10px 12px !important;
        font-size: 0.85rem !important;
        white-space: nowrap;
    }
}

/* ==========================================================================
   AJUSTES ADICIONALES DE REJILLAS Y CONTENEDORES EN MÓVIL
   ========================================================================== */
@media (max-width: 600px) {
    /* PlanosEdif: evitar desborde por minmax(450px) */
    .blueprint-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    .blueprint-image {
        height: 220px !important;
    }

    .blueprint-info {
        padding: 18px !important;
    }

    /* Financiacion: selectores de vivienda */
    .vivienda-selector {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .vivienda-item {
        padding: 16px !important;
    }

    .vivienda-item h2 {
        font-size: 1.5rem !important;
    }

    /* Ser socio: cajas y pasos */
    .eco-box {
        grid-template-columns: 1fr !important;
        padding: 25px 20px !important;
        gap: 30px !important;
    }

    .step-container {
        padding: 25px 20px !important;
    }

    .step-item {
        gap: 15px !important;
    }

    /* Cabecera salmón */
    .header-section {
        padding: 30px 15px !important;
    }

    .header-section h1 {
        font-size: 1.6rem !important;
    }

    .logo-header {
        max-width: 220px !important;
    }
}

/* ==========================================================================
   7. PIE DE PÁGINA RESPONSIVE (FOOTER)
   ========================================================================== */
#footer {
    width: 100% !important;
    box-sizing: border-box !important;
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    border-top: 4px solid #27ae60 !important;
    padding: 55px 24px 30px !important;
    margin-top: 60px !important;
    font-family: 'Open Sans', sans-serif !important;
    font-size: 0.85rem !important;
    overflow-x: hidden !important;
    position: relative !important;
}

#footer * {
    box-sizing: border-box !important;
}

.footer-container {
    max-width: 1100px !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 36px !important;
    width: 100% !important;
}

.footer-col {
    flex: 1 1 260px !important;
    min-width: 240px !important;
    box-sizing: border-box !important;
}

.footer-col h4 {
    color: #27ae60 !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    margin-top: 0 !important;
    margin-bottom: 16px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}

.footer-col-sede p {
    line-height: 1.8 !important;
    margin: 0 !important;
    color: #bbbbbb !important;
}

.footer-col-sede strong {
    color: #ffffff !important;
}

.footer-col-contacto {
    text-align: center !important;
}

.footer-col-contacto p {
    margin: 0 0 10px 0 !important;
}

.footer-col-contacto a {
    color: #bbbbbb !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
    display: inline-block !important;
}

.footer-col-contacto a:hover {
    color: #2ecc71 !important;
}

.footer-col-contacto .phone-link {
    color: #ffffff !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
}

.footer-col-social {
    text-align: right !important;
}

.footer-social-links {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
    align-items: center !important;
}

.btn-social {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 9px 18px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: 0.76rem !important;
    color: #ffffff !important;
    letter-spacing: 0.6px !important;
    text-transform: uppercase !important;
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
    box-sizing: border-box !important;
}

.btn-social:hover,
.btn-social:active {
    transform: translateY(-2px) !important;
    filter: brightness(1.12) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45) !important;
}

.btn-social-fb {
    background-color: #1877f2 !important;
}

.btn-social-ig {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important;
}

/* Fila inferior de copyright y enlaces legales */
.footer-bottom {
    max-width: 1100px !important;
    margin: 40px auto 0 !important;
    padding-top: 22px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 16px !important;
    color: #888888 !important;
    font-size: 0.82rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.footer-bottom p {
    margin: 0 !important;
    color: #888888 !important;
}

.footer-bottom ul {
    list-style: none !important;
    display: flex !important;
    gap: 20px !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-wrap: wrap !important;
}

.footer-bottom a {
    color: #888888 !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.footer-bottom a:hover {
    color: #2ecc71 !important;
}

/* --------------------------------------------------------------------------
   Adaptación Móvil y Tablets (< 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    #footer {
        padding: 45px 20px 30px !important;
        text-align: center !important;
    }

    .footer-container {
        flex-direction: column !important;
        align-items: center !important;
        gap: 30px !important;
    }

    .footer-col {
        flex: 1 1 100% !important;
        width: 100% !important;
        min-width: unset !important;
        text-align: center !important;
        padding: 0 10px !important;
    }

    .footer-col-sede,
    .footer-col-contacto,
    .footer-col-social {
        text-align: center !important;
    }

    .footer-col h4 {
        margin-bottom: 12px !important;
    }

    .footer-social-links {
        justify-content: center !important;
        margin: 0 auto !important;
        width: 100% !important;
        gap: 12px !important;
    }

    .btn-social {
        padding: 10px 22px !important;
        font-size: 0.8rem !important;
    }

    .footer-bottom {
        flex-direction: column !important;
        text-align: center !important;
        gap: 14px !important;
        margin-top: 30px !important;
        padding-top: 20px !important;
    }

    .footer-bottom ul {
        justify-content: center !important;
        gap: 16px !important;
    }
}

