/* =========================================
   VILLA BUJOSA - Luxury Real Estate Website
   Inspired by Elena Argilés Estudio
   ========================================= */

/* CSS Variables */
:root {
    --color-bg: #0a0a0a;
    --color-bg-light: #141414;
    --color-text: #f5f5f5;
    --color-text-muted: #8a8a8a;
    --color-accent: #c9a962;
    --color-accent-light: #e5d4a1;
    --color-white: #ffffff;
    --color-overlay: rgba(10, 10, 10, 0.6);
    
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Montserrat', -apple-system, sans-serif;
    
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* =========================================
   Language Navigation
   ========================================= */
.lang-nav {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: color 0.3s var(--transition-smooth);
}

.lang-btn:hover,
.lang-btn.active {
    color: var(--color-white);
}

.lang-divider {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.75rem;
}

/* =========================================
   Hero Section
   ========================================= */
.hero {
    position: relative;
    height: 100vh;
    min-height: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('images/Bertsch-SP405 Santa Ponsa-3806.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(10, 10, 10, 0.2) 0%,
        rgba(10, 10, 10, 0.4) 50%,
        rgba(10, 10, 10, 0.6) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    animation: fadeInUp 1.2s var(--transition-smooth) forwards;
    opacity: 0;
}

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

.hero-title {
    margin-bottom: 1.5rem;
}

.title-line {
    display: block;
    font-family: var(--font-body);
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.title-line:first-child {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin-bottom: 0.5rem;
    font-weight: 200;
}

.title-line.subtitle {
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: var(--color-text);
    opacity: 0.95;
    font-weight: 300;
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    font-weight: 400;
    letter-spacing: 0.3em;
    color: var(--color-text-muted);
    margin-bottom: 3rem;
    animation: fadeInUp 1.2s var(--transition-smooth) 0.3s forwards;
    opacity: 0;
    text-transform: uppercase;
}

.hero-line {
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    margin: 0 auto 3rem;
    animation: expandWidth 1s var(--transition-smooth) 0.6s forwards;
    transform: scaleX(0);
}

@keyframes expandWidth {
    to {
        transform: scaleX(1);
    }
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 2.5rem;
    background: var(--color-white);
    color: var(--color-bg);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    border: none;
    cursor: pointer;
    transition: all 0.4s var(--transition-smooth);
    animation: fadeInUp 1.2s var(--transition-smooth) 0.9s forwards;
    opacity: 0;
}

.cta-button:hover {
    background: var(--color-accent);
    color: var(--color-bg);
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(201, 169, 98, 0.3);
}

.arrow-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s var(--transition-smooth);
}

.cta-button:hover .arrow-icon {
    transform: translateX(5px);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    animation: fadeInUp 1.2s var(--transition-smooth) 1.2s forwards;
    opacity: 0;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(180deg, var(--color-accent), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

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

/* =========================================
   Main Content
   ========================================= */
.content {
    background: var(--color-bg);
}

.section {
    padding: 8rem 0;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 400;
    letter-spacing: 0.25em;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--color-accent);
}

.detail-title {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 2rem;
}

.detail-title.center {
    text-align: center;
}

/* =========================================
   Philosophy Section
   ========================================= */
.philosophy {
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-light) 100%);
    padding-top: 10rem;
}

.philosophy-text {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.philosophy-text p {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 300;
    font-style: italic;
    line-height: 2;
    color: var(--color-text);
}

/* =========================================
   Villa Intro Section
   ========================================= */
.villa-intro {
    text-align: center;
    padding: 6rem 0;
}

.villa-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--color-accent);
    margin-bottom: 2rem;
}

.villa-badge span {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    color: var(--color-accent);
}

.villa-name {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 300;
    letter-spacing: 0.2em;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--color-white) 0%, var(--color-accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.villa-subtitle {
    max-width: 600px;
    margin: 0 auto;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 300;
    font-style: italic;
    color: var(--color-text-muted);
    line-height: 1.8;
}

/* =========================================
   Featured Image
   ========================================= */
.featured-image {
    width: 100%;
    height: 70vh;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--transition-smooth);
}

.featured-image:hover img {
    transform: scale(1.02);
}

/* =========================================
   Property Details
   ========================================= */
.property-details {
    background: var(--color-bg-light);
}

.details-grid {
    max-width: 900px;
    margin: 0 auto;
}

.detail-block p {
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 2;
    color: var(--color-text);
}

/* =========================================
   Image Row
   ========================================= */
.image-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}

.image-item {
    overflow: hidden;
    aspect-ratio: 4/3;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--transition-smooth);
    cursor: pointer;
}

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

/* =========================================
   Location Section
   ========================================= */
.location {
    background: var(--color-bg);
}

.location-content {
    max-width: 900px;
    margin: 0 auto 4rem;
}

.location-content p {
    font-size: 1.05rem;
    font-weight: 300;
    line-height: 2;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.distance-badges {
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.badge {
    text-align: center;
}

.badge-number {
    display: block;
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 300;
    color: var(--color-accent);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.badge-text {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* =========================================
   Full Width Image
   ========================================= */
.full-image {
    width: 100%;
    height: 80vh;
    overflow: hidden;
}

.full-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================================
   Architecture Section
   ========================================= */
.architecture {
    background: var(--color-bg-light);
}

.architecture-content {
    max-width: 900px;
    margin: 0 auto;
}

.architecture-content p {
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 2;
    color: var(--color-text);
}

/* =========================================
   Image Grid
   ========================================= */
.image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 2px;
}

.grid-item {
    overflow: hidden;
    aspect-ratio: 4/3;
}

.grid-item.large {
    grid-row: span 2;
    aspect-ratio: auto;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--transition-smooth);
    cursor: pointer;
}

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

/* =========================================
   Specifications Section
   ========================================= */
.specifications {
    background: var(--color-bg);
    text-align: center;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.spec-item {
    padding: 2rem;
    border: 1px solid rgba(201, 169, 98, 0.2);
    transition: all 0.3s var(--transition-smooth);
}

.spec-item:hover {
    border-color: var(--color-accent);
    background: rgba(201, 169, 98, 0.05);
}

.spec-number {
    display: block;
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 300;
    color: var(--color-accent);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.spec-label {
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* =========================================
   Interior Section
   ========================================= */
.interior {
    background: var(--color-bg-light);
}

.interior-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.interior-text h4 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--color-accent);
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.interior-text h4:first-child {
    margin-top: 0;
}

.interior-text p {
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.9;
    color: var(--color-text);
}

.interior-image {
    overflow: hidden;
}

.interior-image img {
    width: 100%;
    height: auto;
    transition: transform 0.8s var(--transition-smooth);
}

.interior-image:hover img {
    transform: scale(1.03);
}

/* =========================================
   Interior Gallery (Horizontal Scroll)
   ========================================= */
.interior-gallery {
    padding: 4rem 0;
    background: var(--color-bg);
    overflow: hidden;
}

.gallery-scroll {
    display: flex;
    gap: 1rem;
    padding: 0 2rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.gallery-scroll::-webkit-scrollbar {
    display: none;
}

.gallery-item {
    flex: 0 0 auto;
    width: 400px;
    height: 300px;
    overflow: hidden;
    scroll-snap-align: start;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--transition-smooth);
    cursor: pointer;
}

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

/* =========================================
   Premium Features Section
   ========================================= */
.premium {
    background: var(--color-bg-light);
}

.premium-content {
    max-width: 900px;
    margin: 0 auto 4rem;
}

.premium-content p {
    font-size: 1.05rem;
    font-weight: 300;
    line-height: 2;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.feature-icons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.feature {
    text-align: center;
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-accent);
    border-radius: 50%;
    transition: all 0.3s var(--transition-smooth);
}

.feature:hover .feature-icon {
    background: var(--color-accent);
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    color: var(--color-accent);
    transition: color 0.3s var(--transition-smooth);
}

.feature:hover .feature-icon svg {
    color: var(--color-bg);
}

.feature span {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* =========================================
   Gallery Section (Masonry)
   ========================================= */
.gallery-section {
    background: var(--color-bg);
    padding-bottom: 4rem;
}

.masonry-gallery {
    column-count: 4;
    column-gap: 0.5rem;
    padding: 0 2rem;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s var(--transition-smooth), filter 0.3s;
    cursor: pointer;
}

.masonry-item:hover img {
    transform: scale(1.03);
    filter: brightness(1.1);
}

/* =========================================
   Contact Section
   ========================================= */
.contact {
    background: linear-gradient(180deg, var(--color-bg-light) 0%, var(--color-bg) 100%);
    padding: 10rem 0;
}

.contact-card {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 4rem;
    background: rgba(20, 20, 20, 0.5);
    border: 1px solid rgba(201, 169, 98, 0.2);
}

.architect-info {
    margin-bottom: 3rem;
}

.architect-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.architect-name {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    color: var(--color-white);
    margin-bottom: 0.5rem;
}

.architect-studio {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--color-text-muted);
}

.contact-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.25rem 2rem;
    background: transparent;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    transition: all 0.3s var(--transition-smooth);
}

.contact-btn:hover {
    background: var(--color-accent);
    color: var(--color-bg);
}

.contact-btn.whatsapp:hover {
    background: #25D366;
    border-color: #25D366;
    color: white;
}

.contact-btn svg {
    width: 18px;
    height: 18px;
}

/* =========================================
   Footer
   ========================================= */
.footer {
    background: var(--color-bg);
    padding: 3rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer .container {
    text-align: center;
}

.footer p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
}

/* =========================================
   Lightbox
   ========================================= */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--transition-smooth);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    transform: scale(0.9);
    transition: transform 0.3s var(--transition-smooth);
}

.lightbox.active .lightbox-image {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 2.5rem;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.lightbox-close:hover {
    color: var(--color-accent);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 2rem;
    cursor: pointer;
    padding: 1rem;
    transition: color 0.3s;
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    color: var(--color-accent);
}

/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 1200px) {
    .masonry-gallery {
        column-count: 3;
    }
}

@media (max-width: 992px) {
    .specs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .feature-icons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .interior-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .masonry-gallery {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .lang-nav {
        top: 1rem;
        right: 1rem;
        padding: 0.5rem 1rem;
    }
    
    .hero {
        background-attachment: scroll;
    }
    
    .section {
        padding: 5rem 0;
    }
    
    .image-row {
        grid-template-columns: 1fr;
    }
    
    .image-grid {
        grid-template-columns: 1fr;
    }
    
    .grid-item.large {
        grid-row: span 1;
        aspect-ratio: 4/3;
    }
    
    .distance-badges {
        gap: 2rem;
    }
    
    .badge-number {
        font-size: 2.5rem;
    }
    
    .spec-number {
        font-size: 3rem;
    }
    
    .gallery-item {
        width: 300px;
        height: 225px;
    }
    
    .contact-card {
        padding: 2rem;
    }
    
    .architect-name {
        font-size: 1.8rem;
    }
    
    .masonry-gallery {
        column-count: 2;
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .cta-button {
        padding: 1rem 2rem;
        font-size: 0.8rem;
    }
    
    .specs-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .feature-icons {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    
    .gallery-item {
        width: 280px;
        height: 210px;
    }
    
    .masonry-gallery {
        column-count: 1;
    }
}

/* =========================================
   Animations on Scroll
   ========================================= */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--transition-smooth), transform 0.8s var(--transition-smooth);
}

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

/* Print Styles */
@media print {
    .lang-nav,
    .scroll-indicator,
    .lightbox {
        display: none;
    }
    
    .hero {
        height: auto;
        min-height: auto;
        padding: 4rem 0;
    }
    
    body {
        background: white;
        color: black;
    }
}
