/* =========================================
   VARIABLES Y COLORES GLOBALES
   ========================================= */
:root {
    --brand-green: #42b44d;
    --brand-dark: #2c3e50;
}

body {
    font-family: 'Outfit', sans-serif;
    line-height: 1.7;
    color: #333;
    background-color: #fdfdfd;
    overflow-x: hidden; /* Prevent horizontal scroll on mobile */
}

/* Responsive Section Padding */
.section-padding {
    padding: 100px 0;
}

@media (max-width: 991px) {
    .section-padding {
        padding: 80px 0;
    }
}

@media (max-width: 768px) {
    .section-padding {
        padding: 60px 0;
    }
}

/* Clases utilitarias propias */
.text-brand { color: var(--brand-green) !important; }
.bg-brand { background-color: var(--brand-green) !important; color: white !important; }
.transition { transition: all 0.3s ease; }
.hover-brand:hover { color: var(--brand-green) !important; }
.hover-scale:hover { transform: scale(1.03); }

/* =========================================
   BOTONES
   ========================================= */
.btn-brand {
    background: linear-gradient(135deg, var(--brand-green) 0%, #369440 100%);
    color: white;
    border: none;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(66, 180, 77, 0.2);
}
.btn-brand:hover {
    background: linear-gradient(135deg, #369440 0%, var(--brand-green) 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(66, 180, 77, 0.4);
}

/* =========================================
   NAVEGADOR (HEADER)
   ========================================= */
.custom-nav-link {
    position: relative;
}
.custom-nav-link::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--brand-green);
    left: 0;
    bottom: 0;
    transition: width 0.3s;
}
.custom-nav-link:hover::after {
    width: 100%;
}
.custom-nav-link:hover {
    color: var(--brand-green) !important;
}

/* =========================================
   HERO Y ANIMACIÓN DE FONDO
   ========================================= */
.hero {
    height: 100vh;
    background: url("SLIDE.jpg") center/cover no-repeat;
    animation: slideshow 30s infinite alternate;
    display: flex;
    align-items: center;
    position: relative;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5); /* Capa oscura para leer texto */
}
.text-shadow {
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.hero-content-box {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 60px 50px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    display: inline-block;
    max-width: 100%;
}

@media (max-width: 768px) {
    .hero-content-box {
        padding: 40px 25px;
        border-radius: 25px;
        background: rgba(0, 0, 0, 0.5); /* Slightly darker on mobile for better contrast */
    }
}

@keyframes slideshow {
    0%, 20% { background-image: url("SLIDE.jpg"); }
    25%, 45% { background-image: url("SLIDE1.jpg"); }
    50%, 70% { background-image: url("SLIDE2.jpg"); }
    75%, 95% { background-image: url("SLIDE3.jpg"); }
    95.01%, 100% { background-image: url("SLIDE4.jpg"); }
}

/* =========================================
   TÍTULOS DE SECCIÓN
   ========================================= */
.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
    letter-spacing: -0.5px;
}
.section-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--brand-green);
    border-radius: 2px;
}
.text-center .section-title::after {
    left: 50%;
    transform: translateX(-50%);
}

section:nth-of-type(even):not(#apartments):not(.bg-dark):not(.hero) {
    background-color: #f8fafc !important;
}

/* =========================================
   TARJETAS (CARRUSEL)
   ========================================= */
.custom-card {
    border-top: 5px solid var(--brand-green) !important;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.4s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.accordion-item {
    border: none !important;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-radius: 12px !important;
    overflow: hidden;
}

.accordion-button {
    border-radius: 12px !important;
    padding: 1.25rem;
}

.accordion-button:not(.collapsed) {
    background-color: rgba(66, 180, 77, 0.05);
    color: var(--brand-green);
    box-shadow: none;
}
.custom-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12) !important;
}
.card-img-zoom {
    height: 220px;
    overflow: hidden;
    position: relative;
}
.card-img-zoom img {
    transition: transform 0.5s;
}
.custom-card:hover .card-img-zoom img {
    transform: scale(1.1);
}
.zoom-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    opacity: 0;
    transition: opacity 0.3s;
}
.custom-card:hover .zoom-icon { opacity: 1; }

/* Flechas y Estabilidad del Carrusel */
#apartmentsCarouselDesktop .carousel-inner {
    padding: 20px 0;
    min-height: 550px; /* Estabilizador para escritorio */
}

#apartmentsCarouselMobile .carousel-inner {
    padding: 10px 0;
    min-height: 480px; /* Estabilizador para móvil */
}

/* Forzar altura igual en tarjetas del carrusel */
.carousel-item .card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.carousel-item .card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.carousel-item .card-text {
    flex-grow: 1;
}

@media (max-width: 768px) {
    #apartmentsCarouselMobile .carousel-inner {
        min-height: 520px; /* Un poco más de espacio en móvil para textos largos */
    }
}

/* Optimizaciones de estabilidad para animaciones */
.carousel-item {
    backface-visibility: hidden;
    perspective: 1000px;
}

.custom-card {
    will-change: transform;
    transform: translateZ(0);
}

/* Transiciones suaves */
.carousel-fade .carousel-item {
    transition-duration: 0.8s;
}

/* =========================================
   LIGHTBOX (MODAL DE IMÁGENES)
   ========================================= */
.lightbox-modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    inset: 0; 
    background: rgba(0,0,0,0.9); 
    justify-content: center; 
    align-items: center;
}
.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}
.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
}

/* =========================================
   BOTONES FLOTANTES (WHATSAPP Y PDF)
   ========================================= */
.whatsapp-float, .btn-float-download {
    position: fixed;
    z-index: 1000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: white;
    text-decoration: none;
    transition: transform 0.3s;
}
.whatsapp-float {
    bottom: 20px;
    left: 20px;
    background-color: #25d366;
}
.btn-float-download {
    bottom: 90px;
    left: 20px;
    background-color: var(--brand-green);
}
.whatsapp-float:hover, .btn-float-download:hover {
    transform: scale(1.1);
    color: white;
}

/* =========================================
   OFERTA EXCLUSIVA Y CONTACTO
   ========================================= */

#contact i {
    width: 30px;
    text-align: center;
}

/* =========================================
   FOOTER PREMIUM
   ========================================= */
.footer-premium {
    background-color: #111827;
    color: #9ca3af;
    padding: 80px 0 40px;
}

.footer-logo-text {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

.footer-heading {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    position: relative;
}

.footer-heading::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 30px;
    height: 2px;
    background-color: var(--brand-green);
}

.footer-link {
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.footer-link:hover {
    color: white;
    transform: translateX(5px);
}

.social-icon {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-icon:hover {
    background-color: var(--brand-green);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.footer-bottom {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.idealista-icon {
    font-weight: 800;
    font-size: 0.8rem;
}

/* =========================================
   ESTILOS TABLA DE DISPONIBILIDAD (RESTAURADOS)
   ========================================= */
.availability-section {
    padding: 80px 0;
    background-color: #f9f9f9;
}

.availability-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.custom-section-title {
    text-align: center;
    margin-bottom: 50px;
}

.custom-section-title h2 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
    font-weight: bold;
}

.custom-section-title h2:after {
    content: "";
    position: absolute;
    width: 60%;
    height: 4px;
    background: linear-gradient(to right, #42b44d, #94aa67);
    bottom: -10px;
    left: 20%;
    border-radius: 2px;
}

.table-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-top: 5px solid #42b44d;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.table-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    color: #333;
    min-width: 600px;
    text-align: center;
}

.styled-table thead tr {
    background-color: #2c3e50;
    color: #ffffff;
    text-align: center;
}

.styled-table th, 
.styled-table td {
    padding: 18px 25px;
    text-align: center;
    vertical-align: middle;
}

.styled-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.styled-table tbody tr {
    border-bottom: 1px solid #eeeeee;
    transition: background-color 0.2s;
}

.styled-table tbody tr:nth-of-type(even) {
    background-color: #f8fafc;
}

.styled-table tbody tr:last-of-type {
    border-bottom: none;
}

.styled-table tbody tr:hover {
    background-color: #f1f8f2;
}

.col-vivienda { font-weight: bold; color: #2c3e50; }

.status-free {
    color: #42b44d; 
    font-weight: 700;
}

.status-busy {
    color: #dc3545; 
    font-weight: 700;
}

.download-btn-style {
    background-color: #42b44d;
    color: white !important;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    font-size: 0.85rem;
    box-shadow: 0 2px 5px rgba(66, 180, 77, 0.3);
}

.download-btn-style:hover {
    background-color: #369440;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(66, 180, 77, 0.4);
}

.download-btn-style i {
    margin-right: 5px;
}

.reservation-box {
    margin-top: 30px;
    text-align: center;
    background-color: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 12px;
    padding: 30px 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.reservation-text {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 25px;
    font-weight: 500;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.reservation-btn {
    background-color: #42b44d;
    color: #fff !important;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(66, 180, 77, 0.4);
}

.reservation-btn:hover {
    background-color: #369440;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(66, 180, 77, 0.6);
}

.table-responsive::-webkit-scrollbar { height: 8px; }
.table-responsive::-webkit-scrollbar-thumb { background-color: #42b44d; border-radius: 10px; }
.table-responsive::-webkit-scrollbar-track { background-color: #ddd; border-radius: 10px; }

/* =========================================
   FAQ & NOTICIAS - ESTILOS COMPLEMENTARIOS
   ========================================= */

/* FAQ */
.faq-section {
    background: #fdfdfd;
}

.faq-category-title {
    font-size: 1.8rem;
    color: var(--brand-green);
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-top: 50px;
    margin-bottom: 30px;
    font-weight: 700;
}

.faq-item {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item.active {
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.faq-question {
    padding: 20px 25px;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    transition: background 0.3s;
}

.faq-question:hover {
    background: #fcfcfc;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    padding: 0 25px;
    color: #555;
    line-height: 1.8;
}

.faq-item.active .faq-answer {
    max-height: 800px;
    padding: 10px 25px 30px;
}

/* NOTICIAS */

.news-section h1 {
    font-size: 3rem;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 60px;
    text-align: center;
}

.news-article {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.05);
    padding: 50px;
    margin-bottom: 50px;
    display: flex;
    gap: 40px;
    transition: transform 0.3s;
}

.news-article:hover {
    transform: translateY(-5px);
}

.news-article .date {
    display: block;
    color: var(--brand-green);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.news-text h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 25px;
    color: #2c3e50;
    line-height: 1.3;
}

.news-text p {
    color: #555;
    margin-bottom: 20px;
    text-align: left;
}

.news-image {
    flex: 0 0 400px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 992px) {
    .news-article {
        flex-direction: column;
        padding: 30px;
    }
    .news-image {
        flex: 0 0 auto;
        width: 100%;
        height: 300px;
    }
    .news-text h2 {
        font-size: 1.8rem;
    }
    .news-section h1 {
        font-size: 2.2rem;
    }
}
