:root {
    --primary: #0A192F; /* Dark Blue from CM */
    --secondary: #D4AF37; /* Sand/Gold CM Accent */
    --secondary-hover: #F3CA4F;
    --whatsapp: #25D366;
    --phone: #E63946;
    --email: #457B9D;
    --text-main: #F0F4F8;
    --text-muted: #A0ABC0;
    --glass-bg: rgba(10, 25, 47, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08); /* Fainter border for subtle elegance */
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--primary);
    color: var(--text-main);
    overflow-x: hidden;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(15px) brightness(0.18);
    transform: scale(1.1);
}

.app-container {
    max-width: 480px; /* Mobile width constraint on desktop */
    margin: 0 auto;
    min-height: 100vh;
    background: transparent;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    position: relative;
    padding-bottom: 20px;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
}

/* Header */
.profile-header {
    text-align: center;
    border-radius: 0 0 24px 24px;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    border-bottom: 1px solid var(--glass-border);
}

.header-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
    opacity: 0.9; /* Imagen al 90% de opacidad */
}

.header-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Degradado: transparente hasta la mitad, luego funde a oscuro al final */
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 50%,
        rgba(10, 25, 47, 0.85) 80%,
        rgba(10, 25, 47, 0.97) 100%
    );
    z-index: 1;
}

.profile-info {
    position: relative;
    z-index: 2;
    padding: 45px 20px 25px; /* Increased top padding */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Contenedor del logo — resplandor blanco detrás */
.brand-logo-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0;
}
.brand-logo-container::before {
    content: '';
    position: absolute;
    width: 120%;
    height: 200%;
    background: radial-gradient(ellipse at center,
        rgba(255, 255, 255, 0.55) 0%,
        rgba(255, 255, 255, 0.25) 40%,
        transparent 70%
    );
    z-index: 0;
    pointer-events: none;
}

.brand-logo-img {
    height: 65px;
    object-fit: contain;
    margin-bottom: 45px;
    position: relative;
    z-index: 10;
    /* Sin outer glow — el resplandor lo da el ::before del contenedor */
    filter: none;
}

/* --- Pop-Out Profile Picture CSS Trick --- */
.profile-pic-wrapper {
    position: relative;
    width: 140px; /* Base circle size */
    height: 140px;
    margin-bottom: 20px;
}

.profile-pic-inner {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--secondary);
    background: var(--primary);
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
    z-index: 1;
    overflow: hidden; /* crops the lower half of the image nicely inside the circle */
}

/* Same size and position for both images to align perfectly */
.profile-pic-base, .profile-pic-top {
    position: absolute;
    bottom: 0; 
    left: 50%;
    transform: translateX(-50%);
    width: 135%; /* Make him pop! */
    height: 135%; /* Keeping aspect ratio 1:1 for the square image */
    object-fit: cover;
    object-position: bottom;
}

.profile-pic-base {
    z-index: 1;
}

.profile-pic-top {
    z-index: 2;
    /* Clip everything below the midway point so it doesn't cover the bottom circle border */
    /* Syntax: inset(top right bottom left) */
    clip-path: inset(0 0 45% 0);
}

h1 {
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--secondary);
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.title {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 300;
    margin-bottom: 25px;
}

.contact-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.action-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.action-btn:hover {
    transform: translateY(-4px);
    filter: brightness(1.2);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.call { background: linear-gradient(135deg, #FF6B6B, var(--phone)); }
.whatsapp { background: linear-gradient(135deg, #4CD964, var(--whatsapp)); }
.email { background: linear-gradient(135deg, #5AB9EA, var(--email)); }
.linkedin { background: linear-gradient(135deg, #0077b5, #005582); }
.facebook { background: linear-gradient(135deg, #1877F2, #0d5bbd); }
.tiktok  { background: linear-gradient(135deg, #2d2d2d, #010101); }

/* Filters */
.filters-container {
    padding: 0 20px;
    margin-bottom: 25px;
}

.filters {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }

.filter-btn {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--secondary);
    color: var(--primary);
    border-color: var(--secondary);
    font-weight: 500;
}

/* Catalog */
.catalog-grid {
    padding: 0 20px;
    display: grid;
    gap: 20px;
}

.property-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.property-card:hover { 
    transform: translateY(-2px);
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.card-img-container {
    height: 220px;
    position: relative;
    overflow: hidden;
}

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

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

.card-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--secondary);
    color: var(--primary);
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.card-content {
    padding: 20px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: white;
}

.card-price {
    color: var(--secondary);
    font-weight: 600;
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.card-features {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.card-features i {
    color: var(--secondary);
    opacity: 0.8;
}

.card-actions {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--secondary);
}
.btn-outline:hover { 
    background: rgba(212, 175, 55, 0.1); 
    box-shadow: inset 0 0 10px rgba(212, 175, 55, 0.1);
}

.btn-solid {
    background: var(--secondary);
    color: var(--primary);
}
.btn-solid:hover { background: var(--secondary-hover); }

/* Floating Chat */
.floating-chat {
    position: fixed;
    right: 20px;
    bottom: 90px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px 6px 6px;
    border-radius: 30px;
    text-decoration: none;
    color: white;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.25);
    z-index: 100;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}
.floating-chat:hover {
    transform: translateY(-3px) scale(1.02);
}
.floating-chat .chat-icon {
    background: linear-gradient(135deg, #4CD964, var(--whatsapp));
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}
.floating-chat .chat-text { font-size: 0.85rem; font-weight: 400; letter-spacing: 0.3px;}

/* Bottom Nav */
.padding-bottom { height: 90px; }
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; width: 100%;
    background: rgba(5, 13, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex; justify-content: space-around;
    padding: 12px 10px; padding-bottom: calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255,255,255,0.05);
    z-index: 1000;
}
@media (min-width: 480px) {
    .bottom-nav {
        width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }
    .floating-chat {
        /* Align inside the container on desktop */
        right: calc(50% - 220px); 
    }
}

.nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-decoration: none; color: var(--text-muted); font-size: 1.3rem;
    background: none; border: none; cursor: pointer;
    transition: color 0.3s;
    text-align: center;
}
.nav-item span { font-size: 0.65rem; margin-top: 6px; font-weight: 400; letter-spacing: 0.5px;}
.nav-item:hover { color: white; }
.nav-item.active { color: var(--secondary); }
.nav-item.whatsapp-nav { color: var(--whatsapp); }

/* Modals */
.modal {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}
.modal.show { opacity: 1; visibility: visible; }
.modal-content {
    width: 92%; max-width: 420px; max-height: 85vh; overflow-y: auto;
    border-radius: 24px; padding: 25px; position: relative;
    background: rgba(10, 25, 47, 0.95);
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
.modal.show .modal-content {
    transform: translateY(0);
}
.close-modal {
    position: absolute; top: 15px; right: 15px;
    background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); color: white;
    width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    transition: background 0.3s;
    z-index: 10;
}
.close-modal:hover { background: rgba(255,255,255,0.1); }

/* Gallery */
.modal-gallery {
    width: 100%;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    position: relative;
}
.gallery-slide { display: none; }
.gallery-slide.active { display: block; }

.img-wrapper, .svg-wrapper {
    position: relative;
    cursor: zoom-in;
}
.modal-img {
    width: 100%; height: 220px; object-fit: cover;
    display: block;
}
.modal-img.floor-plan {
    object-fit: contain;
    background: rgba(255,255,255,0.03);
    height: 240px;
    padding: 10px;
}
.fullscreen-hint {
    position: absolute;
    bottom: 10px; right: 10px;
    background: rgba(0,0,0,0.6);
    color: rgba(255,255,255,0.8);
    font-size: 0.75rem;
    padding: 5px 10px;
    border-radius: 20px;
    display: flex; align-items: center; gap: 5px;
    pointer-events: none;
}

/* Gallery tabs */
.gallery-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--glass-border);
    overflow-x: auto;
    scrollbar-width: none;
}
.gallery-tabs::-webkit-scrollbar { display: none; }
.gallery-tab {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.gallery-tab.active {
    background: var(--secondary);
    color: var(--primary);
    border-color: var(--secondary);
    font-weight: 600;
}

/* Modal info section */
.modal-info-section {
    padding: 20px 20px 5px;
}
.modal-title { font-size: 1.4rem; font-weight: 500; color: white; margin-bottom: 10px; }
.modal-desc { font-size: 0.95rem; color: var(--text-main); line-height: 1.6; margin-bottom: 25px; font-weight: 300; }

/* Custom Scrollbar for Modal */
.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* ── Terrenos Navigation ─────────────────────────────────────────────────── */
.terr-nav-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 0 16px;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-main);
}
.back-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    color: var(--secondary);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.back-btn:hover { background: rgba(255,255,255,0.12); }

.state-desc-card {
    background: rgba(212,175,55,0.07);
    border: 1px solid rgba(212,175,55,0.2);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.coming-soon-card {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}
.coming-soon-card i { font-size: 2rem; margin-bottom: 12px; opacity: 0.5; display: block; }
.coming-soon-card p { font-size: 1rem; }

/* Development list cards (inside state view) */
.dev-list-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    transition: border-color 0.3s, transform 0.3s;
}
.dev-list-card:hover { border-color: rgba(212,175,55,0.3); transform: translateY(-2px); }

.dev-list-img {
    height: 0;
    padding-bottom: 56.25%; /* 16:9 */
    overflow: hidden;
    position: relative;
    background: #0a1628;
}
.dev-list-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.dev-list-card:hover .dev-list-img img { transform: scale(1.05); }

/* Video embed in modal - full width 16:9 */
.modal-video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 24px 24px 0 0;
}
.modal-video-wrap iframe {
    border-radius: 24px 24px 0 0;
}

/* YouTube lazy-load play button */
.yt-play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.2s;
}
.yt-play-btn:hover, .yt-play-btn:active { transform: translate(-50%, -50%) scale(1.08); }
.yt-play-icon {
    width: 68px; height: 68px;
    background: #ff0000;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 4px 24px rgba(255,0,0,0.45);
}
.yt-play-btn span {
    color: white;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
    text-transform: uppercase;
}

.dev-list-info {
    padding: 16px 16px 18px;
}
.dev-list-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}
.dev-list-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ── Deslinde Table ──────────────────────────────────────────────────────── */
.deslinde-section {
    margin: 0 0 8px;
    padding: 0 20px 20px;
}
.deslinde-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.deslinde-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}
.deslinde-meta strong { color: var(--text-main); }

.deslinde-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    max-height: 260px;
    overflow-y: auto;
}
.deslinde-table-wrap::-webkit-scrollbar { width: 4px; height: 4px; }
.deslinde-table-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.deslinde-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    min-width: 340px;
}
.deslinde-table thead tr {
    background: rgba(212,175,55,0.15);
    position: sticky;
    top: 0;
}
.deslinde-table th {
    padding: 9px 10px;
    text-align: left;
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(212,175,55,0.2);
}
.deslinde-table td {
    padding: 8px 10px;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.deslinde-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }
.deslinde-table tbody tr:hover { background: rgba(212,175,55,0.06); }


/* Ribbon Entregado */
.ribbon-entregado { position: absolute; top: 15px; right: -30px; background: linear-gradient(135deg, #FFD700 0%, #FDB931 100%); color: #000; font-weight: 800; font-size: 0.75rem; padding: 5px 35px; transform: rotate(45deg); box-shadow: 0 4px 10px rgba(0,0,0,0.5); z-index: 10; letter-spacing: 1px; text-transform: uppercase; border: 1px solid rgba(255,255,255,0.5); }
