/* Link de términos */
.terms-link {
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.terms-link:hover {
    opacity: 0.8;
}/* ===================================
   public/css/components/apartments.css
   Estilos de la sección de pisos
   =================================== */

/* ===================================
   SECCIÓN DE PISOS
   =================================== */
.apartments-section {
    min-height: 100vh;
    background: #f8f8f8;
    padding: 80px 0;
}

.apartments-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
}

/* Título con barrios rotando */
.apartments-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-xl);
    color: var(--color-black);
}

.neighborhood-rotator {
    display: inline-block;
    min-width: 200px;
    text-align: left;
    color: #666;
    position: relative;
}

.neighborhood-rotator .letter {
    display: inline-block;
    opacity: 0;
    animation: letterFadeIn 0.1s ease forwards;
}

@keyframes letterFadeIn {
    to {
        opacity: 1;
    }
}

/* ===================================
   GRID DE PISOS
   =================================== */
.apartments-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: var(--spacing-xl);
}

/* Responsive grid */
@media (max-width: 1023px) {
    .apartments-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .apartments-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Card de piso */
.apartment-card {
    background: var(--color-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.6s ease;
}

.apartment-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* ===================================
   CARRUSEL DE IMÁGENES
   =================================== */
.apartment-carousel {
    position: relative;
    height: 250px;
    overflow: hidden;
    cursor: pointer;
}

.carousel-container {
    display: flex;
    height: 100%;
    transition: transform 0.4s ease;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
}

/* Controles del carrusel */
.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: var(--color-white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
    z-index: 2;
}

.apartment-carousel:hover .carousel-button {
    opacity: 1;
}

.carousel-button:hover {
    background: rgba(0, 0, 0, 0.7);
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-button svg {
    width: 20px;
    height: 20px;
}

/* Indicadores del carrusel */
.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 2;
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: background 0.3s ease;
}

.carousel-indicator.active {
    background: var(--color-white);
}

/* ===================================
   INFORMACIÓN DEL PISO
   =================================== */
.apartment-info {
    padding: 20px;
}

.apartment-address {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--color-black);
}

.apartment-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.95rem;
    color: #666;
}

.detail-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ===================================
   BOTÓN CARGAR MÁS
   =================================== */
.btn-load-more {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
    padding: 14px 30px;
    background: var(--color-black);
    color: var(--color-white);
    border: none;
    border-radius: 30px;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-load-more:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-load-more.loading {
    pointer-events: none;
}

.btn-load-more.loading .btn-icon {
    animation: spin 1s linear infinite;
}

/* ===================================
   BOTÓN VER EN MAPA
   =================================== */
.btn-view-map {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px auto 0;
    padding: 10px 24px;
    background: #1976D2;
    color: var(--color-white);
    border: none;
    border-radius: 25px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: gravityBounce 7s ease-in-out infinite;
}

.btn-view-map:hover {
    background: #1565C0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(25, 118, 210, 0.3);
    animation-play-state: paused;
}

.btn-view-map .btn-icon {
    width: 18px;
    height: 18px;
}

/* Animación de salto con efecto de gravedad */
@keyframes gravityBounce {
    0%, 93%, 100% {
        transform: translateY(0);
        animation-timing-function: ease-in;
    }
    94% {
        transform: translateY(-8px);
        animation-timing-function: ease-out;
    }
    95% {
        transform: translateY(-6px);
        animation-timing-function: ease-in;
    }
    96% {
        transform: translateY(0);
        animation-timing-function: ease-out;
    }
    97% {
        transform: translateY(-3px);
        animation-timing-function: ease-in;
    }
    98% {
        transform: translateY(0);
        animation-timing-function: ease-out;
    }
    99% {
        transform: translateY(-1px);
        animation-timing-function: ease-in;
    }
}

/* ===================================
   MODAL TÉRMINOS Y CONDICIONES
   =================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background: var(--color-white);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    border-radius: 12px;
    padding: 40px;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    transition: opacity 0.3s ease;
}

.modal-close:hover {
    opacity: 0.7;
}

.modal-close svg {
    width: 24px;
    height: 24px;
    stroke: #666;
}

.modal-body {
    color: #333;
    line-height: 1.8;
}

.modal-body h3 {
    font-size: 1.25rem;
    margin: 25px 0 15px;
    color: var(--color-black);
}

.modal-body p {
    margin-bottom: 15px;
    text-align: justify;
}

.update-date {
    font-style: italic;
    color: #666;
    margin-bottom: 25px;
}

/* ===================================
   MODAL GALERÍA DE FOTOS
   =================================== */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3500; /* Mayor que el modal de mapa (3000) */
    background: #fff;
}

.gallery-modal.show {
    display: flex;
    flex-direction: column;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.gallery-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Header del modal con dirección */
.gallery-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 40px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gallery-header-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.gallery-address {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.gallery-apartment-details {
    display: flex;
    gap: 15px;
    align-items: center;
}

.gallery-detail-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 0.9rem;
}

.gallery-detail-item .detail-icon {
    width: 16px;
    height: 16px;
    stroke: #666;
}

.gallery-close {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 16px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gallery-close:hover {
    background: #f5f5f5;
    border-color: #999;
}

.gallery-close svg {
    width: 16px;
    height: 16px;
    stroke: #333;
}

/* Carrusel de galería */
.gallery-carousel {
    position: absolute;
    top: 55px; /* Altura del header */
    bottom: 70px; /* Altura del footer */
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
}

.gallery-prev,
.gallery-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.gallery-prev:hover,
.gallery-next:hover {
    background: #fff;
    border-color: #999;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.gallery-prev {
    left: 20px;
}

.gallery-next {
    right: 20px;
}

.gallery-prev svg,
.gallery-next svg {
    width: 20px;
    height: 20px;
    stroke: #666;
}

.gallery-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 60px;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    opacity: 1;
    /* Forzar cambio instantáneo sin transiciones */
    transition: none !important;
    -webkit-transition: none !important;
    -moz-transition: none !important;
    -o-transition: none !important;
    image-rendering: -webkit-optimize-contrast;
    /* Usar todo el espacio disponible */
    max-width: 100%;
    max-height: 100%;
}

/* Footer con controles */
.gallery-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #e0e0e0;
    padding: 12px 40px;
    z-index: 10;
}

/* Información y contador */
.gallery-info {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 0;
}

.gallery-counter {
    color: #666;
    font-size: 0.9rem;
}

/* Controles de habitaciones */
.room-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.room-label {
    color: #666;
    font-size: 0.9rem;
    margin-right: 8px;
}

.room-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #333;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: none; /* Sin transición para respuesta instantánea */
}

.room-btn:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.room-btn.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

.room-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f8f8;
    color: #999;
}

/* ===================================
   RESPONSIVE
   =================================== */
/* Tablet styles */
@media (min-width: 768px) and (max-width: 1023px) {
    .gallery-header {
        padding: 15px 40px;
    }
    
    .gallery-address {
        font-size: 1.1rem;
    }
    
    .gallery-carousel {
        margin-top: 70px;
        margin-bottom: 90px;
    }
    
    .gallery-prev,
    .gallery-next {
        width: 45px;
        height: 45px;
    }
    
    .gallery-prev {
        left: 20px;
    }
    
    .gallery-next {
        right: 20px;
    }
    
    .gallery-image-container {
        padding: 0 80px;
    }
    
    .gallery-footer {
        padding: 15px 40px;
    }
}

/* Mobile styles */
@media (max-width: 767px) {
    .apartments-section {
        padding: 60px 0;
    }
    
    .apartments-container {
        padding: 0 var(--spacing-md);
    }
    
    .apartments-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .apartment-carousel {
        height: 200px;
    }
    
    .carousel-button {
        width: 35px;
        height: 35px;
        opacity: 1; /* Siempre visible en móvil */
    }
    
    .modal-content {
        padding: 30px 20px;
        width: 95%;
    }
    
    /* Gallery modal fullscreen on mobile */
    .gallery-header {
        padding: 12px 15px;
        background: rgba(255, 255, 255, 0.98);
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .gallery-header-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        flex: 1;
    }
    
    .gallery-address {
        font-size: 0.95rem;
    }
    
    .gallery-apartment-details {
        gap: 10px;
        font-size: 0.85rem;
    }
    
    .gallery-detail-item .detail-icon {
        width: 14px;
        height: 14px;
    }
    
    .gallery-close {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .gallery-close span {
        display: none; /* Ocultar texto, solo mostrar icono */
    }
    
    .gallery-carousel {
        top: 90px; /* Más espacio para el header con info */
        bottom: 70px;
    }
    
    .gallery-image-container {
        padding: 0 50px;
    }
    
    .gallery-image {
        max-height: calc(100vh - 125px);
    }
    
    .gallery-prev,
    .gallery-next {
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.9);
    }
    
    .gallery-prev {
        left: 5px;
    }
    
    .gallery-next {
        right: 5px;
    }
    
    .gallery-prev svg,
    .gallery-next svg {
        width: 18px;
        height: 18px;
    }
    
    .gallery-footer {
        padding: 12px 15px;
        background: rgba(255, 255, 255, 0.95);
    }
    
    .gallery-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .room-controls {
        width: 100%;
        justify-content: flex-start;
    }
    
    .room-label {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .room-btn {
        padding: 6px 14px;
        font-size: 0.8rem;
    }
}

/* Soporte para gestos táctiles */
@media (hover: none) {
    .carousel-button {
        opacity: 1;
    }
}

/* Estados de carga */
.apartment-card.loading {
    position: relative;
    overflow: hidden;
}

.apartment-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.5),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    to {
        left: 100%;
    }
}