/* ==========================================================================
   SISTEMA DE DISEÑO DE AURA REAL ESTATE (INSPIRADO EN COMPASS & ZILLOW)
   ========================================================================== */

/* Variables de Estilo Globales */
:root {
    --primary: #0f2942;
    --primary-dark: #071727;
    --primary-light: #1a4166;
    --gold: #b8975e;
    --gold-light: #cfb384;
    --gold-dark: #997a47;
    
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;
    
    --white: #ffffff;
    --error: #ef4444;
    --success: #10b981;
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-title: 'Outfit', system-ui, -apple-system, sans-serif;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 20px -2px rgba(15, 41, 66, 0.08), 0 2px 8px -1px rgba(15, 41, 66, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(15, 41, 66, 0.12), 0 10px 10px -5px rgba(15, 41, 66, 0.06);
    --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    
    --header-height: 70px;
    --filters-height: 76px;
}

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

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

body {
    font-family: var(--font-sans);
    background-color: var(--white);
    color: var(--slate-800);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Scrollbar estilizada */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--slate-50);
}
::-webkit-scrollbar-thumb {
    background: var(--slate-200);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    color: var(--primary);
    font-weight: 600;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

/* Botones y Elementos Interactivos */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}
.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--gold);
    color: var(--primary);
}
.btn-outline:hover {
    background-color: var(--gold);
    color: var(--white);
}

.btn-light {
    background-color: var(--slate-100);
    color: var(--slate-700);
    border-color: var(--slate-200);
}
.btn-light:hover {
    background-color: var(--slate-200);
}

.btn-icon-text svg {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   SECCIÓN 1: HEADER
   ========================================================================== */
.app-header {
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--slate-100);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1800px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo-icon {
    stroke: var(--gold);
}
.logo-text {
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 2px;
    color: var(--primary);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 32px;
}

.main-nav a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--slate-600);
    position: relative;
    padding: 8px 0;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--gold);
    transition: var(--transition-smooth);
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    color: var(--slate-600);
}
.nav-icon-btn:hover {
    background-color: var(--slate-50);
    color: var(--primary);
}
.nav-icon-btn svg {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   SECCIÓN 2: BARRA DE FILTROS (STICKY)
   ========================================================================== */
.filters-bar {
    height: var(--filters-height);
    background-color: var(--white);
    border-bottom: 1px solid var(--slate-200);
    position: sticky;
    top: var(--header-height);
    z-index: 990;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
}

.filters-container {
    max-width: 1800px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

/* Caja de búsqueda por texto */
.search-input-group {
    flex-grow: 1;
    max-width: 400px;
}
.search-input-group input {
    width: 100%;
    height: 46px;
    padding: 10px 16px 10px 42px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--slate-800);
    background-color: var(--slate-50);
    transition: var(--transition-smooth);
}
.search-input-group input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(15, 41, 66, 0.08);
}
.search-input-group .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--slate-400);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

/* Estilos de Selects */
.filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--slate-500);
    margin-bottom: 4px;
    margin-left: 2px;
}

.filter-group select {
    height: 40px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--primary);
    background-color: var(--white);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    min-width: 140px;
    transition: var(--transition-smooth);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 41, 66, 0.08);
}

#btn-clear-filters {
    height: 40px;
    margin-top: 16px; /* Alinear con los inputs que tienen label */
    align-self: flex-end;
}

/* ==========================================================================
   SECCIÓN 3: LAYOUT PRINCIPAL (LISTADO + MAPA DUAL)
   ========================================================================== */
.main-content {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    height: calc(100vh - var(--header-height) - var(--filters-height));
    overflow: hidden;
}

/* Panel Izquierdo: Tarjetas */
.properties-panel {
    overflow-y: auto;
    padding: 24px;
    background-color: var(--slate-50);
}

.panel-header {
    margin-bottom: 24px;
}
.panel-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}
.properties-count {
    font-size: 0.9rem;
    color: var(--slate-500);
}

/* Grid de tarjetas */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Panel Derecho: Mapa */
.map-panel {
    position: relative;
    height: 100%;
    border-left: 1px solid var(--slate-200);
}
#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Botón flotante para móviles */
.map-toggle-btn {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-full);
    padding: 12px 24px;
    font-weight: 600;
}

/* ==========================================================================
   SECCIÓN 4: TARJETA DE PROPIEDAD (LISTING CARD)
   ========================================================================== */
.property-card {
    background-color: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--slate-100);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--slate-200);
}

.property-card.active-card {
    border: 2px solid var(--gold);
    box-shadow: var(--shadow-lg);
}

/* Galería / Imagen de Tarjeta */
.card-media {
    position: relative;
    width: 100%;
    padding-top: 62%; /* Relación de aspecto ~16:10 */
    overflow: hidden;
    background-color: var(--slate-200);
}
.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.property-card:hover .card-image {
    transform: scale(1.06);
}

/* Elementos flotantes sobre la foto */
.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: rgba(15, 41, 66, 0.85);
    color: var(--white);
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
}
.card-badge.badge-new {
    background-color: rgba(184, 151, 94, 0.95); /* Dorado */
}

.card-fav-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slate-600);
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}
.card-fav-btn:hover {
    background-color: var(--white);
    color: var(--error);
    transform: scale(1.1);
}
.card-fav-btn svg {
    width: 16px;
    height: 16px;
}
.card-fav-btn.is-favorite svg {
    fill: var(--error);
    stroke: var(--error);
}

/* Información de la Tarjeta */
.card-details {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-price {
    font-family: var(--font-title);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.card-specs {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--slate-600);
    margin-bottom: 8px;
    border-bottom: 1px solid var(--slate-100);
    padding-bottom: 8px;
}
.card-specs span {
    display: flex;
    align-items: center;
    gap: 4px;
}
.card-specs svg {
    width: 14px;
    height: 14px;
    color: var(--slate-400);
}

.card-address {
    font-size: 0.85rem;
    color: var(--slate-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 12px;
}

.card-agent-row {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--slate-400);
}
.card-agent {
    display: flex;
    align-items: center;
    gap: 6px;
}
.agent-avatar {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

/* ==========================================================================
   SECCIÓN 5: PERSONALIZACIÓN DEL MAPA (LEAFLET CUSTOMIZATION)
   ========================================================================== */
/* Marcadores de precio flotantes */
.map-price-marker {
    background-color: var(--white);
    color: var(--primary);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-full);
    padding: 4px 10px;
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: var(--shadow-md);
    text-align: center;
    white-space: nowrap;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.map-price-marker::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px 4px 0;
    border-style: solid;
    border-color: var(--white) transparent;
    display: block;
    width: 0;
}

/* Marcador activo en el mapa */
.map-price-marker.marker-active {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    z-index: 1000 !important;
    transform: scale(1.1);
}
.map-price-marker.marker-active::after {
    border-color: var(--primary) transparent;
}

/* Personalización del popup nativo */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-md) !important;
    padding: 0 !important;
    overflow: hidden;
    box-shadow: var(--shadow-lg) !important;
}
.leaflet-popup-content {
    margin: 0 !important;
    width: 220px !important;
}
.leaflet-popup-tip-container {
    display: none; /* Quitamos flechas feas */
}

.map-popup-card {
    display: flex;
    flex-direction: column;
}
.popup-image {
    width: 100%;
    height: 110px;
    object-fit: cover;
}
.popup-info {
    padding: 12px;
}
.popup-price {
    font-family: var(--font-title);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
}
.popup-text {
    font-size: 0.75rem;
    color: var(--slate-500);
}

/* ==========================================================================
   SECCIÓN 6: MODAL DE DETALLE (GLASSMORPHISM & LEAD GENERATION)
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background-color: var(--white);
    width: 90%;
    max-width: 1100px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    overflow-y: auto;
    z-index: 10;
    transform: translateY(30px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal.is-open .modal-content {
    transform: translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background-color: var(--white);
    border: 1px solid var(--slate-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slate-600);
    cursor: pointer;
    z-index: 11;
    transition: var(--transition-smooth);
}
.modal-close-btn:hover {
    background-color: var(--slate-100);
    color: var(--primary);
    transform: rotate(90deg);
}

.modal-body {
    padding: 0;
}

/* Detalle de Propiedad Interno */
.detail-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
}

/* Columna principal izquierda de imágenes de gran formato */
.detail-main {
    padding: 0;
    border-right: 1px solid var(--slate-200);
    overflow: hidden;
}

.detail-gallery {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 24px;
    height: 380px;
}
.detail-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-header {
    margin-bottom: 24px;
}
.detail-price {
    font-family: var(--font-title);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}
.detail-title {
    font-size: 1.2rem;
    color: var(--slate-500);
    font-weight: 400;
}

.detail-quick-specs {
    display: flex;
    gap: 24px;
    padding: 16px 0;
    border-top: 1px solid var(--slate-200);
    border-bottom: 1px solid var(--slate-200);
    margin-bottom: 24px;
}
.detail-quick-specs span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--slate-700);
}
.detail-quick-specs svg {
    color: var(--gold);
    width: 20px;
    height: 20px;
}

.detail-description h2 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}
.detail-description p {
    color: var(--slate-600);
    line-height: 1.7;
    margin-bottom: 24px;
}

/* Formulario lateral de Lead Generation */
.detail-sidebar {
    padding: 40px;
    background-color: var(--slate-50);
    position: sticky;
    top: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.agent-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
}
.agent-photo {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--gold);
}
.agent-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
}
.agent-info p {
    font-size: 0.85rem;
    color: var(--slate-500);
}

.lead-form-title {
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.lead-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    background-color: var(--white);
    transition: var(--transition-smooth);
}
.form-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184, 151, 94, 0.15);
}
.form-textarea {
    resize: none;
    height: 100px;
}

/* ==========================================================================
   SECCIÓN 7: FOOTER
   ========================================================================== */
.app-footer {
    background-color: var(--primary-dark);
    color: var(--slate-400);
    padding: 60px 24px 30px;
    border-top: 1px solid var(--primary-light);
}

.footer-container {
    max-width: 1800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr;
    gap: 48px;
    margin-bottom: 40px;
}

.footer-brand .logo-area {
    margin-bottom: 16px;
}
.footer-brand .logo-text {
    color: var(--white);
}
.brand-tagline {
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 320px;
}

.footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.footer-column h3 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 16px;
}
.footer-column ul {
    list-style: none;
}
.footer-column li {
    margin-bottom: 10px;
}
.footer-column a {
    font-size: 0.85rem;
}
.footer-column a:hover {
    color: var(--gold-light);
}

.footer-newsletter h3 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 16px;
}
.footer-newsletter p {
    font-size: 0.85rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

.newsletter-form {
    display: flex;
    gap: 8px;
}
.newsletter-form input {
    flex-grow: 1;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--primary-light);
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--white);
    font-size: 0.85rem;
}
.newsletter-form input:focus {
    outline: none;
    border-color: var(--gold);
}
.newsletter-form button {
    background-color: var(--gold);
    color: var(--primary-dark);
    font-weight: 600;
}
.newsletter-form button:hover {
    background-color: var(--gold-light);
}

.footer-bottom {
    max-width: 1800px;
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    font-size: 0.8rem;
}

/* ==========================================================================
   RESPONSIVIDAD Y MEDIA QUERIES
   ========================================================================== */

/* Pantallas Medianas (Laptops y Tablets grandes) */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .map-panel {
        display: none; /* Ocultamos por defecto el mapa en móvil */
        height: calc(100vh - var(--header-height) - var(--filters-height));
        position: fixed;
        top: calc(var(--header-height) + var(--filters-height));
        left: 0;
        width: 100%;
        border-left: none;
        z-index: 950;
    }
    
    /* Mostrar panel activo */
    .main-content.show-map .map-panel {
        display: block;
    }
    .main-content.show-map .properties-panel {
        display: none;
    }
    
    .map-toggle-btn {
        display: flex;
    }
    
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    .footer-newsletter {
        grid-column: span 2;
    }
}

/* Tablets y Móviles */
@media (max-width: 768px) {
    .header-container {
        padding: 0 16px;
    }
    .main-nav {
        display: none; /* En producción se crearía un menú hamburguesa */
    }
    .filters-bar {
        height: auto;
        padding: 16px 0;
    }
    .filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 0 16px;
    }
    .search-input-group {
        max-width: 100%;
    }
    .filter-group select {
        width: 100%;
    }
    #btn-clear-filters {
        margin-top: 4px;
        align-self: stretch;
    }
    .main-content {
        height: auto; /* Dejar que fluya en móvil */
    }
    .properties-panel {
        overflow-y: visible;
        height: auto;
        padding: 16px;
    }
    .properties-grid {
        grid-template-columns: 1fr;
    }
    .detail-layout {
        grid-template-columns: 1fr;
    }
    .detail-main {
        padding: 24px;
        border-right: none;
        border-bottom: 1px solid var(--slate-200);
    }
    .detail-gallery {
        height: 240px;
    }
    .detail-sidebar {
        padding: 24px;
    }
    .footer-container {
        grid-template-columns: 1fr;
    }
    .footer-newsletter {
        grid-column: span 1;
    }
    .newsletter-form {
        flex-direction: column;
    }
}

/* ==========================================================================
   SECCIÓN 8: PANEL DE ADMINISTRACIÓN (ADMIN PREMIUM STYLES)
   ========================================================================== */
.admin-body {
    background-color: var(--slate-50);
    min-height: 100vh;
}

.admin-main {
    max-width: 1500px;
    margin: 40px auto;
    padding: 0 24px 60px;
}

.admin-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    flex-wrap: wrap;
    gap: 16px;
}

.admin-dashboard-title h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}
.admin-dashboard-title p {
    color: var(--slate-500);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* Tarjetas de Estadísticas (Dashboard SaaS) */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: var(--white);
    border-radius: var(--radius-md);
    padding: 24px;
    border: 1px solid rgba(15, 41, 66, 0.05);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition-smooth);
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(184, 151, 94, 0.15);
}

.stat-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.stat-icon-wrapper svg {
    width: 24px;
    height: 24px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}
.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--slate-400);
    font-weight: 700;
}
.stat-value {
    font-family: var(--font-title);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: 2px;
    line-height: 1.2;
}

/* Tabla de propiedades (Estilo SaaS Premium) */
.admin-table-container {
    background-color: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid rgba(15, 41, 66, 0.05);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 30px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    background-color: var(--slate-50);
    color: var(--slate-500);
    padding: 18px 24px;
    font-weight: 700;
    border-bottom: 1px solid var(--slate-200);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 1px;
}

.admin-table td {
    padding: 20px 24px;
    border-bottom: 1px solid var(--slate-100);
    vertical-align: middle;
    color: var(--slate-800);
    font-size: 0.92rem;
}

.admin-table tbody tr {
    transition: var(--transition-fast);
}
.admin-table tbody tr:hover {
    background-color: rgba(184, 151, 94, 0.015);
}

.admin-prop-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-prop-thumb {
    width: 76px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    background-color: var(--slate-200);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--slate-100);
}

.admin-prop-title {
    font-weight: 600;
    color: var(--primary);
    font-size: 1rem;
    transition: var(--transition-fast);
}
.admin-table tbody tr:hover .admin-prop-title {
    color: var(--gold);
}

.admin-prop-address {
    font-size: 0.8rem;
    color: var(--slate-400);
    margin-top: 2px;
}

.admin-price-cell {
    font-family: var(--font-title);
    font-weight: 800;
    color: var(--primary);
    font-size: 1.15rem;
}

/* Badges de Tipo de Propiedad */
.prop-type-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.prop-type-badge.type-casa {
    background-color: #fef3c7;
    color: #b45309;
}
.prop-type-badge.type-apartamento {
    background-color: #e0f2fe;
    color: #0369a1;
}
.prop-type-badge.type-villa {
    background-color: #dcfce7;
    color: #15803d;
}
.prop-type-badge.type-townhouse {
    background-color: #f3e8ff;
    color: #6b21a8;
}

.admin-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-edit {
    background-color: var(--slate-100);
    color: var(--slate-700);
    border: 1px solid var(--slate-200);
}
.btn-edit:hover {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-delete {
    background-color: transparent;
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.15);
}
.btn-delete:hover {
    background-color: var(--error);
    color: var(--white);
    border-color: var(--error);
}

/* Modal Administrativo Formulario */
.admin-modal-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--slate-200);
    letter-spacing: -0.5px;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 40px;
}

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

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--slate-500);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.admin-form-map-container {
    margin-top: 14px;
}

.admin-form-map {
    width: 100%;
    height: 280px;
    border-radius: var(--radius-md);
    border: 1px solid var(--slate-200);
    margin-top: 10px;
    z-index: 5;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.map-help-text {
    font-size: 0.82rem;
    color: var(--slate-500);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    background-color: var(--slate-50);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--gold);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 15px;
    padding-top: 24px;
    border-top: 1px solid var(--slate-200);
}

/* Sobrescribir estilos genéricos en inputs del admin form */
.admin-form .form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    background-color: var(--slate-50);
    color: var(--slate-800);
    transition: var(--transition-smooth);
}
.admin-form .form-input:focus {
    outline: none;
    border-color: var(--gold);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(184, 151, 94, 0.15);
}
.admin-form .form-textarea {
    resize: vertical;
    height: 110px;
    line-height: 1.5;
}
.admin-form select.form-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Zona de Carga de Archivos de Imagen */
.file-upload-zone {
    border: 2px dashed var(--slate-200);
    background-color: var(--slate-50);
    border-radius: var(--radius-md);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}
.file-upload-zone:hover {
    border-color: var(--gold);
    background-color: rgba(184, 151, 94, 0.02);
}
.file-upload-zone.dragover {
    border-color: var(--gold-light);
    background-color: rgba(184, 151, 94, 0.05);
}
.image-preview-wrapper {
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    padding: 12px;
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
}

/* Grilla de Miniaturas de Administración */
.admin-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    padding: 12px;
    background-color: var(--slate-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--slate-200);
    max-height: 250px;
    overflow-y: auto;
}

.admin-image-thumb-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-sm);
}

.admin-image-thumb-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-image-thumb-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    background-color: rgba(239, 68, 68, 0.9);
    color: var(--white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    z-index: 10;
}

.admin-image-thumb-delete:hover {
    background-color: var(--error);
    transform: scale(1.1);
}

.admin-image-thumb-delete svg {
    width: 10px;
    height: 10px;
    stroke: var(--white);
    stroke-width: 3px;
}

/* Carrusel de Galería de Imágenes (Vista Cliente) */
.detail-gallery-carousel {
    position: relative;
    width: 100%;
    height: 380px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: var(--slate-900);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.carousel-track-container {
    height: 100%;
    width: 100%;
    position: relative;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 1;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 2;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Botones de Carrusel */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background-color: rgba(15, 41, 66, 0.4);
    border: none;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition-smooth);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.carousel-btn:hover {
    background-color: var(--white);
    color: var(--primary);
    transform: translateY(-50%) scale(1.05);
    box-shadow: var(--shadow-md);
}

.carousel-btn.btn-prev {
    left: 16px;
}

.carousel-btn.btn-next {
    right: 16px;
}

/* Indicadores / Puntos de Página */
.carousel-indicators {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 8px;
    background-color: rgba(15, 41, 66, 0.3);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    border: none;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.carousel-indicator.active {
    background-color: var(--white);
    width: 20px; /* Efecto píldora expansiva */
}

/* Pestañas de Navegación */
.admin-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1.5px solid var(--slate-200);
    margin-bottom: 24px;
    padding-bottom: 4px;
}
.tab-btn {
    padding: 10px 20px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    background: none;
    color: var(--slate-500);
    cursor: pointer;
    transition: var(--transition-smooth);
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tab-btn:hover {
    color: var(--gold);
}
.tab-btn.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

/* Grilla de Brokers */
.admin-brokers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.broker-card {
    background-color: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
}

.broker-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(184, 151, 94, 0.2);
}

.broker-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.broker-card-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--slate-100);
}

.broker-card-meta {
    display: flex;
    flex-direction: column;
}

.broker-card-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.broker-card-role {
    font-size: 0.85rem;
    color: var(--slate-500);
    margin-top: 2px;
}

.broker-card-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: var(--slate-600);
    border-top: 1px solid var(--slate-100);
    padding-top: 16px;
}

.broker-card-details span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.broker-card-details i {
    color: var(--gold);
    width: 16px;
    height: 16px;
}

.broker-card-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.broker-card-actions button {
    flex: 1;
}

/* Subida de Foto Redonda para Brokers */
.broker-avatar-upload-zone {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-full);
    border: 2px dashed var(--slate-300);
    background-color: var(--slate-50);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 auto 16px;
    overflow: hidden;
    position: relative;
    transition: var(--transition-smooth);
}

.broker-avatar-upload-zone:hover {
    border-color: var(--gold);
    background-color: rgba(184, 151, 94, 0.02);
}

.broker-avatar-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.broker-avatar-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--slate-400);
    font-size: 0.7rem;
    font-weight: 500;
}

/* Soporte para Modelos 3D y Realidad Aumentada */
.btn-3d-trigger {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-3d-trigger:hover {
    background-color: var(--gold) !important;
    color: var(--slate-900) !important;
    border-color: var(--gold) !important;
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 20px rgba(184, 151, 94, 0.3) !important;
}

.btn-3d-back {
    transition: all 0.3s ease !important;
}

.btn-3d-back:hover {
    background-color: var(--slate-900) !important;
    color: white !important;
    border-color: var(--slate-900) !important;
    transform: scale(1.03);
}

.file-upload-zone.dragover {
    border-color: var(--gold) !important;
    background-color: rgba(184, 151, 94, 0.05) !important;
}

/* Modal 3D Inmersivo a Pantalla Completa */
.fullscreen-3d-modal {
    animation: fadeInModal 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.btn-3d-close {
    transition: all 0.3s ease !important;
}

.btn-3d-close:hover {
    background-color: var(--slate-800) !important;
    border-color: rgba(255,255,255,0.3) !important;
    transform: scale(1.05);
}

.btn-3d-ar-badge {
    transition: all 0.3s ease !important;
}

.btn-3d-ar-badge:hover {
    background-color: var(--slate-900) !important;
    color: var(--gold) !important;
    border: 1px solid var(--gold) !important;
    box-shadow: 0 12px 35px rgba(184,151,94,0.3) !important;
    transform: translateX(-50%) scale(1.03) !important;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================================================
   DISEÑO INTERACTIVO ESTILO ZILLOW 3D HOME
   ========================================================================== */

/* Modal Principal */
.zillow-3d-modal {
    animation: fadeInModal 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Pestañas de la barra superior */
.zillow-tab-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.zillow-tab-btn:not(.active):hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Botones de acción */
.zillow-action-btn {
    transition: all 0.3s ease !important;
}
.zillow-action-btn:hover {
    background-color: var(--slate-800) !important;
    border-color: var(--gold) !important;
    transform: translateY(-1px);
}
.zillow-close-btn:hover {
    opacity: 1 !important;
    transform: scale(1.05);
}

/* Puntos del Plano Lateral (Dots de Zillow) */
.zillow-map-dot {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.zillow-map-dot:hover {
    r: 10 !important;
    stroke-width: 3px !important;
}
.zillow-map-dot.active {
    filter: drop-shadow(0 0 6px var(--gold));
    animation: dotPulse 2s infinite alternate;
}

@keyframes dotPulse {
    0% {
        r: 8;
        stroke-width: 2px;
    }
    100% {
        r: 10;
        stroke-width: 3.5px;
    }
}

/* Hotspots de model-viewer (Botones flotantes tridimensionales) */
.zillow-hotspot {
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -100%);
    opacity: 0.9;
    transition: opacity 0.3s, transform 0.3s;
}

.zillow-hotspot:hover {
    opacity: 1;
    transform: translate(-50%, -105%) scale(1.08);
}

.zillow-hotspot-circle {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.zillow-hotspot:hover .zillow-hotspot-circle {
    background-color: white !important;
    border-color: var(--gold) !important;
    box-shadow: 0 0 15px var(--gold) !important;
}

.zillow-hotspot-label {
    opacity: 0;
    transform: translateY(4px);
    transition: all 0.3s ease;
}

.zillow-hotspot:hover .zillow-hotspot-label {
    opacity: 1;
    transform: translateY(0);
}

/* ADAPTACIÓN RESPONSIVA */
@media (max-width: 768px) {
    .zillow-body {
        grid-template-columns: 1fr !important;
        grid-template-rows: 1fr auto !important;
    }
    
    .zillow-sidebar-panel {
        border-left: none !important;
        border-top: 1px solid rgba(255,255,255,0.08) !important;
        height: 220px !important;
        padding: 16px !important;
        flex-direction: row !important;
        gap: 16px !important;
    }

    .zillow-sidebar-panel > div {
        flex: 1;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
    }

    .zillow-sidebar-panel > div:last-child {
        display: none !important; /* Ocultar info de agente en móvil para ahorrar espacio */
    }

    .zillow-floorplan-box {
        padding: 10px !important;
    }

    .zillow-floor-svg {
        max-height: 140px;
    }

    .zillow-top-bar {
        padding: 8px 12px !important;
        height: auto !important;
        flex-direction: column !important;
        gap: 8px;
    }

    .zillow-body {
        height: calc(100vh - 100px) !important;
    }
}

/* Botones de Contacto Directo Premium */
.btn-contact-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4) !important;
    filter: brightness(1.05);
}

.btn-contact-whatsapp:active {
    transform: translateY(0);
}

.btn-contact-email:hover {
    background-color: var(--slate-800) !important;
    border-color: var(--slate-700) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15) !important;
}

.btn-contact-email:active {
    transform: translateY(0);
}

/* Pantalla de Inicio / Bienvenida (Welcome Landing Page) */
.welcome-screen {
    box-sizing: border-box;
}

.welcome-card-btn {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.welcome-card-btn:hover {
    transform: translateY(-8px) scale(1.03) !important;
    background: rgba(30, 41, 59, 0.75) !important;
    border-color: var(--gold) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35) !important;
}

.welcome-card-btn:active {
    transform: translateY(-2px) scale(1) !important;
}

/* Animación de Ken Burns para la imagen de fondo de la portada */
@keyframes kenBurnsHero {
    0% {
        transform: scale(1) translate(0, 0);
    }
    50% {
        transform: scale(1.08) translate(-1%, -0.5%);
    }
    100% {
        transform: scale(1.15) translate(1%, 0.5%);
    }
}

/* Animación de entrada de elementos */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-logo, h1, p, .welcome-actions-container {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Modal de Consignación (Venta) */
.welcome-sell-modal {
    animation: fadeInModal 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   SISTEMA DE AUTENTICACIÓN Y GESTIÓN DE USUARIOS (PREMIUM GLASSMORPHISM)
   ========================================================================== */
.login-screen-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgba(15, 41, 66, 1) 0%, rgba(8, 22, 37, 1) 90.1%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-box {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    color: var(--white);
}

.login-logo-area {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-area .logo-icon {
    margin: 0 auto 12px;
}

.login-title {
    font-family: var(--font-title);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--slate-400);
    margin-top: 4px;
}

.login-form .form-label {
    color: var(--slate-300);
    font-size: 0.85rem;
    font-weight: 500;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 14px;
    color: var(--slate-400);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.input-with-icon .form-input {
    padding-left: 44px;
    background-color: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    height: 48px;
    font-size: 0.95rem;
}

.input-with-icon .form-input:focus {
    border-color: var(--gold);
    background-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(184, 151, 94, 0.25);
}

.login-error-message {
    margin-top: 14px;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: shake 0.35s ease;
}

.login-btn {
    height: 48px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background-color: var(--gold-light) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(184, 151, 94, 0.3);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
}
@media (max-width: 768px) {
    .form-row-3 {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Banner de Anuncio Dinámico (Venta/Alquiler) */
.ad-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(15, 41, 66, 0.03) 0%, rgba(184, 151, 94, 0.06) 100%);
    border: 1px solid rgba(184, 151, 94, 0.2);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    gap: 16px;
    animation: fadeInUp 0.5s ease forwards;
}

.ad-banner-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ad-banner-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    background-color: rgba(184, 151, 94, 0.1);
    color: var(--gold);
    flex-shrink: 0;
}

.ad-banner-text h3 {
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.ad-banner-text p {
    font-size: 0.85rem;
    color: var(--slate-600);
    margin: 4px 0 0 0;
    line-height: 1.4;
}

.ad-banner .btn-sm {
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .ad-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 18px;
    }
    .ad-banner-content {
        flex-direction: column;
        gap: 8px;
    }
    .ad-banner-icon {
        margin: 0 auto;
    }
    .ad-banner .btn-sm {
        width: 100%;
        margin-top: 10px;
    }
}

/* ==========================================================================
   OPTIMIZACIONES MÓVILES EXCLUSIVAS (SOCIAL MEDIA & MOBILE LEADS)
   ========================================================================== */

@media (max-width: 768px) {
    .welcome-screen {
        padding: max(20px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)) 16px !important;
        justify-content: center !important;
    }
    
    .welcome-logo {
        margin-bottom: 12px !important;
    }

    .welcome-logo span {
        font-size: clamp(1.8rem, 7vw, 2.4rem) !important;
    }

    .welcome-screen h1 {
        font-size: clamp(1.75rem, 6.5vw, 2.3rem) !important;
        line-height: 1.22 !important;
        margin-bottom: 10px !important;
        padding: 0 8px !important;
    }

    .welcome-screen p {
        font-size: clamp(0.88rem, 3.8vw, 1rem) !important;
        margin-bottom: 24px !important;
        padding: 0 8px !important;
        line-height: 1.5 !important;
    }

    .welcome-actions-container {
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
        max-width: 380px !important;
    }

    .welcome-card-btn {
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px 20px !important;
        flex-direction: row !important;
        align-items: center !important;
        text-align: left !important;
        gap: 16px !important;
        min-height: 70px !important;
        border-radius: var(--radius-md) !important;
        background: rgba(15, 23, 42, 0.65) !important;
        border: 1px solid rgba(255, 255, 255, 0.14) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
    }

    .welcome-card-btn:active {
        transform: scale(0.98) !important;
        background: rgba(30, 41, 59, 0.85) !important;
    }

    .welcome-card-btn > div {
        width: 44px !important;
        height: 44px !important;
        flex-shrink: 0 !important;
    }

    .welcome-card-btn span:first-of-type {
        font-size: 1.15rem !important;
        display: block !important;
    }

    .welcome-card-btn span:last-of-type {
        font-size: 0.78rem !important;
        display: block !important;
        margin-top: 2px !important;
    }

    /* Modal de Consignación en Móvil */
    .welcome-sell-modal > div {
        padding: 24px 20px !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        border-radius: var(--radius-md) !important;
    }

    .welcome-sell-modal h2 {
        font-size: 1.4rem !important;
    }

    .welcome-sell-modal input {
        font-size: 16px !important; /* Previene auto-zoom en iPhone/Android */
        padding: 14px 12px !important;
    }

    /* Ajustes para la grilla de propiedades en móvil */
    .properties-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .property-card {
        border-radius: var(--radius-md) !important;
    }

    .modal-content {
        width: 94% !important;
        padding: 20px !important;
        max-height: 88vh !important;
        overflow-y: auto !important;
    }
}


