/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg: #FAF9F6;
    --color-text: #2C2C2C;
    --color-text-light: #6B6B6B;
    --color-accent: #4A6741;
    --color-accent-light: #5E8353;
    --color-warm: #8B7355;
    --color-cream: #F5F0EB;
    --color-dark: #1A1A1A;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Inter', -apple-system, sans-serif;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.7;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
}

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

.section {
    padding: 120px 0;
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px 0;
    transition: all 0.4s ease;
}

.navbar.scrolled {
    background: rgba(250, 249, 246, 0.95);
    backdrop-filter: blur(20px);
    padding: 12px 0;
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

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

.nav-logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.4s;
}

.navbar.scrolled .nav-logo {
    color: var(--color-text);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 36px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: rgba(255,255,255,0.85);
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    transition: color 0.3s;
}

.navbar.scrolled .nav-links a {
    color: var(--color-text-light);
}

.nav-links a:hover {
    color: white;
}

.navbar.scrolled .nav-links a:hover {
    color: var(--color-text);
}

.nav-cta {
    background: rgba(255,255,255,0.15) !important;
    color: white !important;
    padding: 10px 24px;
    border-radius: 100px;
    border: 1px solid rgba(255,255,255,0.25);
    transition: all 0.3s !important;
}

.navbar.scrolled .nav-cta {
    background: var(--color-accent) !important;
    color: white !important;
    border-color: var(--color-accent) !important;
}

.nav-cta:hover {
    background: rgba(255,255,255,0.25) !important;
}

.navbar.scrolled .nav-cta:hover {
    background: var(--color-accent-light) !important;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 4px;
    margin-left: 12px;
    padding-left: 20px;
    border-left: 1px solid rgba(255,255,255,0.2);
}

.navbar.scrolled .lang-switcher {
    border-left-color: rgba(0,0,0,0.1);
}

.lang-link {
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.05em !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    transition: all 0.3s !important;
    opacity: 0.6;
}

.lang-link.active {
    opacity: 1;
    background: rgba(255,255,255,0.2) !important;
}

.navbar.scrolled .lang-link.active {
    background: var(--color-accent) !important;
    color: white !important;
}

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

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: white;
    transition: all 0.3s;
}

.navbar.scrolled .nav-toggle span {
    background: var(--color-text);
}

/* ===== HERO ===== */
.hero {
    position: relative;
    height: 100vh;
    min-height: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background:
        url('Casa Esterno.jpeg') center center / cover no-repeat;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(139, 115, 85, 0.3) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(74, 103, 65, 0.4) 0%, transparent 60%);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.45) 0%,
        rgba(0,0,0,0.35) 50%,
        rgba(0,0,0,0.55) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 24px;
}

.hero-subtitle {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
    margin-bottom: 24px;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 400;
    color: white;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.hero-location {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.75);
    margin-bottom: 32px;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.hero-price {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: white;
    font-weight: 600;
    margin-bottom: 40px;
    letter-spacing: 0.02em;
}

.hero-btn {
    display: inline-block;
    padding: 16px 40px;
    background: white;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    border-radius: 100px;
    transition: all 0.3s;
}

.hero-btn:hover {
    background: var(--color-cream);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.hero-scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 2;
}

.hero-scroll span {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.8); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* ===== SECTION LABELS & TITLES ===== */
.section-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 16px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 400;
    line-height: 1.15;
    color: var(--color-text);
    margin-bottom: 40px;
    letter-spacing: -0.01em;
}

/* ===== PROPERTY INTRO ===== */
.intro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.intro-description {
    font-size: 1.05rem;
    color: var(--color-text-light);
    margin-bottom: 20px;
    line-height: 1.85;
}

.intro-image {
    position: relative;
}

.intro-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    aspect-ratio: 4/3;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.placeholder-image {
    background: var(--color-cream);
    border-radius: 12px;
    aspect-ratio: 4/3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--color-warm);
    border: 2px dashed rgba(139, 115, 85, 0.2);
    position: relative;
    overflow: hidden;
}

.placeholder-image svg {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

.placeholder-image::after {
    content: attr(data-label);
    font-size: 0.8rem;
    color: var(--color-warm);
    opacity: 0.6;
    font-weight: 400;
}

/* ===== FEATURES ===== */
.features-section {
    background: var(--color-cream);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}

.feature-card {
    text-align: center;
    padding: 40px 20px;
}

.feature-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.feature-icon svg {
    width: 26px;
    height: 26px;
    color: var(--color-accent);
}

.feature-card h3 {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--color-text);
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

.feature-link {
    display: inline-block;
    margin-top: 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-accent);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.3s, transform 0.3s;
}

.feature-link:hover {
    color: var(--color-accent-light);
    transform: translateX(4px);
}

/* ===== DETAILS ===== */
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 48px 60px;
}

.detail-value small {
    display: block;
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-top: 2px;
}

.detail-group h4 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--color-text);
}

.detail-list {
    list-style: none;
}

.detail-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.detail-label {
    font-size: 0.95rem;
    color: var(--color-text-light);
}

.detail-value {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--color-text);
}

.detail-value.highlight {
    color: var(--color-accent);
    font-weight: 600;
    font-size: 1.1rem;
}

/* ===== GALLERY ===== */
.gallery-section {
    background: var(--color-cream);
}

.gallery-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.gallery-tab {
    background: transparent;
    border: 1px solid rgba(0,0,0,0.12);
    padding: 10px 22px;
    border-radius: 100px;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--color-text-light);
    cursor: pointer;
    transition: all 0.3s;
}

.gallery-tab:hover {
    color: var(--color-text);
    border-color: rgba(0,0,0,0.25);
}

.gallery-tab.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}

.gallery-panel {
    display: none;
    animation: fadeIn 0.4s ease;
}

.gallery-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.gallery-grid-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.gallery-item-contain {
    background: white;
    aspect-ratio: 3/4;
    padding: 16px;
}

.gallery-item-contain img {
    object-fit: contain;
}

.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--color-cream);
}

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

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

.gallery-item .placeholder-image {
    aspect-ratio: auto;
    height: 100%;
    border-radius: 12px;
    transition: transform 0.5s ease;
}

.gallery-item:hover .placeholder-image {
    transform: scale(1.02);
}

.gallery-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 80px 24px;
    background: white;
    border-radius: 16px;
    border: 1px dashed rgba(139, 115, 85, 0.25);
    color: var(--color-warm);
    text-align: center;
}

.gallery-empty svg {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

.gallery-empty p {
    font-size: 0.95rem;
    color: var(--color-text-light);
    max-width: 420px;
}

/* ===== LOCATION ===== */
.location-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.location-description {
    font-size: 1.05rem;
    color: var(--color-text-light);
    margin-bottom: 36px;
    line-height: 1.85;
}

.location-highlights {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.location-highlights li {
    padding-left: 20px;
    border-left: 2px solid var(--color-accent);
}

.location-highlights strong {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.location-highlights span {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.map-placeholder {
    aspect-ratio: 1;
    border-radius: 16px;
    position: relative;
}

.map-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-warm);
    opacity: 0.7;
}

/* ===== CTA BANNER ===== */
.cta-banner {
    background: var(--color-dark);
    padding: 100px 0;
    text-align: center;
}

.cta-banner h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    color: white;
    font-weight: 400;
    margin-bottom: 16px;
}

.cta-banner p {
    color: rgba(255,255,255,0.6);
    font-size: 1.05rem;
    margin-bottom: 36px;
}

.cta-banner .hero-btn {
    background: var(--color-accent);
    color: white;
}

.cta-banner .hero-btn:hover {
    background: var(--color-accent-light);
}

/* ===== CONTACT ===== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 80px;
    align-items: start;
}

.contact-info p {
    font-size: 1.05rem;
    color: var(--color-text-light);
    line-height: 1.8;
    margin-bottom: 32px;
}

.contact-detail {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-text-light);
    font-size: 0.95rem;
}

.contact-detail svg {
    color: var(--color-accent);
    flex-shrink: 0;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-light);
}

.form-group input,
.form-group textarea {
    padding: 14px 18px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--color-text);
    background: white;
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(74, 103, 65, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    padding: 16px 40px;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 100px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.3s;
    align-self: flex-start;
}

.submit-btn:hover {
    background: var(--color-accent-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 103, 65, 0.25);
}

.form-success {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 40px;
    background: var(--color-cream);
    border-radius: 16px;
    gap: 16px;
}

.form-success svg {
    color: var(--color-accent);
}

.form-success h3 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 600;
}

.form-success p {
    color: var(--color-text-light);
}

/* ===== LIGHTBOX ===== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: fadeIn 0.25s ease;
}

.lightbox.active {
    display: flex;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 28px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav svg {
    width: 22px;
    height: 22px;
}

.lightbox-prev {
    left: 28px;
}

.lightbox-next {
    right: 28px;
}

.lightbox-counter {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    font-weight: 500;
}

@media (max-width: 640px) {
    .lightbox { padding: 16px; }
    .lightbox-nav { width: 44px; height: 44px; }
    .lightbox-prev { left: 12px; }
    .lightbox-next { right: 12px; }
    .lightbox-close { top: 12px; right: 12px; width: 40px; height: 40px; font-size: 1.6rem; }
}

/* ===== FOOTER ===== */
.footer {
    padding: 60px 0;
    border-top: 1px solid rgba(0,0,0,0.06);
    text-align: center;
}

.footer-logo {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.footer-text {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 16px;
}

.footer-copy {
    font-size: 0.8rem;
    color: rgba(0,0,0,0.3);
}

/* ===== ANIMATIONS ===== */
.animate-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.feature-card.animate-in:nth-child(2) { transition-delay: 0.1s; }
.feature-card.animate-in:nth-child(3) { transition-delay: 0.2s; }
.feature-card.animate-in:nth-child(4) { transition-delay: 0.3s; }

.gallery-item.animate-in:nth-child(2) { transition-delay: 0.1s; }
.gallery-item.animate-in:nth-child(3) { transition-delay: 0.15s; }
.gallery-item.animate-in:nth-child(4) { transition-delay: 0.2s; }
.gallery-item.animate-in:nth-child(5) { transition-delay: 0.25s; }
.gallery-item.animate-in:nth-child(6) { transition-delay: 0.3s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .intro-grid,
    .location-grid,
    .contact-grid {
        gap: 60px;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 80px 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--color-bg);
        flex-direction: column;
        justify-content: center;
        gap: 28px;
        padding: 40px;
        transition: right 0.4s ease;
        box-shadow: -4px 0 30px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        color: var(--color-text) !important;
        font-size: 1.1rem;
    }

    .nav-cta {
        text-align: center;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .intro-grid,
    .details-grid,
    .location-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

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

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

    .gallery-large {
        grid-column: span 2;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .cta-banner {
        padding: 70px 0;
    }

    .hero {
        min-height: 600px;
    }
}

@media (max-width: 480px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

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

    .gallery-large {
        grid-column: span 1;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-price {
        font-size: 1.6rem;
    }
}
