/* ===== Variables ===== */
:root {
    --brown-dark: #3b2a1e;
    --brown: #5a4130;
    --brown-soft: #6f5340;
    --tan: #a8825a;
    --tan-dark: #8f6c46;
    --cream: #f6efe4;
    --cream-2: #efe4d4;
    --card-bg: #fffdf9;
    --text: #3a2f28;
    --text-soft: #6d5f54;
    --line: #e6dccb;
    --whatsapp: #25d366;
    --whatsapp-dark: #1da851;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 2px 10px rgba(59, 42, 30, 0.07);
    --shadow-md: 0 8px 28px rgba(59, 42, 30, 0.13);
    --font-body: 'Montserrat', system-ui, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--cream);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

.highlight {
    color: var(--tan);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 18px;
}

/* ===== Header ===== */
.header {
    background:
        radial-gradient(120% 120% at 50% -20%, rgba(168, 130, 90, 0.35), transparent 60%),
        linear-gradient(160deg, var(--brown) 0%, var(--brown-dark) 100%);
    color: #fff;
    text-align: center;
    padding: 42px 0 48px;
}

.header-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cream);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 100px;
    margin-bottom: 18px;
}

.header-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.3rem, 9vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -0.01em;
}

.header-title .highlight {
    color: var(--tan);
    font-style: italic;
}

.header-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 460px;
    margin: 14px auto 0;
}

.header-zona {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(0, 0, 0, 0.18);
    padding: 8px 16px;
    border-radius: 100px;
    margin: 20px auto 0;
}

.header-zona svg {
    color: var(--tan);
    flex-shrink: 0;
}

.header-zona strong {
    color: #fff;
    font-weight: 600;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    padding: 14px 26px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-whatsapp {
    background: var(--whatsapp);
    color: #fff;
    margin-top: 24px;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp:hover {
    background: var(--whatsapp-dark);
    transform: translateY(-2px);
}

/* ===== Catálogo grid (masonry con columns) ===== */
.catalogo {
    padding: 40px 0 60px;
}

.grid {
    column-count: 1;
    column-gap: 20px;
}

.card {
    break-inside: avoid;
    margin-bottom: 20px;
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.card-media {
    display: block;
    position: relative;
    width: 100%;
    padding: 0;
    border: none;
    background: var(--cream-2);
    cursor: zoom-in;
    line-height: 0;
}

.card-media img {
    width: 100%;
    height: auto;
}

.foto-count {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 10px;
    border-radius: 100px;
    line-height: 1;
}

.estado-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    padding: 6px 14px;
    border-radius: 8px;
}

.estado--reservado {
    background: var(--tan-dark);
}

.estado--vendido {
    background: #b5443a;
}

.card--vendido .card-media img,
.card--reservado .card-media img {
    filter: grayscale(0.6) opacity(0.75);
}

.card-body {
    padding: 18px 18px 20px;
}

.card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--brown-dark);
    line-height: 1.15;
}

.card-resumen {
    font-size: 0.9rem;
    color: var(--text-soft);
    margin-top: 6px;
}

.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.card-precio {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.7rem;
    color: var(--brown);
}

.btn-wa {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.92rem;
    color: #fff;
    background: var(--whatsapp);
    padding: 10px 18px;
    border-radius: 100px;
    transition: background 0.18s ease, transform 0.18s ease;
}

.btn-wa:hover {
    background: var(--whatsapp-dark);
    transform: translateY(-1px);
}

/* ===== Footer ===== */
.footer {
    background: var(--brown-dark);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 30px 0;
    font-size: 0.88rem;
}

.footer-small {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.78rem;
    margin-top: 6px;
}

/* ===== WhatsApp flotante ===== */
.whatsapp-float {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--whatsapp);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    z-index: 900;
    animation: pulse 2.4s infinite;
}

.whatsapp-float svg {
    width: 32px;
    height: 32px;
    fill: #fff;
}

@keyframes pulse {
    0% { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(37, 211, 102, 0.45); }
    70% { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 0 0 16px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(20, 14, 9, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox[hidden] {
    display: none;
}

.lb-figure {
    max-width: 92vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.lb-figure img {
    max-width: 100%;
    max-height: 78vh;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lb-figure figcaption {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
}

.lb-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.6rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
}

.lb-close:hover {
    opacity: 1;
}

.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease;
}

.lb-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lb-nav[hidden] {
    display: none;
}

.lb-prev {
    left: 12px;
}

.lb-next {
    right: 12px;
}

/* ===== Responsive ===== */
@media (min-width: 620px) {
    .grid {
        column-count: 2;
    }
}

@media (min-width: 1000px) {
    .header {
        padding: 60px 0 66px;
    }

    .grid {
        column-count: 3;
    }

    .lb-prev {
        left: 30px;
    }

    .lb-next {
        right: 30px;
    }
}