/* ===== Casas Grid Component ===== */

.casas-grid-section {
    position: relative;
    background: var(--bg-white);
    padding: 0;
    overflow: hidden;
    min-height: 800px;
}

@media (max-width: 768px) {
    .casas-grid-section {
        min-height: auto;
    }
}

.casas-grid-container {
    position: relative;
    width: 100%;
}

/* Grid de imágenes */
.casas-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    position: relative;
}

.casas-grid-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    height: 800px;
    transition: all 0.5s ease;
}

.casas-grid-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(100%);
    transition: all 0.5s ease;
}

.casas-grid-item:hover .casas-grid-image {
    filter: grayscale(0);
    transform: scale(1.05);
}

/* Título overlay */
.casas-grid-title-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.casas-grid-item:hover .casas-grid-title-overlay {
    opacity: 0;
}

/* Punto parpadeante (oculto por defecto en desktop) */
.casas-tap-indicator {
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    background: var(--accent-color);
    border-radius: 50%;
    z-index: 6;
    pointer-events: none;
    display: none;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.9),
                0 0 40px rgba(212, 175, 55, 0.6),
                0 0 60px rgba(212, 175, 55, 0.4);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Efecto al hacer tap */
.casas-grid-item:active .casas-tap-indicator {
    opacity: 0.4;
    transform: translateX(-50%) scale(0.7);
}

.casas-tap-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: var(--accent-color);
    border-radius: 50%;
    animation: pulse-ring-intense 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.8);
}

.casas-tap-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: var(--accent-light);
    border-radius: 50%;
    animation: pulse-dot-intense 1.5s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

@keyframes pulse-ring-intense {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
        box-shadow: 0 0 20px rgba(212, 175, 55, 1);
    }
    50% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0.5;
        box-shadow: 0 0 40px rgba(212, 175, 55, 0.6);
    }
    100% {
        transform: translate(-50%, -50%) scale(3.5);
        opacity: 0;
        box-shadow: 0 0 60px rgba(212, 175, 55, 0);
    }
}

@keyframes pulse-dot-intense {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        filter: brightness(1.2);
    }
    25% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 1;
        filter: brightness(1.5);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.9;
        filter: brightness(1.3);
    }
    75% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 1;
        filter: brightness(1.5);
    }
}

.casas-grid-title {
    font-family: var(--font-heading);
    color: #ffffff;
    font-size: 2.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: 2px 2px 16px rgba(0, 0, 0, 0.8);
}

/* Líneas divisorias doradas - Solo desktop */
.casas-grid-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    z-index: 10;
    pointer-events: none;
    display: none;
}

@media (min-width: 768px) {
    .casas-grid-divider {
        display: block;
    }
}

.casas-grid-divider-1 {
    left: 33.333%;
    background: linear-gradient(
        to bottom,
        rgba(212, 175, 55, 0) 0%,
        rgba(212, 175, 55, 0.25) 15%,
        rgba(212, 175, 55, 0.9) 50%,
        rgba(212, 175, 55, 0.25) 85%,
        rgba(212, 175, 55, 0) 100%
    );
    box-shadow: 0 0 3px rgba(212, 175, 55, 0.6);
}

.casas-grid-divider-2 {
    left: 66.666%;
    background: linear-gradient(
        to bottom,
        rgba(212, 175, 55, 0) 0%,
        rgba(212, 175, 55, 0.25) 15%,
        rgba(212, 175, 55, 0.9) 50%,
        rgba(212, 175, 55, 0.25) 85%,
        rgba(212, 175, 55, 0) 100%
    );
    box-shadow: 0 0 3px rgba(212, 175, 55, 0.6);
}

/* Modal */
.casas-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.casas-modal-overlay.active {
    display: block;
    pointer-events: all;
}

.casas-modal {
    position: absolute;
    background: #192427;
    backdrop-filter: blur(10px);
    color: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    min-width: 300px;
    max-width: 400px;
    width: calc(100% - 40px);
    z-index: 10001;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.casas-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 2rem;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    z-index: 10;
    line-height: 1;
    padding: 0;
}

.casas-modal-close:hover {
    color: #d4af37;
    opacity: 1;
}

.casas-modal-content {
    position: relative;
}

/* Descripción */
.casas-modal-description {
    margin-bottom: 1.5rem;
}

.casas-modal-description p {
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-weight: 400;
}

/* Grid de contenido */
.casas-modal-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Título vertical */
.casas-modal-title-col {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.casas-modal-title-vertical {
    font-family: var(--font-body);
    writing-mode: vertical-lr;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ffffff;
    margin: 0;
    white-space: nowrap;
}

/* Lista de items */
.casas-modal-items-col {
    display: flex;
    align-items: flex-start;
}

.casas-modal-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.casas-modal-items li {
    font-family: var(--font-body);
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-weight: 400;
}

/* Botón */
.casas-modal-button {
    text-align: center;
    margin-top: 1.5rem;
}

.casas-modal-btn {
    font-family: var(--font-body);
    display: inline-block;
    background: transparent;
    color: #ffffff;
    padding: 0.75rem 2rem;
    border: 2px solid #ffffff;
    border-radius: 0;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.casas-modal-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: #ffffff;
    transition: width 0.3s ease;
    z-index: 0;
}

.casas-modal-btn span {
    position: relative;
    z-index: 1;
}

.casas-modal-btn:hover {
    color: #192427;
    border-color: #d4af37;
}

.casas-modal-btn:hover::before {
    width: 100%;
}

/* ===== Responsive ===== */

/* Tablet */
@media (max-width: 968px) {
    .casas-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .casas-grid-item {
        height: 600px;
    }

    .casas-grid-title {
        font-size: 2rem;
    }

    .casas-grid-divider-2 {
        display: none;
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Mostrar punto parpadeante en móvil */
    .casas-tap-indicator {
        display: block !important;
        width: 22px;
        height: 22px;
    }

    .casas-grid {
        grid-template-columns: 1fr;
    }

    .casas-grid-item {
        height: 350px;
    }

    .casas-grid-title {
        font-size: 1.75rem;
    }

    .casas-modal {
        width: calc(100% - 32px);
        max-width: 400px;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        padding: 2.5rem 2rem;
        max-height: 85vh;
        overflow-y: auto;
    }

    .casas-modal-close {
        top: 1rem;
        right: 1rem;
    }

    .casas-modal-description {
        margin-bottom: 2rem;
    }

    .casas-modal-description p {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .casas-modal-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-bottom: 2rem;
    }

    .casas-modal-title-col {
        order: -1;
        padding-bottom: 1rem;
        border-bottom: 2px solid rgba(212, 175, 55, 0.4);
    }

    .casas-modal-title-vertical {
        writing-mode: horizontal-tb;
        text-orientation: mixed;
        transform: none;
        text-align: center;
        font-size: 1.8rem;
        letter-spacing: 0.15em;
    }

    .casas-modal-items-col {
        align-items: center;
        justify-content: center;
    }

    .casas-modal-items {
        align-items: flex-start;
        width: 100%;
        gap: 0.75rem;
    }

    .casas-modal-items li {
        font-size: 1.05rem;
        padding: 0.5rem 0;
    }

    .casas-modal-button {
        margin-top: 0.5rem;
    }

    .casas-modal-btn {
        width: 100%;
        padding: 1rem 2rem;
        font-size: 0.95rem;
    }
}

/* Mobile pequeño */
@media (max-width: 480px) {
    .casas-tap-indicator {
        width: 12px;
        height: 12px;
        bottom: 22%;
    }

    .casas-grid-item {
        height: 300px;
    }

    .casas-grid-title {
        font-size: 1.5rem;
    }

    .casas-modal {
        width: calc(100% - 24px);
        padding: 2rem 1.5rem;
    }

    .casas-modal-close {
        top: 0.75rem;
        right: 0.75rem;
    }

    .casas-modal-description {
        margin-bottom: 1.5rem;
    }

    .casas-modal-description p {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .casas-modal-title-vertical {
        font-size: 1.6rem;
        letter-spacing: 0.12em;
    }

    .casas-modal-items li {
        font-size: 0.95rem;
        padding: 0.4rem 0;
    }

    .casas-modal-btn {
        padding: 0.9rem 1.5rem;
        font-size: 0.85rem;
    }
}

