/* ===== VARIABLES ORIGINALES CTP ===== */
:root {
    --ctp-blue: #0a2596;
    --ctp-blue-dark: #051a6e;
    --ctp-blue-light: #1e3bc7;
    --ctp-gold: #f1d229;
    --ctp-gold-light: #f5e066;
    --ctp-gold-dark: #c9a91f;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --shadow-sm: 0 2px 8px rgba(10, 37, 150, 0.08);
    --shadow-md: 0 8px 30px rgba(10, 37, 150, 0.12);
    --shadow-lg: 0 20px 50px rgba(10, 37, 150, 0.15);
    --shadow-xl: 0 30px 80px rgba(10, 37, 150, 0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-100);
    overflow-x: hidden;
}

/* ── Header ── */
.header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.02);
}

.logo img {
    height: 55px;
    width: auto;
    transition: height 0.3s ease;
}

.header.scrolled .logo img {
    height: 48px;
}

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

.nav-menu a {
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 0;
}

.nav-menu a:hover {
    color: var(--ctp-blue);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--ctp-gold), var(--ctp-gold-dark));
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-menu a:hover::after {
    width: 100%;
}

.lang-selector {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid var(--gray-300);
}

.lang-btn {
    background: none;
    border: 2px solid transparent;
    padding: 6px 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    color: var(--gray-500);
    transition: all 0.3s ease;
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
}

.lang-btn:hover {
    color: var(--ctp-blue);
    background: var(--gray-100);
}

.lang-btn.active {
    background: var(--ctp-blue);
    color: var(--white);
    border-color: var(--ctp-blue);
}



/* ===== NUEVA GALERÍA EN GRID (estilo Airbnb/lujo) ===== */
.gallery-section {
    margin-top: 79px;
    background: var(--white);
    padding: 0;
}

.gallery-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 280px 280px;
    gap: 8px;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: var(--gray-100);
}

.gallery-item:first-child {
    grid-row: 1 / 3;
    grid-column: 1 / 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, 0.2) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover::after {
    opacity: 1;
}

.gallery-view-all {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--white);
    color: var(--gray-800);
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    z-index: 10;
    font-family: 'Montserrat', sans-serif;
}

.gallery-view-all:hover {
    background: var(--ctp-blue);
    color: var(--white);
    transform: translateY(-2px);
}

.gallery-placeholder {
    grid-column: 1 / -1;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    gap: 20px;
    min-height: 400px;
    border-radius: var(--radius-xl);
}

.gallery-placeholder-icon {
    font-size: 64px;
    opacity: 0.3;
}

.gallery-placeholder-text {
    color: var(--gray-500);
    font-size: 15px;
    font-weight: 500;
}

.gallery-extra-buttons {
    max-width: 1440px;
    margin: 16px auto 0;
    padding: 0 40px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.gallery-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.3s ease;
}

.gallery-btn-outline:hover {
    background: var(--ctp-blue);
    border-color: var(--ctp-blue);
    color: var(--white);
    transform: translateY(-2px);
}

/* Lightbox Modal */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 80vh;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: var(--white);
    font-size: 40px;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.3s ease;
}

.lightbox-close:hover {
    transform: scale(1.1);
    color: var(--ctp-gold);
}

.lightbox-swiper {
    width: 100%;
    height: 100%;
}

.lightbox-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-swiper .swiper-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.lightbox-swiper .swiper-button-next,
.lightbox-swiper .swiper-button-prev {
    color: var(--white);
    background: rgba(255, 255, 255, 0.2);
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.lightbox-swiper .swiper-button-next:hover,
.lightbox-swiper .swiper-button-prev:hover {
    background: var(--ctp-gold);
    color: var(--ctp-blue-dark);
}

.lightbox-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--white);
    font-size: 14px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 14px;
    border-radius: var(--radius-full);
}

/* ── Page Content ── */
.page-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 50px 30px 100px;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    align-items: start;
}

/* Left column */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 15px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.breadcrumb a {
    color: var(--gray-500);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

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

.breadcrumb span {
    color: var(--gray-400);
}

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

.status-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.badge {
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.badge-type {
    background: linear-gradient(135deg, var(--ctp-gold), var(--ctp-gold-dark));
    color: var(--ctp-blue-dark);
    box-shadow: 0 4px 15px rgba(241, 210, 41, 0.3);
}

.badge-sale {
    background: linear-gradient(135deg, var(--ctp-blue), var(--ctp-blue-light));
    color: var(--white);
}

.badge-rent {
    background: linear-gradient(135deg, #198754, #146c43);
    color: var(--white);
}

.badge-featured {
    background: linear-gradient(135deg, #dc3545, #b02a37);
    color: var(--white);
}

.property-header-block {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
}

.property-price-big {
    font-size: 42px;
    font-weight: 800;
    color: var(--ctp-blue);
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--ctp-blue), var(--ctp-blue-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.property-title-big {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 16px;
}

.property-location-big {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gray-600);
    font-size: 15px;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--gray-200);
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 2px;
    background: var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.stat-item {
    background: var(--white);
    padding: 22px 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--ctp-blue);
    line-height: 1.2;
}

.stat-label {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.detail-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
}

.detail-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ctp-blue);
    margin-bottom: 25px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 12px;
}

.property-description {
    color: var(--gray-600);
    font-size: 15px;
    line-height: 2;
}

.property-description.clamped {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-read-more {
    background: none;
    border: none;
    color: var(--ctp-blue);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

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

.feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
}

.amenities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.amenity-tag {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
}

.map-container {
    height: 350px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--gray-200);
}

/* Sidebar */
.property-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.price-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 35px;
    box-shadow: var(--shadow-lg);
    border-top: 4px solid var(--ctp-gold);
}

.price-card-price {
    font-size: 36px;
    font-weight: 800;
    color: var(--ctp-blue);
}

.sidebar-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 20px 0;
}

.btn-cta-primary,
.btn-cta-whatsapp,
.btn-cta-outline {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    font-weight: 700;
    text-align: center;
    display: block;
    margin-bottom: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-cta-primary {
    background: linear-gradient(135deg, var(--ctp-blue), var(--ctp-blue-light));
    color: var(--white);
}

.btn-cta-whatsapp {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-cta-outline {
    background: none;
    color: var(--ctp-blue);
    border: 2px solid var(--ctp-blue);
}

.agent-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 30px;
    box-shadow: var(--shadow-md);
}

.contact-card {
    background: linear-gradient(135deg, var(--ctp-blue), var(--ctp-blue-dark));
    border-radius: var(--radius-xl);
    padding: 35px;
    color: var(--white);
}

.contact-form-input,
.contact-form-textarea {
    width: 100%;
    padding: 14px;
    margin-bottom: 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-md);
    color: var(--white);
}

.btn-contact-send {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--ctp-gold), var(--ctp-gold-dark));
    color: var(--ctp-blue-dark);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
}

/* Mobile sticky bar */
.mobile-sticky-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 16px 20px;
    z-index: 999;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
}



/* Responsive */
@media (max-width: 1200px) {
    .page-content {
        grid-template-columns: 1fr 360px;
        gap: 30px;
    }

    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 300px 200px 200px;
    }

    .gallery-item:first-child {
        grid-row: 1 / 2;
        grid-column: 1 / 3;
    }
}

@media (max-width: 992px) {
    .page-content {
        grid-template-columns: 1fr;
    }

    .property-sidebar {
        display: none;
    }

    .mobile-sticky-bar {
        display: block;
    }

    .gallery-grid {
        grid-template-rows: 250px 150px;
    }

    .gallery-item:nth-child(3),
    .gallery-item:nth-child(4),
    .gallery-item:nth-child(5) {
        display: none;
    }


}

@media (max-width: 768px) {
    .header-inner {
        padding: 12px 20px;
    }

    .nav-menu {
        display: none;
    }

    .gallery-section {
        margin-top: 74px;
    }

    .gallery-container,
    .gallery-extra-buttons {
        padding-left: 20px;
        padding-right: 20px;
    }

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

    .gallery-item:first-child {
        grid-row: 1;
        grid-column: 1;
    }

    .gallery-item:not(:first-child) {
        display: none;
    }

    .page-content {
        padding: 30px 20px 80px;
    }

    .property-price-big {
        font-size: 32px;
    }

    .property-title-big {
        font-size: 22px;
    }

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



    .lightbox-content {
        width: 95%;
        height: 70vh;
    }
}

/* Dentro de tu <style> */
#map-detail {
    height: 100%;
    width: 100%;
    display: block;
    /* Asegura que no se comporte como inline */
}

.leaflet-container img.leaflet-tile {
    max-width: none !important;
    max-height: none !important;
}

/* Evita que animaciones de entrada afecten al mapa */
.map-container {
    overflow: hidden;
    position: relative;
    background: #f0f0f0;
    /* Color de fondo mientras carga */
}