/* =========================================
   CASA AZUL VR EXPERIENCE - INTEGRATED STYLES
   Modern Design with Full Mobile Optimization
   ========================================= */

/* =========================================
   CSS VARIABLES & THEME
   ========================================= */
:root {
    /* Colors */
    --bg-dark: #050505;
    --bg-darker: #000000;
    --glass-bg: rgba(20, 20, 20, 0.90);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-hover: rgba(255, 255, 255, 0.05);
    --glass-blur: 20px;

    /* Primary Colors - Azure Blue Theme */
    --primary: #0EA5E9;
    --primary-hover: #0284C7;
    --primary-light: #38BDF8;
    --accent: #F59E0B;

    /* Text Colors */
    --text-main: #FFFFFF;
    --text-secondary: #B8B8B8;
    --text-muted: #9CA3AF;

    /* Unit Colors */
    --c-1bhk: #10B981;
    /* Emerald Green */
    --c-2bhk-t1: #F59E0B;
    /* Amber Orange */
    --c-2bhk-t2: #3B82F6;
    /* Blue */
    --c-3bhk: #EC4899;
    /* Pink */
    --c-common: #0EA5E9;
    /* Azure */

    /* Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --glow: 0 0 20px rgba(14, 165, 233, 0.3);

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* =========================================
   RESET & BASE STYLES
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    height: 100dvh;
    /* Mobile-optimized viewport height */
    width: 100vw;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    line-height: 1.2;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: 'Outfit', sans-serif;
    transition: var(--transition-fast);
}

/* =========================================
   LOADING SCREEN
   ========================================= */
.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-darker);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    width: 120px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-text {
    color: var(--text-secondary);
    font-size: 14px;
    letter-spacing: 1px;
}

/* =========================================
   BRAND HEADER
   ========================================= */
.brand-header {
    position: absolute;
    left: 20px;
    right: 20px;
    z-index: 5;
    /* Below control panel on desktop */
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    height: 120px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    pointer-events: auto;
}

.brand-logo-left {
    /* YAS logo on extreme left */
}

.brand-logo-right {
    /* Casa Altia logo on extreme right */
}


/* =========================================
   VR VIEWPORT & VIEW LAYERS
   ========================================= */
.vr-viewport {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--bg-darker);
}

.view-layer {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: none;
    /* No transition - instant switch */
}

.view-layer.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Background Render Image */
.bg-render {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* SVG Overlay for Unit Mappings */
.svg-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    /* Above render image */
    pointer-events: none;
    /* Let clicks pass through empty space */
}

.mappings-group {
    pointer-events: none;
    /* Group doesn't block */
}

/* =========================================
   UNIT MAPPINGS (SVG PATHS)
   ========================================= */
.unit-shape {
    fill: rgba(255, 255, 255, 0);
    /* Transparent by default */
    stroke: none;
    cursor: pointer;
    pointer-events: auto !important;
    /* ALWAYS clickable */
    touch-action: manipulation;
    /* Enable touch events on mobile */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    /* Always visible structurally */
}

/* Hover State - Subtle preview (ALWAYS works) */
.unit-shape:hover {
    fill: rgba(14, 165, 233, 0.4) !important;
    /* Azure Blue with higher opacity */
    stroke: #ffffff !important;
    stroke-width: 3px !important;
    cursor: pointer !important;
    filter: drop-shadow(0 0 8px rgba(14, 165, 233, 0.5));
    /* Glow effect */
}

/* Visible State - When filter is active */
.unit-shape.visible {
    fill: rgba(205, 199, 28, 0.301);
    stroke: rgba(255, 255, 255, 0.7);
    stroke-width: 2.5px;
    cursor: pointer;
    pointer-events: auto !important;
}

/* Enhanced Hover on Visible Units */
.unit-shape.visible:hover {
    fill-opacity: 0.5 !important;
    stroke-width: 3px !important;
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.8)) !important;
    cursor: pointer !important;
}

/* Color-Coded Unit Types */
.unit-shape.type-1bhk.visible {
    fill: rgba(16, 185, 129, 0.3);
    stroke: var(--c-1bhk);
}

.unit-shape.type-1bhk.visible:hover {
    fill: rgba(16, 185, 129, 0.5);
    filter: drop-shadow(0 0 16px var(--c-1bhk));
}

.unit-shape.type-2bhk-t1.visible {
    fill: rgba(245, 158, 11, 0.3);
    stroke: var(--c-2bhk-t1);
}

.unit-shape.type-2bhk-t1.visible:hover {
    fill: rgba(245, 158, 11, 0.5);
    filter: drop-shadow(0 0 16px var(--c-2bhk-t1));
}

.unit-shape.type-2bhk-t2.visible {
    fill: rgba(59, 130, 246, 0.3);
    stroke: var(--c-2bhk-t2);
}

.unit-shape.type-2bhk-t2.visible:hover {
    fill: rgba(59, 130, 246, 0.5);
    filter: drop-shadow(0 0 16px var(--c-2bhk-t2));
}

.unit-shape.type-3bhk.visible {
    fill: rgba(236, 72, 153, 0.3);
    stroke: var(--c-3bhk);
}

.unit-shape.type-3bhk.visible:hover {
    fill: rgba(236, 72, 153, 0.5);
    filter: drop-shadow(0 0 16px var(--c-3bhk));
}

.unit-shape.type-common.visible {
    fill: rgba(14, 165, 233, 0.3);
    stroke: var(--c-common);
}

.unit-shape.type-common.visible:hover {
    fill: rgba(14, 165, 233, 0.5);
    filter: drop-shadow(0 0 16px var(--c-common));
}

/* =========================================
   UI INTERFACE
   ========================================= */
.ui-interface {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    /* Allow clicks to pass to VR layer */
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
}

/* =========================================
   CONTROL PANEL (SIDEBAR / BOTTOM SHEET)
   ========================================= */
.control-panel {
    position: absolute;
    top: 30px;
    left: 20px;
    bottom: 20px;
    width: 340px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    transform: translateX(0);
    transition: transform 0.4s var(--ease-out);
    z-index: 20;
    margin-top: 60px;
    /* Space for logo */
}

/* Panel Header */
.panel-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
}

.panel-header h3 {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
}

.panel-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.reset-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
}

.reset-btn:hover {
    background: var(--primary);
    transform: rotate(180deg);
}

/* Scrollable Content */
.scrollable-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.scrollable-content::-webkit-scrollbar {
    width: 4px;
}

.scrollable-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.scrollable-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
}

/* Filter Groups */
.filter-group {
    margin-bottom: 24px;
}

.group-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 600;
}

.group-label i {
    color: var(--primary);
    font-size: 14px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    /* Center align items */
    text-align: center;
    /* Center align text */
}

.contact-link {
    color: #25D366;
    /* WhatsApp Green */
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;
    flex-direction: column;
    /* Icon on top */
    align-items: center;
    justify-content: center;
    /* Ensure content is centered */
    gap: 4px;
    white-space: nowrap;
    /* Prevent text wrapping */
    transition: transform 0.2s ease;
    line-height: 1.2;
}

.contact-link:hover {
    transform: scale(1.05);
}

/* Pill Buttons (Unit Types) */
.pill-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pill-btn {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid var(--glass-border);
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition-normal);
    font-weight: 700;
}

.pill-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.pill-btn.active {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary));
    color: white;
    font-weight: 700;
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.3);
}

.pill-btn.disabled,
.pill-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}

.pill-btn.disabled .dot,
.pill-btn:disabled .dot {
    opacity: 0.4;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.c-1bhk {
    background: var(--c-1bhk);
}

.c-2bhk-t1 {
    background: var(--c-2bhk-t1);
}

.c-2bhk-t2 {
    background: var(--c-2bhk-t2);
}

.c-3bhk {
    background: var(--c-3bhk);
}

.pill-text {
    flex: 1;
}

.pill-count {
    font-size: 11px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-weight: 600;
}

/* Feature Highlight (Casa Azul Series) */
.feature-highlight {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(6, 182, 212, 0.1) 100%);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    transition: var(--transition-normal);
}

.feature-highlight img {
    max-height: 80px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.feature-highlight:hover {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(6, 182, 212, 0.15) 100%);
    border-color: rgba(14, 165, 233, 0.5);
    transform: translateY(-1px);
}

.feature-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon i {
    font-size: 20px;
    color: white;
}

.feature-content h5 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-light);
    letter-spacing: 0.3px;
}

.feature-content p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.pill-btn.active .pill-count {
    background: rgba(255, 255, 255, 0.2);
}

/* Dividers */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
    margin: 20px 0;
}

/* Range Sliders */
.range-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.range-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

.dual-slider {
    position: relative;
    height: 20px;
    margin: 12px 0;
}

.dual-slider input[type=range] {
    position: absolute;
    width: 100%;
    pointer-events: none;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    z-index: 2;
}

.dual-slider input[type=range]::-webkit-slider-thumb {
    pointer-events: auto;
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: var(--transition-fast);
}

.dual-slider input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.1);
}

.dual-slider input[type=range]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.slider-track {
    position: absolute;
    top: 8px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-hover), var(--primary));
    opacity: 0.3;
    border-radius: 2px;
    z-index: 1;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Amenity Grid */
.amenity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.amenity-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 14px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    transition: var(--transition-normal);
    cursor: pointer;
}

.amenity-card i {
    font-size: 20px;
    color: var(--primary);
}

.amenity-card span {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
}

.amenity-card:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.amenity-card.active {
    background: rgba(14, 165, 233, 0.2);
    border-color: var(--primary);
    color: white;
}

.amenity-card.active i {
    color: var(--primary-light);
}

/* Feature Highlight (Plunge Pool Badge) */
.feature-highlight {
    padding: 16px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.feature-content h5 {
    font-size: 13px;
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
}

.feature-content p {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

/* Panel Footer */
.panel-footer {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--glass-border);
}

.stat-box {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    font-family: 'Playfair Display', serif;
}

.stat-desc {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-btn-full {
    display: none;
    /* Hidden on desktop, shown on mobile */
}

/* =========================================
   NAVIGATION CONTROLS
   ========================================= */
.nav-controls {
    position: absolute;
    bottom: 20px;
    right: 125px;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 24px;
    border-radius: 40px;
    z-index: 20;
}

.nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition-normal);
}

.nav-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: var(--glow);
    transform: scale(1.1);
}

.nav-info {
    text-align: center;
}

.nav-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
}

/* =========================================
   HELPER CONTROLS
   ========================================= */
.helper-controls {
    position: absolute;
    bottom: 30px;
    right: 20px;
    z-index: 50;
    /* Increased from 20 to ensure clickability */
    pointer-events: auto;
    /* Enable clicking */
}

.icon-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--primary);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    pointer-events: auto;
    /* Ensure button is clickable */
}

.icon-btn:hover {
    background: var(--primary);
    color: white;
    box-shadow: var(--glow);
    transform: scale(1.1);
}

/* Tooltip */
.tooltip {
    position: absolute;
    bottom: 85px;
    right: 20px;
    width: 260px;
    padding: 16px;
    border-radius: 12px;
    z-index: 25;
    transition: var(--transition-normal);
    pointer-events: auto;
    /* Enable interaction */
}

.tooltip.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
}

.tooltip h4 {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 10px;
}

.tooltip ul {
    list-style: none;
    padding: 0;
}

.tooltip li {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.tooltip li i {
    color: var(--primary);
    font-size: 14px;
    margin-top: 2px;
}

.tooltip strong {
    color: white;
}

/* =========================================
   UNIT POPUP CARD
   ========================================= */
.unit-popup {
    position: absolute;
    top: 90px;
    /* Fixed top position */
    bottom: 40px;
    /* Constrain bottom */
    right: 40px;
    transform: none;
    /* Remove centering transform */
    width: 340px;
    height: auto;
    max-height: calc(100vh - 170px);
    background: #121212;
    border: 1px solid #333;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    z-index: 100;
    transition: 0.3s var(--ease-out);
    display: flex;
    flex-direction: column;
    /* overflow: hidden; Removed to allow body to scroll */
}

.popup-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.popup-body::-webkit-scrollbar {
    width: 4px;
}

.popup-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.popup-body::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
}

.unit-popup.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(20px, -50%);
}

.close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 10;
    transition: var(--transition-fast);
}

.close-popup:hover {
    background: rgba(255, 0, 0, 0.3);
    transform: rotate(90deg);
}

.popup-header {
    padding: 20px;
    border-bottom: 1px solid #333;
}

.popup-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.badge {
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.badge.floor {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.badge.status.available {
    background: rgba(16, 185, 129, 0.2);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.popup-header h2 {
    font-size: 24px;
    margin: 0;
    color: white;
}

.popup-body {
    padding: 20px;
}

.spec-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.spec-item .label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.spec-item .value {
    font-size: 15px;
    font-weight: 600;
    color: white;
}

.spec-item .price {
    color: var(--accent);
    font-size: 16px;
}

.floorplan-container {
    margin-bottom: 20px;
}

.floorplan-container img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #333;
}

.popup-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 20px;
    background: #121212;
    border-top: 1px solid #333;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary));
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-normal);
    grid-column: 1 / -1;
}

.btn-primary:hover {
    box-shadow: var(--glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-normal);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Floor Plan Container */
.floorplan-container {
    width: 100%;
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.floorplan-container img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    display: block;
    opacity: 0;
    /* Hidden by default for JS fade-in */
    transition: opacity 0.3s ease-in-out;
}

/* =========================================
   MOBILE ELEMENTS (Hidden on Desktop)
   ========================================= */
#mobile-filter-btn {
    display: none;
}

.mobile-drag-handle {
    display: none;
}

/* =========================================
   TABLET RESPONSIVE (768px - 1024px)
   ========================================= */
@media (max-width: 1024px) {
    .brand-header {
        top: 20px;
        left: 20px;
        z-index: 15;
        /* Higher on tablet */
    }

    .brand-logo {
        height: 45px;
    }

    .control-panel {
        top: 70px;
        bottom: auto;
        width: 300px;
        max-height: calc(100dvh - 140px);
    }

    .unit-popup {
        width: 320px;
        right: 20px;
    }

    .nav-controls {
        bottom: 20px;
    }

    /* Show mobile filter button on tablet */
    #mobile-filter-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        position: fixed;
        bottom: 20px;
        left: 20px;
        padding: 12px 20px;
        border-radius: 30px;
        background: var(--primary);
        color: white;
        box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
        z-index: 40;
        pointer-events: auto;
        font-weight: 600;
        font-size: 13px;
    }
}

/* =========================================
   MOBILE RESPONSIVE (<768px)
   ========================================= */
@media (max-width: 768px) {

    /* Brand Header */
    .brand-header {
        top: 15px;
        left: 15px;
        z-index: 15;
    }

    .brand-logo {
        height: 50px;
    }

    /* Mobile Filter Button */
    #mobile-filter-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        position: fixed;
        bottom: 20px;
        left: 20px;
        padding: 12px 20px;
        border-radius: 30px;
        background: var(--primary);
        color: white;
        box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
        z-index: 40;
        pointer-events: auto;
        font-weight: 600;
        font-size: 13px;
    }

    #mobile-filter-btn i {
        font-size: 16px;
    }

    /* Bottom Sheet Control Panel */
    .control-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 80dvh;
        margin: 0;
        border-radius: 20px 20px 0 0;
        transform: translateY(110%);
        /* Hidden by default */
        z-index: 50;
        background: #111;
        /* Solid bg for better mobile performance */
        transition: transform 0.4s var(--ease-out);
    }

    .control-panel.open {
        transform: translateY(0);
    }

    /* Mobile Drag Handle */
    .mobile-drag-handle {
        display: block;
        width: 50px;
        height: 5px;
        background: #333;
        border-radius: 3px;
        margin: 12px auto;
        cursor: pointer;
    }

    /* Panel Header Mobile Adjustments */
    .panel-header {
        padding: 10px 20px;
    }

    .panel-header h3 {
        font-size: 14px;
    }

    .panel-subtitle {
        font-size: 11px;
    }

    /* Show action button on mobile */
    .action-btn-full {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 14px;
        background: var(--primary);
        color: white;
        border-radius: 10px;
        font-weight: 600;
        font-size: 14px;
        margin-top: 10px;
        transition: var(--transition-normal);
    }

    .action-btn-full:active {
        transform: scale(0.98);
    }

    /* Navigation Controls */
    .nav-controls {
        bottom: 20px;
        right: 20px;
        left: auto;
        transform: none;
        width: auto;
        padding: 8px 16px;
        gap: 12px;
    }

    .nav-info {
        display: none;
        /* Hide label on mobile */
    }

    .nav-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    /* Helper Controls */
    .helper-controls {
        top: 80px;
        /* Moved down to clear logo */
        right: 15px;
        bottom: auto;
        z-index: 50;
        /* Ensure above everything */
    }

    .icon-btn {
        width: 48px;
        height: 48px;
        pointer-events: auto;
        /* Ensure clickable on mobile */
    }

    .tooltip {
        top: 135px;
        /* Adjusted for new button position */
        right: 15px;
        bottom: auto;
        width: calc(100vw - 30px);
        max-width: 300px;
    }

    /* Unit Popup */
    .unit-popup {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        transform: translateY(100%);
        border-radius: 20px 20px 0 0;
        border: none;
        border-top: 1px solid #333;
        max-height: 85dvh;
        overflow-y: auto;
    }

    .unit-popup.hidden {
        transform: translateY(100%);
    }

    .spec-grid {
        grid-template-columns: 1fr 1fr;
    }

    .spec-item:last-child {
        grid-column: 1 / -1;
        /* Span full width for Price/Contact */
    }

    .popup-actions {
        grid-template-columns: 1fr;
        padding-bottom: 20px;
        /* Safe area for iOS */
    }

    /* Compact Filter Groups */
    .filter-group {
        margin-bottom: 20px;
    }

    .pill-btn {
        padding: 10px 12px;
        font-size: 12px;
    }

    .amenity-card {
        padding: 12px;
    }

    .amenity-card i {
        font-size: 18px;
    }

    .feature-highlight {
        padding: 12px;
    }

    .feature-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .feature-content h5 {
        font-size: 12px;
    }

    .feature-content p {
        font-size: 10px;
    }
}

/* =========================================
   LANDSCAPE MOBILE ADJUSTMENTS
   ========================================= */
@media (max-width: 900px) and (orientation: landscape) {
    .control-panel {
        top: 0;
        bottom: 0;
        left: 0;
        width: 320px;
        height: 100dvh;
        border-radius: 0;
        margin: 0;
        transform: translateX(-100%);
    }

    .control-panel.open {
        transform: translateX(0);
    }

    .mobile-drag-handle {
        display: none;
    }

    .nav-controls {
        bottom: 15px;
        right: 15px;
    }

    .unit-popup {
        width: calc(100% - 30px);
        left: 15px;
        right: 15px;
        bottom: 15px;
        top: auto;
        transform: translateY(0);
        border-radius: 16px 16px 0 0;
        max-height: 80vh;
        z-index: 1000;
        overflow-y: auto;
    }

    .unit-popup.hidden {
        transform: translateY(100%);
        opacity: 0;
    }

    .popup-body {
        max-height: calc(80vh - 120px);
        overflow-y: auto;
    }
}

/* =========================================
   SMALL MOBILE (<480px)
   ========================================= */
@media (max-width: 480px) {
    .brand-logo {
        height: 40px;
    }

    #mobile-filter-btn {
        padding: 10px 16px;
        font-size: 12px;
    }

    .panel-header h3 {
        font-size: 13px;
    }

    .pill-btn {
        font-size: 11px;
        padding: 10px 12px;
    }

    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .popup-header h2 {
        font-size: 20px;
    }
}

/* =========================================
   PERFORMANCE OPTIMIZATIONS
   ========================================= */
.view-layer,
.unit-shape,
.pill-btn,
.amenity-card,
.nav-btn,
.icon-btn {
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Tablet Portrait Fix */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .control-panel {
        display: none;
    }

    #mobile-filter-btn {
        display: flex;
    }
}

.collapse-btn {
    position: absolute;
    top: 22px;
    right: -14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 30;
    transition: var(--transition-normal);
}

.collapse-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
}

/* Rotate View Visibility */
.nav-controls {
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.nav-controls:hover {
    opacity: 1;
}

/* Casa Azul Interactive Button */
.feature-highlight.azul-btn {
    flex-direction: column;
    text-align: center;
    gap: 8px;
    padding-bottom: 12px;
    cursor: pointer;
    border: 1px solid rgba(14, 165, 233, 0.3);
    /* Base border matching feature-highlight default */
    background: transparent;
    transition: all 0.3s ease;
    width: 100%;
}

.feature-highlight.azul-btn img {
    transition: transform 0.3s ease;
}

.feature-highlight.azul-btn:hover {
    border-color: rgba(14, 165, 233, 0.6);
    background: rgba(14, 165, 233, 0.05);
}

.feature-highlight.azul-btn:hover img {
    transform: scale(1.02);
}

.feature-highlight.azul-btn.active {
    border-color: var(--primary);
    background: rgba(14, 165, 233, 0.15);
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.2);
}

.feature-highlight.azul-btn .azul-btn-text span {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: block;
    transition: color 0.3s ease;
}

.feature-highlight.azul-btn:hover .azul-btn-text span,
.feature-highlight.azul-btn.active .azul-btn-text span {
    color: var(--primary-light);
}

/* =========================================
   TOAST NOTIFICATIONS
   ========================================= */
.toast-notification {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(17, 17, 17, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}