:root {
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-text-main: #0f172a;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --color-primary: #1e293b;
    --color-accent: #0284c7;
    --color-badge-bg: #e0f2fe;
    --color-badge-text: #0369a1;
    --color-success-bg: #ecfdf5;
    --color-success-text: #047857;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* Header neutro / Barra superior mínima */
.top-bar {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 40;
}

.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.prop-ref {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.badge-tag {
    padding: 0.25rem 0.65rem;
    background: var(--color-badge-bg);
    color: var(--color-badge-text);
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.top-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-action:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* Titular Principal y Precios */
.header-hero {
    padding: 2rem 0 1.5rem;
}

.header-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.header-title-area {
    flex: 1;
    min-width: 300px;
}

.prop-title {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.25;
    margin-bottom: 0.5rem;
}

.prop-location {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-text-muted);
    font-size: 1rem;
}

.header-price-area {
    text-align: right;
}

.prop-price {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--color-accent);
    line-height: 1.1;
}

.prop-expenses {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* Galería de Fotos */
.gallery-section {
    margin-bottom: 2.5rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 240px 240px;
    gap: 10px;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
}

.gallery-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background: #000;
}

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

.gallery-item:hover img {
    transform: scale(1.03);
    opacity: 0.92;
}

.gallery-item.main-photo {
    grid-row: span 2;
}

.gallery-view-all-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.gallery-view-all-btn:hover {
    background: rgba(15, 23, 42, 1);
}

/* Métricas destacadas / Badges */
.specs-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-sm);
}

.spec-item {
    display: flex;
    flex-direction: column;
}

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

.spec-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-top: 0.15rem;
}

/* Layout de contenido */
.content-layout {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 2.5rem;
    margin-bottom: 3.5rem;
}

.main-column {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.side-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

/* Descripción */
.prop-description {
    font-size: 1.02rem;
    color: #334155;
    white-space: pre-line;
    line-height: 1.75;
}

/* Grilla de Características */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.feature-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: #334155;
}

.feature-pill svg {
    flex-shrink: 0;
    color: var(--color-accent);
}

/* Mapa */
#map-container {
    height: 340px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

/* Tarjeta lateral neutra */
.info-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
}

.info-box h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.info-box p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Lightbox Modal */
.lightbox-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

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

.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Footer Neutro */
.footer-neutral {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 2rem 0;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Toast de enlace copiado */
.toast-notice {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--color-primary);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    display: none;
    z-index: 1000;
}

/* Responsive */
@media (max-width: 900px) {
    .content-layout {
        grid-template-columns: 1fr;
    }
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 280px;
    }
    .gallery-item:not(.main-photo) {
        display: none;
    }
    .header-meta {
        flex-direction: column;
    }
    .header-price-area {
        text-align: left;
    }
}
