/* ============================================
   El Mauco — Propiedades
   Clean, warm, Chilean-inspired design
   ============================================ */

:root {
    --clay: #8B6F4E;
    --clay-dark: #6B5340;
    --clay-light: #A68B6B;
    --earth: #3D3227;
    --earth-soft: #5C4A3A;
    --sand: #F5F0E8;
    --sand-warm: #EDE6DA;
    --cream: #FAF8F4;
    --white: #FFFFFF;
    --ink: #2C2421;
    --ink-soft: #5A4F48;
    --ink-muted: #9A8E85;
    --terracotta: #C4704A;
    --terracotta-dark: #A85D3C;
    --green: #5A7A52;
    --border: #E5DDD2;
    --shadow-sm: 0 1px 3px rgba(60, 50, 39, 0.08);
    --shadow-md: 0 4px 16px rgba(60, 50, 39, 0.1);
    --shadow-lg: 0 8px 32px rgba(60, 50, 39, 0.12);
    --radius: 8px;
    --radius-lg: 12px;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Source Sans 3', system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink-soft);
    background: var(--cream);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--ink);
    line-height: 1.2;
}

h2 { font-size: clamp(1.75rem, 4vw, 2.25rem); font-weight: 600; }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); font-weight: 600; }

/* ============================================
   Navigation
   ============================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: background 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
}

.nav.scrolled {
    background: rgba(250, 248, 244, 0.98);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo img {
    transition: opacity 0.2s;
    max-height: 40px;
    max-width: 160px;
    width: auto;
}

.nav-logo:hover img { opacity: 0.8; }

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-size: 15px;
    font-weight: 500;
    color: var(--white);
    transition: color 0.2s;
    position: relative;
}

.nav.scrolled .nav-links a {
    color: var(--ink-soft);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--terracotta);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--terracotta);
    border-radius: 1px;
}

/* Mobile toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: background 0.3s;
}

.nav.scrolled .nav-toggle span {
    background: var(--ink);
}

/* ============================================
   Hero
   ============================================ */
.hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('images/parcela/Picture15-768x576.jpg') center/cover no-repeat;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(44, 36, 33, 0.75) 0%, rgba(60, 50, 39, 0.5) 100%);
}

.hero-content {
    position: relative;
    text-align: center;
    padding: 140px 24px 80px;
}

.hero-title {
    font-size: clamp(2.5rem, 7vw, 4rem);
    color: var(--white);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.hero-title em {
    font-style: italic;
    color: var(--sand-warm);
}

.hero-sub {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 300;
    letter-spacing: 0.02em;
}

/* ============================================
   Properties Section
   ============================================ */
.properties {
    padding: 80px 0 100px;
}

.section-title {
    text-align: center;
    margin-bottom: 48px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: var(--terracotta);
    margin: 16px auto 0;
    border-radius: 2px;
}

.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
}

.property-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.property-card-img {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.property-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.property-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--clay);
    color: var(--white);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 100px;
    letter-spacing: 0.02em;
}

.property-badge.sale {
    background: var(--terracotta);
}

.property-card-body {
    padding: 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.property-card-body h3 {
    margin-bottom: 4px;
}

.property-location {
    font-size: 14px;
    color: var(--ink-muted);
    margin-bottom: 12px;
    font-weight: 500;
}

.property-card-body p {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.property-link {
    font-size: 15px;
    font-weight: 600;
    color: var(--terracotta);
    transition: color 0.2s;
}

.property-card:hover .property-link {
    color: var(--terracotta-dark);
}

/* ============================================
   Contact Bar
   ============================================ */
.contact-bar {
    background: var(--sand);
    padding: 48px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.contact-bar-inner {
    display: flex;
    justify-content: center;
    gap: 64px;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.contact-item svg {
    color: var(--terracotta);
    flex-shrink: 0;
}

.contact-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}

.contact-item a {
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    transition: color 0.2s;
}

.contact-item a:hover {
    color: var(--terracotta);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--earth);
    color: rgba(255, 255, 255, 0.7);
    padding: 48px 0 32px;
    text-align: center;
}

.footer-logo {
    margin: 0 auto 20px;
    opacity: 0.9;
    filter: brightness(10);
    max-height: 32px;
    max-width: 140px;
    width: auto;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.footer-nav a {
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: var(--white);
}

.footer-copy {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   Page Header (subpages)
   ============================================ */
.page-header {
    background: var(--earth);
    padding: 100px 24px 36px;
    text-align: center;
}

.page-header h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
    color: var(--white);
    font-weight: 700;
}

.page-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    margin-top: 8px;
}

/* ============================================
   Image Gallery (Parcela & Mackenna)
   ============================================ */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 24px 0;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 16px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    color: var(--white);
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   Property Detail Content
   ============================================ */
.detail-section {
    padding: 32px 0;
}

.detail-content {
    max-width: 800px;
    margin: 0 auto;
}

.detail-content h2 {
    margin-bottom: 8px;
}

.detail-content h4 {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--terracotta);
    margin-bottom: 16px;
}

.detail-content h5 {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ink);
    margin: 32px 0 12px;
}

.detail-content p {
    margin-bottom: 16px;
}

.detail-content ol {
    padding-left: 20px;
    margin-bottom: 24px;
}

.detail-content ol li {
    margin-bottom: 12px;
    padding-left: 8px;
}

.detail-content ol li strong {
    color: var(--ink);
}

.detail-highlight {
    background: var(--sand);
    border-left: 4px solid var(--terracotta);
    padding: 20px 24px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 24px 0;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--ink);
}

/* Info grid for specs */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.info-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.info-box h4 {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
    margin-bottom: 8px;
}

.info-box p {
    font-size: 15px;
    margin-bottom: 4px;
}

.info-box .price {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ink);
}

/* Download button */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--terracotta);
    color: var(--white);
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

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

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--ink-soft);
}

.btn-outline:hover {
    background: var(--sand);
    border-color: var(--clay-light);
}

/* Features list (Mackenna) */
.features-list {
    list-style: none;
    padding: 0;
    margin: 24px 0;
}

.features-list li {
    padding: 10px 0 10px 28px;
    position: relative;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
}

.features-list li:last-child {
    border-bottom: none;
}

.features-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--green);
    font-weight: 700;
}

/* Costs table */
.costs-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
}

.costs-row:last-child { border-bottom: none; }

.costs-row span:last-child {
    font-weight: 600;
    color: var(--ink);
}

/* ============================================
   Contacto Page
   ============================================ */
.contacto-content {
    padding: 80px 0;
    text-align: center;
}

.contacto-cards {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
    margin-top: 48px;
}

.contacto-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    min-width: 280px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s, transform 0.3s;
}

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

.contacto-card svg {
    color: var(--terracotta);
    margin-bottom: 16px;
}

.contacto-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.contacto-card a {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ink);
    transition: color 0.2s;
}

.contacto-card a:hover {
    color: var(--terracotta);
}

.contacto-card p {
    font-size: 14px;
    color: var(--ink-muted);
    margin-top: 8px;
}

/* ============================================
   Lightbox
   ============================================ */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
}

.lightbox-caption {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.8);
    font-size: 15px;
    text-align: center;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--cream);
        flex-direction: column;
        padding: 16px 24px 24px;
        gap: 16px;
        box-shadow: var(--shadow-md);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        color: var(--ink-soft) !important;
        font-size: 16px;
    }

    .hero {
        min-height: 50vh;
    }

    .contact-bar-inner {
        flex-direction: column;
        gap: 24px;
        align-items: center;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 8px;
    }

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

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

    .footer-nav {
        flex-direction: column;
        gap: 12px;
    }
}
