/* ==========================================================================
   MefPropiedades — Design system
   Palette grounded in Chilean stone and copper; editorial serif + grotesk.
   ========================================================================== */

:root {
    /* Color */
    --ink: #16180f; /* near-black, warm olive undertone */
    --ink-soft: #2a2d1f;
    --paper: #f2efe4; /* warm bone */
    --paper-raised: #ffffff;
    --moss: #333f28; /* deep green — primary accent */
    --moss-light: #4c5c3d;
    --clay: #a85a2c; /* burnt clay — secondary accent */
    --stone: #d9d3c1; /* hairline borders */
    --stone-dark: #857f6b; /* muted text */
    --white: #fffdf8;
    /* Type */
    --font-display: "Newsreader", Georgia, serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    /* Layout */
    --content-width: 1180px;
    --radius: 3px;
    --transition: 220ms ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--ink);
    margin: 0;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

p {
    margin: 0;
}

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

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

:focus-visible {
    outline: 2px solid var(--moss);
    outline-offset: 3px;
}

.container {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 28px;
}

/* ==========================================================================
   Header / Nav
   ========================================================================== */

.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--stone);
    position: sticky;
    top: 0;
    z-index: 40;
}

    .site-header .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 76px;
    }

.brand {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-style: italic;
    color: var(--ink);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 36px;
}

    .main-nav a {
        font-size: 0.95rem;
        color: var(--ink-soft);
        position: relative;
        padding: 4px 0;
        transition: color var(--transition);
    }

        .main-nav a:hover {
            color: var(--moss);
        }

        .main-nav a::after {
            content: "";
            position: absolute;
            left: 0;
            right: 100%;
            bottom: 0;
            height: 1px;
            background: var(--moss);
            transition: right var(--transition);
        }

        .main-nav a:hover::after {
            right: 0;
        }

.nav-cta {
    border: 1px solid var(--ink);
    padding: 9px 20px;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

    .nav-cta:hover {
        background: var(--ink);
        color: var(--paper);
    }

    .nav-cta::after {
        content: none;
    }

/* ==========================================================================
   Buttons (shared)
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.btn-primary {
    background: var(--moss);
    color: var(--white);
}

    .btn-primary:hover {
        background: var(--moss-light);
    }

.btn-outline {
    border-color: currentColor;
    color: inherit;
}

    .btn-outline:hover {
        background: rgba(255, 255, 255, 0.08);
    }

.btn-whatsapp {
    background: var(--ink);
    color: var(--paper);
}

    .btn-whatsapp:hover {
        background: var(--moss);
    }

.text-link {
    position: relative;
    font-size: 0.92rem;
    padding-bottom: 2px;
    border-bottom: 1px solid var(--stone-dark);
    transition: border-color var(--transition), color var(--transition);
}

    .text-link:hover {
        border-color: var(--moss);
        color: var(--moss);
    }

/* ==========================================================================
   Hero (Home)
   ========================================================================== */

.hero {
    background: var(--ink);
    color: var(--paper);
    overflow: hidden;
}

    .hero .container {
        display: grid;
        grid-template-columns: 1.05fr 0.95fr;
        align-items: center;
        gap: 56px;
        padding-top: 84px;
        padding-bottom: 84px;
    }

.hero-copy p.hero-kicker {
    font-family: var(--font-display);
    font-style: italic;
    color: #cfc9b4;
    font-size: 1.05rem;
    margin-bottom: 18px;
}

.hero-copy h1 {
    font-size: clamp(2.4rem, 4vw, 3.6rem);
    color: var(--white);
    max-width: 12ch;
}

.hero-copy .hero-sub {
    margin-top: 22px;
    max-width: 42ch;
    color: #cfc9b4;
    font-size: 1.05rem;
}

.hero-actions {
    margin-top: 36px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

    .hero-actions .btn-outline {
        border-color: #57553f;
        color: var(--paper);
    }

        .hero-actions .btn-outline:hover {
            border-color: var(--paper);
        }

.hero-figure {
    position: relative;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius);
    overflow: hidden;
    background: linear-gradient(160deg, #3a4a30, #1c2115);
}

    .hero-figure img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .hero-figure .hero-figure-tag {
        position: absolute;
        left: 20px;
        bottom: 20px;
        background: rgba(22, 24, 15, 0.72);
        color: var(--paper);
        font-size: 0.85rem;
        padding: 8px 14px;
        border-radius: var(--radius);
        backdrop-filter: blur(2px);
    }

/* Trust strip */

.trust-strip {
    background: var(--paper);
    border-bottom: 1px solid var(--stone);
}

    .trust-strip .container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 32px;
        padding-top: 40px;
        padding-bottom: 40px;
    }

.trust-item {
    padding-left: 20px;
    border-left: 1px solid var(--stone);
}

    .trust-item strong {
        display: block;
        font-family: var(--font-display);
        font-size: 1.6rem;
        color: var(--ink);
        margin-bottom: 4px;
    }

    .trust-item span {
        color: var(--stone-dark);
        font-size: 0.92rem;
    }

/* ==========================================================================
   Section headers
   ========================================================================== */

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

    .section-heading .section-label {
        font-family: var(--font-display);
        font-style: italic;
        color: var(--clay);
        font-size: 1.05rem;
        display: block;
        margin-bottom: 8px;
    }

    .section-heading h2 {
        font-size: clamp(1.7rem, 3vw, 2.3rem);
    }

.view-all {
    border-bottom: 1px solid var(--stone-dark);
    padding-bottom: 2px;
    font-size: 0.92rem;
    white-space: nowrap;
}

    .view-all:hover {
        border-color: var(--moss);
        color: var(--moss);
    }

/* ==========================================================================
   Properties grid & card
   ========================================================================== */

.properties-section {
    padding: 88px 0;
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px 28px;
}

.property-card {
    background: var(--paper-raised);
    border: 1px solid var(--stone);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.property-image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--stone);
}

    .property-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 420ms ease;
    }

.property-card:hover .property-image img {
    transform: scale(1.045);
}

.property-operation {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--ink);
    color: var(--paper);
    font-size: 0.78rem;
    padding: 6px 12px;
    border-radius: var(--radius);
}

.property-content {
    padding: 22px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.property-type {
    color: var(--stone-dark);
    font-size: 0.85rem;
}

.property-content h3 {
    font-size: 1.2rem;
    font-weight: 500;
}

.property-location {
    color: var(--stone-dark);
    font-size: 0.9rem;
}

.property-features {
    display: flex;
    gap: 16px;
    font-size: 0.86rem;
    color: var(--ink-soft);
    padding-top: 4px;
    border-top: 1px solid var(--stone);
    margin-top: 4px;
}

.property-footer {
    margin-top: auto;
    padding-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .property-footer strong {
        font-family: var(--font-display);
        font-size: 1.3rem;
        color: var(--ink);
    }

/* ==========================================================================
   Contact section (Home)
   ========================================================================== */

.contact-section {
    background: var(--moss);
    color: var(--paper);
    padding: 96px 0;
}

.contact-content {
    max-width: 560px;
}

    .contact-content .section-label {
        color: #d8cf9f;
    }

    .contact-content h2 {
        color: var(--white);
        font-size: clamp(1.8rem, 3.4vw, 2.5rem);
    }

    .contact-content p {
        margin-top: 18px;
        color: #dfe2d5;
        max-width: 46ch;
    }

    .contact-content .btn-whatsapp {
        margin-top: 32px;
    }

/* ==========================================================================
   Properties listing page
   ========================================================================== */

.properties-page {
    padding: 64px 0 96px;
}

.page-header {
    max-width: 60ch;
    margin-bottom: 52px;
}

    .page-header .section-label {
        font-family: var(--font-display);
        font-style: italic;
        color: var(--clay);
        font-size: 1.05rem;
        display: block;
        margin-bottom: 10px;
    }

    .page-header h1 {
        font-size: clamp(2rem, 4vw, 2.7rem);
    }

    .page-header p {
        margin-top: 16px;
        color: var(--stone-dark);
        font-size: 1.02rem;
    }

.results-count {
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--stone-dark);
    border-top: 1px solid var(--stone);
    padding-top: 18px;
}

.empty-state {
    padding: 64px 0;
    text-align: left;
    border-top: 1px solid var(--stone);
    color: var(--stone-dark);
    max-width: 50ch;
}

/* ==========================================================================
   Property detail page
   ========================================================================== */

.detail-page {
    padding: 48px 0 96px;
}

.back-link {
    display: inline-block;
    margin-bottom: 32px;
    font-size: 0.9rem;
    color: var(--stone-dark);
    border-bottom: 1px solid transparent;
}

    .back-link:hover {
        color: var(--moss);
        border-color: var(--moss);
    }

.detail-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 56px;
    align-items: start;
}

/* Gallery */

.gallery-main {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--stone);
}

    .gallery-main img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: opacity 200ms ease;
    }

.gallery-empty {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--stone-dark);
    font-size: 0.95rem;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(22, 24, 15, 0.55);
    color: var(--white);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

    .gallery-nav:hover {
        background: rgba(22, 24, 15, 0.85);
    }

.gallery-prev {
    left: 14px;
}

.gallery-next {
    right: 14px;
}

.gallery-counter {
    position: absolute;
    right: 14px;
    bottom: 14px;
    background: rgba(22, 24, 15, 0.62);
    color: var(--paper);
    font-size: 0.8rem;
    padding: 5px 11px;
    border-radius: var(--radius);
}

.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-top: 12px;
}

    .gallery-thumbs img {
        aspect-ratio: 1 / 1;
        object-fit: cover;
        border-radius: var(--radius);
        cursor: pointer;
        border: 2px solid transparent;
        opacity: 0.7;
        transition: opacity var(--transition), border-color var(--transition);
    }

        .gallery-thumbs img:hover {
            opacity: 1;
        }

        .gallery-thumbs img.is-active {
            opacity: 1;
            border-color: var(--moss);
        }

/* Info panel */

.detail-info {
    position: sticky;
    top: 100px;
}

.detail-badge {
    display: inline-block;
    background: var(--clay);
    color: var(--white);
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.detail-info h1 {
    font-size: clamp(1.7rem, 3vw, 2.2rem);
}

.detail-meta {
    margin-top: 10px;
    color: var(--stone-dark);
    font-size: 1rem;
}

.detail-price {
    margin-top: 20px;
    font-family: var(--font-display);
    font-size: 2.1rem;
    color: var(--ink);
}

.detail-features {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--stone);
    border-bottom: 1px solid var(--stone);
    padding: 20px 0;
}

    .detail-features div {
        text-align: left;
    }

    .detail-features strong {
        display: block;
        font-family: var(--font-display);
        font-size: 1.3rem;
    }

    .detail-features span {
        font-size: 0.82rem;
        color: var(--stone-dark);
    }

.detail-block {
    margin-top: 28px;
}

    .detail-block h5 {
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--ink);
        margin-bottom: 8px;
    }

    .detail-block p {
        color: var(--ink-soft);
        font-size: 0.98rem;
    }

.detail-info .btn-whatsapp {
    width: 100%;
    justify-content: center;
    margin-top: 32px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: var(--ink);
    color: #8d8c78;
    padding: 32px 0;
    font-size: 0.85rem;
}

    .site-footer a {
        color: #b7b69f;
        border-bottom: 1px solid transparent;
    }

        .site-footer a:hover {
            border-color: #b7b69f;
        }

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

@media (max-width: 960px) {
    .hero .container {
        grid-template-columns: 1fr;
        padding-top: 56px;
        padding-bottom: 56px;
    }

    .hero-figure {
        aspect-ratio: 16 / 10;
    }

    .trust-strip .container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .trust-item {
        border-left: none;
        border-top: 1px solid var(--stone);
        padding-left: 0;
        padding-top: 16px;
    }

    .properties-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-info {
        position: static;
        margin-top: 40px;
    }

    .gallery-thumbs {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 640px) {
    .main-nav {
        gap: 20px;
    }

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

    .detail-features {
        grid-template-columns: repeat(3, 1fr);
    }

    .section-heading {
        flex-direction: column;
        align-items: flex-start;
    }
}
