:root {
    /* Color System - Premium Forest Green & Dark Slate */
    --primary: #1b4332;
    --primary-light: #2d6a4f;
    --primary-hover: #081c15;
    --accent: #40916c;
    --accent-light: #d8f3dc;
    --dark: #0f172a;
    --gray-900: #1e293b;
    --gray-700: #475569;
    --gray-500: #64748b;
    --gray-300: #cbd5e1;
    --gray-100: #f1f5f9;
    --gray-50: #f8fafc;
    --white: #ffffff;

    /* Semantic Colors */
    --whatsapp: #25d366;
    --whatsapp-hover: #128c7e;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 20px -2px rgba(27, 67, 50, 0.08), 0 2px 10px -3px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 30px -4px rgba(27, 67, 50, 0.12), 0 4px 15px -4px rgba(0, 0, 0, 0.06);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

    /* Borders */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--gray-900);
    background-color: var(--gray-50);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--primary);
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

/* --- Header --- */
.main-header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid rgba(27, 67, 50, 0.05);
    padding: 0.75rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.logo-container:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.logo-fallback {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.logo-fallback i {
    font-size: 1.75rem;
    color: var(--accent);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    font-family: inherit;
}

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

.btn-contact:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

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

.btn-whatsapp {
    background-color: var(--whatsapp);
    color: var(--white);
    font-size: 1rem;
    padding: 1rem 2rem;
    width: 100%;
    border-radius: var(--radius-md);
}

.btn-whatsapp:hover {
    background-color: var(--whatsapp-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    background-image: url('img/hero-img.webp');
    background-size: cover;
    background-position: center;
    color: var(--white);
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5rem 0;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(27, 67, 50, 0.85) 0%, rgba(15, 23, 42, 0.9) 100%);
    z-index: 1;
}

.hero-container {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-text {
    text-align: center;
}

.hero-text h2 {
    font-size: 2.75rem;
    color: var(--white);
    margin-bottom: 1rem;
    letter-spacing: -1px;
    text-align: center;
}

.hero-text p {
    color: var(--accent-light);
    font-size: 1.25rem;
    margin-bottom: 3.5rem;
    font-weight: 300;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* Search Bar in Hero */
.hero-search-bar {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    gap: 1.25rem;
    max-width: 850px;
    margin: 0 auto;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    text-align: left;
}

.search-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    gap: 0.5rem;
}

.search-field label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-light);
}

.btn-label-placeholder {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: transparent;
    user-select: none;
}

.search-field select {
    width: 100%;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid transparent;
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--dark);
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='20' height='20'%3E%3Cpath fill='%231b4332' d='M12 16l-6-6h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
    height: 52px;
}

.search-field select:focus {
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(64, 145, 108, 0.4);
}

.btn-search {
    background-color: var(--accent);
    color: var(--white);
    padding: 0.9rem 2.25rem;
    font-size: 1rem;
    font-weight: 700;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    align-self: stretch;
    border: none;
    box-shadow: 0 4px 15px rgba(64, 145, 108, 0.2);
    width: 100%;
}

.btn-search:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 106, 79, 0.3);
}

@media (max-width: 767px) {
    .btn-label-placeholder {
        display: none;
    }
}

@media (min-width: 768px) {
    .hero-search-bar {
        flex-direction: row;
        align-items: flex-end;
        padding: 1.5rem 2.25rem;
    }

    .btn-search {
        margin-bottom: 0;
    }
}

/* --- Results Section --- */
.results-section {
    padding: 4rem 1.5rem 6rem;
    flex: 1;
}

.results-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-300);
    padding-bottom: 1rem;
}

.results-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

/* Fincas Grid */
.fincas-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.finca-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(27, 67, 50, 0.06);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.card-img-container {
    position: relative;
    padding-top: 66.67%;
    /* 3:2 Aspect Ratio */
    background-color: var(--gray-100);
    overflow: hidden;
}

.card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.card-location {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-top: auto;
}

.card-location i {
    color: var(--accent);
    font-size: 1rem;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 5rem 1.5rem;
    background-color: var(--white);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--gray-300);
    max-width: 500px;
    margin: 2rem auto;
}

.empty-state.hidden {
    display: none;
}

.empty-state i {
    font-size: 4rem;
    color: var(--accent-light);
    margin-bottom: 1.5rem;
    display: inline-block;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    font-size: 1.35rem;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

/* --- Detail View --- */
.detail-container {
    padding: 2.5rem 1.5rem 5rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: 2rem;
}

.breadcrumb a {
    color: var(--primary-light);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb i {
    font-size: 0.85rem;
}

.breadcrumb .current {
    color: var(--gray-900);
    font-weight: 600;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

.detail-left,
.detail-right {
    min-width: 0;
}

/* Detail Left (Gallery) */
.gallery-container {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(27, 67, 50, 0.05);
    margin-bottom: 2rem;
    max-width: 100%;
}

.main-image {
    width: 100%;
    max-width: 100%;
    height: 320px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: var(--transition);
}

.main-image:hover {
    filter: brightness(0.95);
}

.thumbnails {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}

.thumb-img {
    width: 90px;
    height: 65px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.65;
    transition: var(--transition);
    flex-shrink: 0;
    scroll-snap-align: start;
}

.thumb-img:hover {
    opacity: 0.9;
}

.thumb-img.active {
    opacity: 1;
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.interest-section {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(27, 67, 50, 0.06);
    text-align: center;
}

.interest-section h3 {
    font-size: 1.35rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
}

/* Detail Right (Info) */
.detail-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    padding: 2.2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(27, 67, 50, 0.06);
    height: 100%;
}

.detail-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    letter-spacing: -0.5px;
    border-bottom: 2px solid var(--accent-light);
    padding-bottom: 1rem;
}

.location-details-box h3 {
    font-size: 1.2rem;
    margin-bottom: 1.25rem;
    color: var(--primary-light);
}

.location-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.location-item:last-child {
    border-bottom: none;
}

.loc-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}

.loc-value {
    font-size: 1.05rem;
    color: var(--gray-900);
}

/* --- Privacy Page --- */
.privacy-container {
    padding: 2.5rem 1.5rem 5rem;
}

.privacy-content {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(27, 67, 50, 0.06);
    max-width: 800px;
    margin: 0 auto;
}

.privacy-content h1 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
}

.privacy-content h2 {
    font-size: 1.35rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.privacy-content p {
    color: var(--gray-700);
    margin-bottom: 1.25rem;
}

.privacy-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--gray-700);
}

.privacy-content li {
    margin-bottom: 0.5rem;
}

/* --- Footer --- */
.main-footer {
    background-color: var(--primary);
    color: rgba(255, 255, 255, 0.75);
    border-top: 4px solid var(--accent);
    padding: 4rem 0 2rem;
    font-size: 0.875rem;
    position: relative;
    z-index: 10;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

.footer-info-block h3,
.footer-links-block h3 {
    color: var(--white);
    font-size: 1.15rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-info-block h3::after,
.footer-links-block h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent);
}

.footer-desc {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.footer-contact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.footer-contact-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-contact-list i {
    color: var(--accent);
    font-size: 1.15rem;
}

.footer-contact-list a:hover {
    color: var(--white);
    text-decoration: underline;
}

.footer-links-block ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links-block a:hover {
    color: var(--white);
    padding-left: 4px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
}

/* --- Lightbox --- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.95);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: var(--transition);
}

.lightbox.hidden {
    opacity: 0;
    pointer-events: none;
}

.lightbox-content {
    max-width: 85%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--white);
    font-size: 2.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-close:hover {
    transform: scale(1.1);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-size: 1.75rem;
    padding: 1rem;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.15);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* --- Media Queries --- */

@media (min-width: 640px) {
    .fincas-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (min-width: 768px) {
    .main-image {
        height: 400px;
    }
}

@media (min-width: 992px) {
    .fincas-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }

    .hero-text h2 {
        font-size: 3.5rem;
    }

    .detail-layout {
        grid-template-columns: 1fr 450px;
        gap: 3.5rem;
        align-items: start;
    }

    .main-image {
        height: 480px;
    }
}

@media (min-width: 1200px) {
    .fincas-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}