/**
 * ============================================================
 * ApartaRD - CSS Premium MEJORADO v2.0
 * ============================================================
 * Mejoras: Animaciones, transiciones, tipografia, colores,
 * hover effects, secciones mejoradas, micro-interacciones
 */

/* ============================================================
   VARIABLES
   ============================================================ */
:root {
    --primary: #005488;
    --primary-dark: #003d66;
    --primary-light: #0077b6;
    --primary-subtle: #e8f4fc;
    --primary-glow: rgba(0, 84, 136, 0.18);

    --accent: #f77f00;
    --accent-gold: #fbbf24;
    --accent-hover: #e56b00;

    --dark: #0f172a;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --surface: #ffffff;
    --background: #f8fafc;
    --white: #ffffff;
    /* Gray scale variables */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    /* Font size variables (compatibility) */
    --font-size-xs: var(--text-xs);
    --font-size-sm: var(--text-sm);
    --font-size-base: var(--text-base);
    --font-size-lg: var(--text-lg);
    --font-size-xl: var(--text-xl);
    --font-size-2xl: var(--text-2xl);
    --font-size-3xl: var(--text-3xl);
    --font-size-4xl: var(--text-4xl);
    --font-size-5xl: var(--text-5xl);
    /* Shadow variables (compatibility) */
    --shadow: var(--shadow-md);

    --success: #059669;
    --success-soft: #d1fae5;
    --warning: #d97706;
    --warning-soft: #fef3c7;
    --error: #dc2626;
    --error-soft: #fee2e2;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    --text-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.75rem);
    --text-sm: clamp(0.8rem, 0.75rem + 0.25vw, 0.875rem);
    --text-base: clamp(0.9rem, 0.85rem + 0.25vw, 1rem);
    --text-lg: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    --text-xl: clamp(1.15rem, 1rem + 0.5vw, 1.25rem);
    --text-2xl: clamp(1.4rem, 1.2rem + 1vw, 1.75rem);
    --text-3xl: clamp(1.75rem, 1.5rem + 1.25vw, 2.25rem);
    --text-4xl: clamp(2rem, 1.75rem + 1.5vw, 2.75rem);
    --text-5xl: clamp(2.5rem, 2rem + 2vw, 3.5rem);

    --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
    --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem;
    --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;
    --space-16: 4rem; --space-20: 5rem;
    --space-24: 6rem;
    --gutter: clamp(1rem, 4vw, 2rem);

    --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px;
    --radius-xl: 20px; --radius-2xl: 24px; --radius-3xl: 28px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.07), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 56px rgba(0,0,0,0.10), 0 8px 20px rgba(0,0,0,0.05);
    --shadow-2xl: 0 28px 72px rgba(0,0,0,0.14);
    --shadow-primary: 0 6px 24px rgba(0, 84, 136, 0.30);
    --shadow-accent: 0 6px 24px rgba(247, 127, 0, 0.30);

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-normal: 280ms;
    --duration-slow: 400ms;

    --z-dropdown: 1000; --z-sticky: 1020; --z-modal: 1040;
    --glass-bg: rgba(255, 255, 255, 0.92);
    --glass-blur: 24px;
    --transition-fast: 150ms var(--ease-out);
    --transition-normal: 280ms var(--ease-out);
    --transition-slow: 400ms var(--ease-out);
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.65;
    color: var(--text);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

main {
    min-height: calc(100vh - 200px);
}

/* ============================================================
   TIPOGRAFIA
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--dark);
    letter-spacing: -0.02em;
}
h1 { font-size: var(--text-4xl); font-weight: 700; }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
p { margin-bottom: var(--space-4); color: var(--text-secondary); line-height: 1.7; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-dark); }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}
.section { padding: var(--space-16) 0; }
.section-title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--dark);
    margin-bottom: var(--space-3);
    letter-spacing: -0.02em;
}
.section-subtitle {
    font-size: var(--text-base);
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid rgba(226,232,240,0.7);
    transition: box-shadow var(--transition-normal);
}
.header.scrolled {
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    gap: var(--space-6);
}
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--dark);
    transition: opacity var(--transition-fast);
}
.logo:hover { color: var(--dark); opacity: 0.85; }
.logo-icon { font-size: 1.5em; }
.logo-accent { color: var(--primary); }
.nav-menu { display: none; list-style: none; gap: var(--space-1); }
.nav-menu a {
    display: block;
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
}
.nav-menu a:hover {
    color: var(--primary);
    background: var(--primary-subtle);
}
.nav-menu a.active {
    color: var(--primary);
    background: var(--primary-subtle);
    font-weight: 600;
}
.nav-actions { display: none; align-items: center; gap: var(--space-3); }
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}
.nav-toggle:hover { background: var(--border-light); }
.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition-normal);
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 2px solid transparent;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background var(--transition-fast);
}
.btn:hover::after { background: rgba(255,255,255,0.08); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff !important;
    box-shadow: var(--shadow-primary);
}
.btn-primary:hover {
    color: #ffffff !important;
    box-shadow: 0 8px 32px rgba(0, 84, 136, 0.40);
    transform: translateY(-2px);
}
.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-subtle);
}
.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: #ffffff !important;
    box-shadow: var(--shadow-accent);
}
.btn-accent:hover {
    color: #ffffff !important;
    box-shadow: 0 8px 32px rgba(247, 127, 0, 0.40);
}
.btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--text-xs); }
.btn-lg {
    padding: var(--space-4) var(--space-10);
    font-size: var(--text-base);
    border-radius: var(--radius-2xl);
}
.btn-block { width: 100%; }

/* ============================================================
   FORMULARIOS
   ============================================================ */
.form-group { margin-bottom: var(--space-5); }
.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.01em;
}
.form-control {
    width: 100%;
    padding: var(--space-4);
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text);
    background: #ffffff;
    border: 2px solid var(--border);
    border-radius: var(--radius-xl);
    transition: all var(--transition-normal);
    -webkit-appearance: none;
}
.form-control:hover { border-color: var(--primary-light); }
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-4) center;
    padding-right: var(--space-12);
    cursor: pointer;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: #ffffff;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all var(--duration-normal) var(--ease-out);
    border: 1px solid rgba(226,232,240,0.5);
}
.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

/* APARTMENT CARDS */
.apartments-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}
.apartment-card {
    background: #ffffff;
    border-radius: var(--radius-3xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--duration-normal) var(--ease-out);
    border: 1px solid rgba(226,232,240,0.6);
    cursor: pointer;
}
.apartment-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-6px);
    border-color: rgba(0,84,136,0.12);
}
.apartment-card a { display: block; text-decoration: none; color: inherit; }
.apartment-card-image {
    position: relative;
    aspect-ratio: 16 / 11;
    background: var(--background);
    overflow: hidden;
}
.apartment-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-out);
}
.apartment-card:hover .apartment-card-image img { transform: scale(1.08); }
.apartment-card-badge {
    position: absolute;
    top: var(--space-4);
    left: var(--space-4);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(247,127,0,0.35);
    letter-spacing: 0.02em;
}
.apartment-card-wishlist {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    font-size: 1rem;
    backdrop-filter: blur(8px);
}
.apartment-card-wishlist:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}
.apartment-card-content { padding: var(--space-5) var(--space-5) var(--space-5); }
.apartment-card-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-2);
    font-weight: 500;
    letter-spacing: 0.01em;
}
.apartment-card-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--dark);
    margin-bottom: var(--space-3);
    letter-spacing: -0.01em;
    line-height: 1.3;
}
.apartment-card-features {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-light);
}
.apartment-card-feature {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 500;
}
.apartment-card-price {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}
.apartment-card-price span {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--text-muted);
}

/* ============================================================
   HERO - Mejorado con gradiente y animaciones
   ============================================================ */
.hero {
    position: relative;
    padding: var(--space-20) 0 var(--space-24);
    background: linear-gradient(150deg,
        #003d66 0%,
        var(--primary) 40%,
        #006fa8 70%,
        #004a75 100%
    );
    overflow: hidden;
    min-height: 520px;
    display: flex;
    align-items: center;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 70% 50%, rgba(0,119,182,0.25) 0%, transparent 60%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.025'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--background));
    pointer-events: none;
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin-bottom: var(--space-8);
    animation: heroFadeIn 0.8s var(--ease-out) both;
}
@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

/* FORZAR TEXTO BLANCO EN HERO */
.hero h1, .hero h2, .hero h3, .hero h4, .hero h5, .hero h6 { color: #ffffff !important; }
.hero p, .hero span, .hero li, .hero label { color: rgba(255,255,255,0.88) !important; }
.hero h1 span { color: var(--accent-gold) !important; }
.hero .hero-subtitle {
    font-size: var(--text-lg);
    color: rgba(255,255,255,0.80) !important;
    margin-bottom: 0;
    font-weight: 400;
}

/* Search box */
.search-box {
    position: relative;
    z-index: 1;
    background: #ffffff;
    padding: var(--space-6) var(--space-6) var(--space-5);
    border-radius: var(--radius-3xl);
    box-shadow: 0 24px 80px rgba(0,0,0,0.18), 0 8px 24px rgba(0,0,0,0.08);
    animation: heroFadeIn 0.8s 0.15s var(--ease-out) both;
    border: 1px solid rgba(255,255,255,0.9);
}
.search-box h1, .search-box h2, .search-box h3, .search-box h4,
.search-box p, .search-box span, .search-box label, .search-box .form-label {
    color: var(--text) !important;
}
.search-box .form-control { color: var(--text) !important; background: #ffffff !important; }
.search-box-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

/* ============================================================
   STATS - Mejorado
   ============================================================ */
.stats-section {
    background: var(--surface);
    padding: var(--space-10) 0;
    border-bottom: 1px solid var(--border-light);
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
}
.stat-card {
    background: #ffffff;
    padding: var(--space-6) var(--space-5);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-sm);
    text-align: center;
    border: 1px solid var(--border-light);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transform: scaleX(0);
    transition: transform var(--transition-normal);
    transform-origin: left;
}
.stat-card:hover::before { transform: scaleX(1); }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card-value {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: var(--space-2);
}
.stat-card-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    letter-spacing: 0.02em;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--error-soft); color: var(--error); }
.badge-primary { background: var(--primary-subtle); color: var(--primary); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-4);
    border-left: 4px solid;
}
.alert-success { background: var(--success-soft); border-color: var(--success); color: #065f46; }
.alert-error { background: var(--error-soft); border-color: var(--error); color: #991b1b; }
.alert-warning { background: var(--warning-soft); border-color: var(--warning); color: #92400e; }
.alert-close {
    margin-left: auto;
    background: transparent;
    border: none;
    font-size: var(--text-lg);
    cursor: pointer;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}
.alert-close:hover { opacity: 1; }

/* ============================================================
   SECCION COMO FUNCIONA - Mejorada
   ============================================================ */
.how-section {
    background: var(--background);
    position: relative;
}
.how-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}
.how-step {
    background: #ffffff;
    padding: var(--space-8) var(--space-6);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}
.how-step::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-subtle) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}
.how-step:hover::before { opacity: 1; }
.how-step:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.how-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-full);
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    margin: 0 auto var(--space-5);
    box-shadow: var(--shadow-primary);
    position: relative;
    z-index: 1;
}
.how-step h3 {
    position: relative;
    z-index: 1;
    font-size: var(--text-xl);
    margin-bottom: var(--space-3);
}
.how-step p {
    position: relative;
    z-index: 1;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.7;
}

/* ============================================================
   CTA SECTION - Mejorada
   ============================================================ */
.cta-section,
.bg-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 60%, #002d4a 100%);
    position: relative;
    overflow: hidden;
}
.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    pointer-events: none;
}
.cta-section h1, .cta-section h2, .cta-section h3, .cta-section h4,
.cta-section p, .cta-section li, .cta-section span,
.bg-primary h1, .bg-primary h2, .bg-primary h3, .bg-primary h4,
.bg-primary p, .bg-primary li, .bg-primary span {
    color: #ffffff !important;
}
.cta-section ul li { color: rgba(255,255,255,0.9) !important; }
.cta-section ul li::before { color: var(--accent-gold) !important; }
.cta-check-list { list-style: none; padding: 0; }
.cta-check-list li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    color: rgba(255,255,255,0.9) !important;
    font-size: var(--text-base);
}
.cta-check-list li::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    flex-shrink: 0;
    color: #ffffff !important;
}
.cta-building {
    font-size: 100px;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,0.2));
    animation: floatAnim 4s ease-in-out infinite;
}
@keyframes floatAnim {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ============================================================
   FOOTER - Mejorado
   ============================================================ */
.footer {
    background: var(--dark);
    color: rgba(255,255,255,0.7);
    padding: var(--space-16) 0 var(--space-8);
    position: relative;
}
.footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    margin-bottom: var(--space-10);
}
.footer-logo {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    color: #ffffff;
    margin-bottom: var(--space-4);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}
.footer-logo span { color: var(--primary-light); }
.footer-description {
    color: rgba(255,255,255,0.55);
    font-size: var(--text-sm);
    line-height: 1.7;
    margin-bottom: var(--space-5);
}
.footer-col h4 {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-bottom: var(--space-5);
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: var(--space-3); }
.footer-col ul a {
    color: rgba(255,255,255,0.6);
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}
.footer-col ul a:hover {
    color: #ffffff;
    transform: translateX(3px);
}
.footer-social {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-5);
}
.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-lg);
    color: #ffffff;
    font-size: 1.1rem;
    transition: all var(--transition-fast);
    border: 1px solid rgba(255,255,255,0.1);
}
.footer-social a:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,84,136,0.4);
}
.contact-info { list-style: none; }
.contact-info li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: rgba(255,255,255,0.6);
    font-size: var(--text-sm);
    margin-bottom: var(--space-3);
}
.contact-info li span:first-child { font-size: 1rem; }
.footer-bottom {
    padding-top: var(--space-6);
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: var(--text-sm);
    text-align: center;
    color: rgba(255,255,255,0.4);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    align-items: center;
}
.footer-bottom a { color: var(--primary-light); }
.footer-bottom a:hover { color: #ffffff; }

/* ============================================================
   DROPDOWN
   ============================================================ */
.user-dropdown { position: relative; }
.user-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: background var(--transition-fast);
}
.user-btn:hover { background: var(--primary-subtle); }
.user-avatar, .user-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    object-fit: cover;
}
.user-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: var(--text-sm);
}
.user-name { font-size: var(--text-sm); font-weight: 500; color: var(--text); }
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    padding: var(--space-2);
    background: #ffffff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transition: all 0.22s var(--ease-out);
    z-index: var(--z-dropdown);
    pointer-events: none;
}
.user-dropdown:hover .dropdown-menu,
.user-dropdown:focus-within .dropdown-menu,
.user-dropdown.active .dropdown-menu,
.user-dropdown.open .dropdown-menu,
.dropdown-menu.active,
.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--text);
    border-radius: var(--radius-lg);
    transition: background var(--transition-fast);
}
.dropdown-menu a:hover { background: var(--background); color: var(--primary); }
.dropdown-divider { height: 1px; background: var(--border-light); margin: var(--space-2) 0; }
.logout-link { color: var(--error) !important; }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.text-white { color: #ffffff !important; }
.text-primary { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.text-muted { color: var(--text-muted) !important; }
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.mt-auto { margin-top: auto; }

/* Ver todos link */
.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--primary);
    border: 2px solid var(--border);
    border-radius: var(--radius-2xl);
    transition: all var(--transition-normal);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}
.view-all-btn:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
    box-shadow: var(--shadow-primary);
    transform: translateY(-2px);
}

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-header {
    margin-bottom: var(--space-8);
}
.section-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--primary-subtle);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: var(--space-4);
}

/* ============================================================
   RESPONSIVE - Tablet
   ============================================================ */
@media (min-width: 640px) {
    .search-box-grid { grid-template-columns: repeat(2, 1fr); }
    .apartments-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   RESPONSIVE - Desktop
   ============================================================ */
@media (min-width: 1024px) {
    .nav-menu { display: flex; }
    .nav-actions { display: flex; }
    .nav-toggle { display: none; }
    .hero { padding: var(--space-20) 0 var(--space-24); }
    .hero h1 { font-size: var(--text-5xl); }
    .search-box-grid { grid-template-columns: repeat(4, 1fr); }
    .apartments-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
    .how-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}
.fade-in { animation: fadeIn 0.4s var(--ease-out) forwards; }
.fade-in-left { animation: fadeInLeft 0.4s var(--ease-out) forwards; }
.fade-in-right { animation: fadeInRight 0.4s var(--ease-out) forwards; }
.scale-in { animation: scaleIn 0.35s var(--ease-out) forwards; }

/* Stagger children animations */
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 80ms; }
.stagger > *:nth-child(3) { animation-delay: 160ms; }
.stagger > *:nth-child(4) { animation-delay: 240ms; }
.stagger > *:nth-child(5) { animation-delay: 320ms; }
.stagger > *:nth-child(6) { animation-delay: 400ms; }

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--border-light) 25%, var(--background) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}
button:focus-visible, a:focus-visible { outline: 3px solid var(--primary); }

/* Smooth image loading */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Selection color */
::selection {
    background: var(--primary-glow);
    color: var(--primary-dark);
}
/* ============================================================
   BLUE SECTION HEADING FIX - Contraste en secciones azules
   ============================================================ */

/* Forzar texto blanco en secciones con fondo azul */
[class*="-hero"] h1,
[class*="-hero"] h2, 
[class*="-hero"] h3,
[class*="-hero"] h4,
[class*="-hero"] p,
[class*="-hero"] span:not(.logo-accent):not([class*="badge"]):not([class*="tag"]) {
    color: #ffffff !important;
}

/* Secciones con gradient azul - texto blanco */
[class*="-final"] h2,
[class*="-final"] h3,
[class*="-final"] p,
[class*="-coverage"] h2,
[class*="-coverage"] h3,
[class*="-coverage"] p {
    color: #ffffff !important;
}

/* Excepción: spans con gradiente de texto (texto naranja/dorado) */
[class*="-hero"] h1 span[style*="text-fill"],
[class*="-hero"] h1 span[style*="-webkit-text"] {
    color: unset !important;
}

/* Fix para .cta-section y secciones con clase bg-primary */
.cta-section h1, .cta-section h2, .cta-section h3, .cta-section h4,
.cta-section p, .cta-section li, .cta-section label,
.bg-primary h1, .bg-primary h2, .bg-primary h3, .bg-primary h4,
.bg-primary p, .bg-primary li {
    color: #ffffff !important;
}

/* Fix para secciones con inline style de fondo azul/gradiente */
section[style*="linear-gradient"] h1,
section[style*="linear-gradient"] h2,
section[style*="linear-gradient"] h3,
section[style*="linear-gradient"] p,
section[style*="linear-gradient"] li,
section[style*="linear-gradient"] label {
    color: #ffffff !important;
}
