@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&family=Outfit:wght@100..900&display=swap');

/* Color Variables and Tokens */
:root {
    /* Brand HSL Colors */
    --brand-green: hsl(100, 62%, 18%);
    --brand-green-hover: hsl(100, 62%, 14%);
    --brand-green-light: hsla(100, 62%, 18%, 0.1);
    
    --brand-orange: hsl(32, 100%, 49%);
    --brand-orange-hover: hsl(32, 100%, 44%);
    --brand-brown: hsl(26, 81%, 31%);
    --brand-beige: hsl(43, 44%, 88%);
    
    /* UI Palette - Charcoal and Premium Glass */
    --ui-bg-dark: hsl(100, 8%, 6%);
    --ui-bg-panel: hsla(100, 8%, 6%, 0.82);
    --ui-bg-card: hsla(43, 44%, 88%, 0.03);
    --ui-border: hsla(43, 44%, 88%, 0.08);
    --ui-border-active: hsla(32, 100%, 49%, 0.4);
    
    /* Texts */
    --text-primary: hsl(43, 44%, 88%);
    --text-secondary: hsl(43, 14%, 72%);
    --text-white: #ffffff;
    --text-dark: hsl(100, 8%, 6%);
    
    /* Status Colors */
    --status-avail: hsl(135, 30%, 50%);
    --status-sold: hsl(3, 53%, 50%);
    
    /* Fonts */
    --font-heading: 'Lora', serif;
    --font-body: 'Outfit', sans-serif;
    
    /* Transitions & Physics */
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-spring: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background-color: var(--ui-bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    letter-spacing: 0.01em;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Main Layout Grid */
#app-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
}

/* Canvas Area */
#canvas-container {
    flex: 1;
    height: 100%;
    position: relative;
    z-index: 1;
    background-image: url('assets/LOTES.png');
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    touch-action: none;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
    touch-action: none;
}

/* Floating Brand Title overlay */
#brand-header {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#brand-header h1 {
    font-size: 1.8rem;
    color: var(--text-white);
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
    letter-spacing: -0.01em;
}

#brand-header p {
    font-size: 0.75rem;
    color: var(--brand-orange);
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Floating Controls (Help, Search, Reset) */
#floating-controls {
    position: absolute;
    bottom: 24px;
    left: 24px;
    z-index: 10;
    display: flex;
    gap: 12px;
}

.floating-btn {
    background: hsla(100, 8%, 6%, 0.85);
    border: 1px solid var(--ui-border);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: var(--transition-smooth);
}

.floating-btn:hover {
    border-color: var(--brand-orange);
    color: var(--text-white);
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.floating-btn:active {
    transform: scale(0.96) translateY(0);
}

/* Glassmorphic Sidebar */
#sidebar {
    width: 420px;
    height: 100%;
    background: var(--ui-bg-panel);
    border-left: 1px solid var(--ui-border);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    z-index: 5;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6), inset 1px 0 0 rgba(255, 255, 255, 0.03);
    transition: var(--transition-smooth);
}

/* Sidebar Sections */
.sidebar-header {
    padding: 28px 24px 20px 24px;
    border-bottom: 1px solid var(--ui-border);
}

.sidebar-header h2 {
    font-size: 1.6rem;
    color: var(--text-white);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.search-box {
    display: flex;
    background: hsla(43, 44%, 88%, 0.03);
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 18px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--brand-orange);
    background: hsla(43, 44%, 88%, 0.05);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 0 3px hsla(32, 100%, 49%, 0.15);
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 14px 16px;
    color: var(--text-white);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.search-box button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0 18px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.search-box button:hover {
    color: var(--brand-orange);
}

/* Inventory filters */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-top: 18px;
}

.filter-tab {
    flex: 1;
    background: hsla(43, 44%, 88%, 0.02);
    border: 1px solid var(--ui-border);
    color: var(--text-secondary);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    transition: var(--transition-fast);
}

.filter-tab:hover {
    color: var(--text-white);
    border-color: var(--ui-border-active);
    background: hsla(43, 44%, 88%, 0.04);
}

.filter-tab.active {
    background: var(--brand-green-light);
    color: var(--brand-orange);
    border-color: var(--brand-orange);
    box-shadow: 0 0 15px hsla(32, 100%, 49%, 0.1);
}

.filter-tab:active {
    transform: scale(0.97);
}

/* Sidebar Scrollable Body */
.sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.sidebar-body::-webkit-scrollbar {
    width: 4px;
}
.sidebar-body::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-body::-webkit-scrollbar-thumb {
    background: hsla(43, 44%, 88%, 0.08);
    border-radius: 10px;
}
.sidebar-body::-webkit-scrollbar-thumb:hover {
    background: hsla(43, 44%, 88%, 0.2);
}

/* Lot Detail Cards */
.info-section {
    background: hsla(43, 44%, 88%, 0.02);
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.02);
    transition: var(--transition-smooth);
}

.info-section.highlighted {
    border-color: var(--brand-orange);
    background: hsla(32, 100%, 49%, 0.02);
    box-shadow: 0 4px 30px hsla(32, 100%, 49%, 0.03), inset 0 1px 0 hsla(32, 100%, 49%, 0.05);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid hsla(43, 44%, 88%, 0.04);
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.detail-value {
    color: var(--text-white);
    font-weight: 600;
    font-size: 0.95rem;
}

.detail-value.status-disponible {
    color: var(--status-avail);
    text-shadow: 0 0 10px hsla(135, 30%, 50%, 0.2);
}

.detail-value.status-vendido {
    color: var(--status-sold);
    text-shadow: 0 0 10px hsla(3, 53%, 50%, 0.2);
}

/* Collapsible Financial Simulator */
.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ui-border);
    transition: var(--transition-fast);
}

.accordion-header:hover h3 {
    color: var(--brand-orange);
}

.accordion-header h3 {
    font-size: 1.1rem;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    letter-spacing: -0.01em;
    transition: var(--transition-fast);
}

.accordion-icon {
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
    color: var(--brand-orange);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.accordion-content.open {
    max-height: 800px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.input-group select, .input-group input {
    background: hsla(43, 44%, 88%, 0.03);
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-white);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: var(--transition-fast);
}

.input-group select:focus, .input-group input:focus {
    border-color: var(--brand-orange);
    background: hsla(43, 44%, 88%, 0.05);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 0 3px hsla(32, 100%, 49%, 0.15);
}

.input-group select option {
    background: var(--ui-bg-dark);
    color: var(--text-white);
}

/* Proforma Calculations Output */
.calc-results {
    background: hsla(100, 62%, 18%, 0.08);
    border: 1px dashed hsla(100, 62%, 18%, 0.4);
    border-radius: 8px;
    padding: 16px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.01);
}

.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.calc-row.total {
    border-top: 1px solid hsla(43, 44%, 88%, 0.06);
    padding-top: 12px;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--brand-orange);
}

/* Sidebar Footer / CTA Button */
.sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--ui-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cta-button {
    background: var(--brand-green);
    color: var(--text-white);
    border: none;
    border-radius: 40px;
    padding: 15px 30px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 25px hsla(100, 62%, 18%, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
    font-family: var(--font-body);
}

.cta-button:hover:not(:disabled) {
    background: var(--brand-green-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 30px hsla(100, 62%, 18%, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.cta-button:active:not(:disabled) {
    transform: scale(0.97) translateY(0);
}

.cta-button:disabled {
    background: hsla(43, 44%, 88%, 0.05);
    color: var(--text-secondary);
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 5, 4, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden; /* animatable to prevent any clicks when closed */
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-container {
    background: var(--ui-bg-panel);
    border: 1px solid var(--ui-border);
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    padding: 36px;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-container {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-white);
}

.modal-container h2 {
    font-size: 1.6rem;
    color: var(--text-white);
    margin-bottom: 12px;
}

.modal-container p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-form button {
    margin-top: 10px;
}

/* Legend Overlay in 3D Scene */
#legend-overlay {
    position: absolute;
    top: 24px;
    right: 444px;
    z-index: 10;
    background: hsla(100, 8%, 6%, 0.85);
    border: 1px solid var(--ui-border);
    border-radius: 40px;
    padding: 10px 24px;
    display: flex;
    gap: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-color.disponible {
    background: var(--status-avail);
    box-shadow: 0 0 10px hsla(135, 30%, 50%, 0.6);
}

.legend-color.vendido {
    background: var(--status-sold);
    box-shadow: 0 0 10px hsla(3, 53%, 50%, 0.6);
}

.legend-color.seleccionado {
    background: var(--brand-orange);
    box-shadow: 0 0 10px hsla(32, 100%, 49%, 0.6);
}

/* Loader Overlay */
#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--ui-bg-dark);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 2px solid hsla(43, 44%, 88%, 0.05);
    border-top-color: var(--brand-orange);
    border-radius: 50%;
    animation: spin 1s infinite cubic-bezier(0.55, 0.055, 0.675, 0.19);
}

#loader-overlay p {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-family: var(--font-heading);
    letter-spacing: 0.02em;
}

/* Tooltip */
.three-tooltip {
    position: absolute;
    z-index: 50;
    background: hsla(100, 8%, 6%, 0.95);
    border: 1px solid var(--brand-orange);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-white);
    font-size: 0.8rem;
    pointer-events: none;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
    display: none;
    transform: translate(-50%, -100%) translateY(-10px);
    transition: opacity 0.15s ease;
}

.three-tooltip h4 {
    margin-bottom: 4px;
    font-weight: 700;
    color: var(--brand-orange);
    letter-spacing: -0.01em;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    #app-container {
        flex-direction: column-reverse;
    }
    
    #sidebar {
        width: 100%;
        height: 60%;
        border-left: none;
        border-top: 1px solid var(--ui-border);
    }
    
    #legend-overlay {
        right: 20px;
        top: auto;
        bottom: 20px;
        font-size: 0.75rem;
        padding: 8px 12px;
        gap: 12px;
    }
    
    #floating-controls {
        top: 20px;
        bottom: auto;
        left: auto;
        right: 20px;
    }
    
    #brand-header h1 {
        font-size: 1.4rem;
    }
    
    #brand-header p {
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    #sidebar {
        height: 50%;
    }
    
    .sidebar-header {
        padding: 16px;
    }
    
    .sidebar-body {
        padding: 16px;
        gap: 15px;
    }
    
    .sidebar-footer {
        padding: 16px;
    }
    
    #legend-overlay {
        display: none; /* Hide on small screens to save space */
    }
    
    #floating-controls {
        display: flex;
        flex-direction: column;
        gap: 8px;
        top: 80px; /* Below the brand header */
        right: 16px;
        bottom: auto;
        left: auto;
        z-index: 100;
    }
    
    .floating-btn {
        padding: 8px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    }
    
    .floating-btn .btn-text {
        display: none; /* Hide text on mobile */
    }
    
    .floating-btn .icon {
        margin: 0; /* Center the icon */
    }
}

/* Amenity Modal Custom Styling */
.amenity-modal-container {
    max-width: 600px;
    background: rgba(18, 22, 16, 0.95);
    border: 1px solid rgba(252, 134, 0, 0.3);
}

.amenity-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

/* Media Gallery for Amenities */
.amenity-media-gallery {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--brand-orange) rgba(255, 255, 255, 0.05);
}

.amenity-media-gallery::-webkit-scrollbar {
    height: 6px;
}

.amenity-media-gallery::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.amenity-media-gallery::-webkit-scrollbar-thumb {
    background: var(--brand-orange);
    border-radius: 3px;
}

.amenity-media-item {
    flex: 0 0 100%;
    scroll-snap-align: start;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--ui-border);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* support absolute children like zoom buttons */
}

.amenity-media-item img {
    width: 100%;
    height: auto;
    max-height: 340px;
    object-fit: contain;
    border-radius: 8px;
}

.amenity-media-item video {
    width: 100%;
    height: auto;
    max-height: 340px;
    object-fit: contain;
    border-radius: 8px;
    /* Force high-quality hardware accelerated scaling to prevent pixelation/aliasing */
    transform: translate3d(0, 0, 0);
    filter: blur(0px); /* forces browser to use higher quality filter pipeline */
    image-rendering: -webkit-optimize-contrast;
}

/* Amenity Labels HTML Overlay Styling */
.amenity-label-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none; /* Let parent container be unclickable */
    z-index: 10;
}

.amenity-label {
    background: rgba(18, 22, 16, 0.85); /* brand charcoal */
    border: 1px solid var(--ui-border);
    color: var(--text-primary);
    border-radius: 16px;
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: normal; /* allow wrapping on two lines */
    text-align: center; /* center text */
    line-height: 1.3;
    max-width: 150px;
    pointer-events: auto; /* make label itself clickable */
    user-select: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}

.amenity-label.clickable {
    font-size: 0.62rem;
    padding: 5px 10px;
    cursor: pointer;
    border-color: rgba(252, 134, 0, 0.35); /* brand orange outline */
}

.amenity-label.clickable:hover {
    border-color: var(--brand-orange);
    background: var(--brand-green-hover);
    color: var(--text-white);
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(252, 134, 0, 0.4);
}

.amenity-label.static {
    border-color: rgba(241, 230, 203, 0.1);
    background: rgba(18, 22, 16, 0.6);
    color: var(--text-secondary);
    opacity: 0.8;
    font-size: 0.52rem;
    padding: 3px 6px;
    letter-spacing: 0.5px;
}

/* Media zoom button styling */
.media-zoom-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(18, 22, 16, 0.8);
    border: 1px solid var(--ui-border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: auto;
    z-index: 15;
    user-select: none;
}

.media-zoom-btn:hover {
    background: var(--brand-orange);
    border-color: var(--brand-orange);
    color: var(--text-white);
    transform: scale(1.05);
}

/* Lightbox Navigation Buttons */
.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(18, 22, 16, 0.6);
    border: 1px solid var(--ui-border);
    color: var(--text-primary);
    width: 55px;
    height: 55px;
    border-radius: 50%;
    font-size: 1.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
    z-index: 260;
    user-select: none;
    outline: none;
}

.lightbox-nav-btn:hover {
    background: var(--brand-orange);
    border-color: var(--brand-orange);
    color: var(--text-white);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(252, 134, 0, 0.3);
}

.lightbox-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* ==========================================
   Corporate Logos Panel (MADI, URBINA, NATIVO)
   ========================================== */
.logos-card {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.88); /* Translucent white/beige glass for high contrast with dark logos */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
}

.logo-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.logo-label {
    font-size: 8.5px;
    font-weight: 700;
    color: #4b5247; /* Elegant dark grey-green matching brand tones */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-family: var(--font-body);
}

.logo-img {
    height: 45px;
    max-width: 110px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.05));
    transition: var(--transition-fast);
}

.logo-img:hover {
    transform: scale(1.05);
}

/* Add dividing lines between logo columns */
.logo-column:not(:last-child) {
    position: relative;
    padding-right: 16px;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

/* Responsiveness overrides for Logos */
@media (max-width: 1024px) {
    .logos-card {
        right: auto;
        left: 20px;
        bottom: 20px;
    }
}

@media (max-width: 768px) {
    .logos-card {
        padding: 6px 10px;
        gap: 10px;
        bottom: 15px;
        left: 15px;
    }
    .logo-column:not(:last-child) {
        padding-right: 10px;
    }
    .logo-label {
        font-size: 7px;
        margin-bottom: 4px;
    }
    .logo-img {
        height: 28px;
        max-width: 70px;
    }
}

/* ==========================================
   Modal Visor 360 Custom Styling
   ========================================== */
.modal-container-360 {
    background: #000;
    border: 1px solid var(--ui-border);
    border-radius: 16px;
    width: 95vw;
    height: 90vh;
    max-width: 1200px;
    padding: 0;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.modal-overlay.open .modal-container-360 {
    transform: translateY(0);
}

#pano-viewer-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    cursor: grab;
    touch-action: none;
}

#pano-viewer-container:active {
    cursor: grabbing;
}

/* Panoramic Controls Overlay */
.pano-controls-overlay {
    position: absolute;
    bottom: 24px;
    left: 24px;
    z-index: 310;
    background: rgba(18, 22, 16, 0.85); /* brand charcoal */
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.pano-controls-overlay h2 {
    font-size: 1.3rem;
    color: var(--text-white);
    margin-bottom: 6px;
    font-family: var(--font-heading);
}

.pano-controls-overlay p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.pano-btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pano-control-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--ui-border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.pano-control-btn:hover {
    background: var(--brand-orange);
    border-color: var(--brand-orange);
    color: var(--text-white);
}

@media (max-width: 768px) {
    .modal-container-360 {
        width: 100vw;
        height: 100dvh; /* dynamic height to avoid safari address bar issue */
        border-radius: 0;
    }
    .pano-controls-overlay {
        bottom: 15px;
        left: 15px;
        right: 15px;
        max-width: none;
        padding: 12px 16px;
    }
    .pano-controls-overlay h2 {
        font-size: 1.05rem;
        margin-bottom: 4px;
    }
    .pano-controls-overlay p {
        font-size: 0.75rem;
        margin-bottom: 8px;
        line-height: 1.3;
    }
    .pano-control-btn {
        padding: 6px 12px;
        font-size: 0.7rem;
        border-radius: 15px;
    }
}

#btn-close-360 {
    z-index: 320 !important;
    color: #fff;
    font-size: 2.2rem;
    right: 25px;
    top: 25px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    opacity: 0.8;
}

#btn-close-360:hover {
    opacity: 1;
    transform: scale(1.1);
}
