/* ========================================
   370 Queens Quay - Apartment Listings ONLY CSS
   DUPLICATES REMOVED - Use with styles.css
   ======================================== */

/* ==================================================
   APARTMENT-SPECIFIC MAIN CONTENT & FILTERS
   ================================================== */

/* Main Content - Apartment Page Specific Overrides */
.main-content {
    padding: 60px 0;
    margin-top: 30px; 
}

/* Page Title Section */
.page-title {
    text-align: center;
    margin-bottom: 60px;
}

/* APARTMENT FILTERING SYSTEM */
.filters-container {
    background: var(--warm-white);
    scroll-margin-top: 20px;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    align-items: start;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--charcoal);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    min-height: 20px;
}

.form-input {
    width: 100%;
    padding: 12px 12px;
    background: var(--warm-white);
    border: 1px solid var(--silver);
    border-radius: 0;
    font-size: 15px;
    transition: all 0.3s ease;
    color: var(--charcoal);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 2px rgba(201, 169, 97, 0.1);
}

/* Range Slider Styles */
.range-container {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.range-slider {
    position: relative;
    height: 15px;    
}

.range-slider input[type="range"] {
    position: absolute;
    width: 100%;
    height: 8px;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    pointer-events: auto;
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--primary-gold);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.range-slider input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    -moz-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--primary-gold);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.slider-track {
    position: absolute;
    top: 8px;
    height: 8px;
    background: var(--silver);
    border-radius: 4px;
    width: 100%;
}

.slider-range {
    position: absolute;
    top: 8px;
    height: 8px;
    background: var(--primary-gold);
    border-radius: 4px;
}

.range-values {
    font-size: 13px;
    color: var(--charcoal);
    text-align: center;
    font-weight: 500;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 0;
}

.checkbox-item {
    display: flex;
    align-items: center;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    accent-color: var(--primary-gold);
}

.checkbox-item label {
    font-size: 14px;
    color: var(--charcoal);
    cursor: pointer;
}

.clear-filters-btn {
    background: transparent;
    color: var(--primary-gold);
    border: 2px solid var(--primary-gold);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.clear-filters-btn:hover {
    background: var(--primary-gold);
    color: var(--warm-white);
}

/* ===============================================
   APARTMENT RESULTS & VIEW CONTROLS
   =============================================== */

.results-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 0 10px;
}

.results-count {
    font-size: 16px;
    color: var(--charcoal);
    opacity: 0.8;
}

.view-toggle {
    display: flex;
    gap: 10px;
}

.view-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--silver);
    color: var(--charcoal);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn.active {
    background: var(--primary-gold);
    color: var(--warm-white);
    border-color: var(--primary-gold);
}

.view-btn:hover:not(.active) {
    border-color: var(--primary-gold);
    color: var(--primary-gold);
}

/* =====================================
   FLOOR VIEW APARTMENT LAYOUT
   ===================================== */

.floor-view {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.floor-section {
    background: var(--warm-white);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.floor-header {
    background: var(--pearl);
    padding: 25px 30px;
    border-bottom: 1px solid var(--silver);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.floor-header:hover {
    background: var(--silver);
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.floor-title {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 500;
    color: var(--deep-navy);
}

.floor-stats {
    display: flex;
    gap: 5px;
    font-size: 14px;
    color: var(--charcoal);
    opacity: 0.8;
}

.floor-toggle {
    font-size: 20px;
    color: var(--primary-gold);
    transition: transform 0.3s ease;
}

.floor-section.collapsed .floor-toggle {
    transform: rotate(-90deg);
}

.floor-units {
    padding: 0;
    max-height: none;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.floor-section.collapsed .floor-units {
    max-height: 0;
}

/* Desktop-only height limitation for performance */
@media (min-width: 1025px) {
    .floor-units {
        max-height: 1650px;
    }
}

.floor-units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 0;
}

/* =======================================
   APARTMENT UNIT CARDS
   ======================================= */

.residence-card {
    background: var(--warm-white);
    border-bottom: 1px solid var(--silver);
    border-right: 1px solid var(--silver);
    transition: all 0.4s ease;
    cursor: pointer;
    padding: 25px;
}

.residence-card:hover {
    background: var(--pearl);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.card-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 500;
    color: var(--deep-navy);
    margin-bottom: 5px;
}

.card-type {
    color: var(--charcoal);
    opacity: 0.7;
    font-size: 14px;
}

.availability-badge {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.available {
    background: rgba(34, 197, 94, 0.875);
    color: #2C2C2C;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.leased {
    background: rgba(239, 68, 68, 0.65);
    color: #ffffff;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 12px;
    color: var(--charcoal);
    opacity: 0.6;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-weight: 600;
    color: var(--deep-navy);
    font-size: 16px;
}

.card-features {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--charcoal);
    opacity: 0.7;
}

.feature-icon {
    color: var(--primary-gold);
    margin-right: 5px;
}

/* Grid View Styles */
.residences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
}

.residences-grid .residence-card {
    border: none;
    border-radius: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    padding: 0;
    overflow: hidden;
}

.residences-grid .residence-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.card-image {
    position: relative;
    height: 280px;
    overflow: hidden;
    background: var(--silver);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--charcoal);
    opacity: 0.5;
}

/* Enhanced image wrapper - now takes full height */
.card-image-wrapper {
    flex: 0 0 31%; /* Image area - 31% width, full height */
    height: 100%; /* Take full height of the card body */
    min-height: 150px; /* Minimum height for consistency */
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid var(--primary-gold); /* Add subtle border */
    display: flex; /* Use flex to center image if needed */
    align-items: center;
    justify-content: center;
}

.unit-type-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Changed from 'cover' to 'contain' to show full image */
    object-position: center;
    transition: transform 0.3s ease;
    background: #f8f8f8; /* Light background for letterboxing if needed */
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.residences-grid .residence-card:hover .card-image img {
    transform: scale(1.05);
}

.residences-grid .card-header {
    margin-bottom: 10px;
}

.residences-grid .card-title {
    font-size: 28px;
    margin-bottom: 8px;
}

.residences-grid .card-type {
    margin-bottom: 20px;
    font-size: 15px;
}

.residences-grid .availability-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    font-size: 12px;
}

.residences-grid .card-content {
    padding: 30px;
}

.card-price {
    font-size: 24px;
    font-weight: 600;
    color: var(--deep-navy);
}

.special-features {
    color: var(--primary-gold);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 10px;
}

/* =========================================
   UNIVERSAL MODAL SCROLLBAR STYLES
   ========================================= */

/* Apply to any modal container with scrolling */
.modal-overlay [class*="modal-content"],
.modal-overlay [class*="modal"],
[class*="modal-overlay"] [class*="content"],
.unit-type-modal-content,
.unit-type-modal-overlay .unit-type-modal-content,
.floor-detail-modal-content,
.floor-detail-modal-overlay .floor-detail-modal-content,
.unit-detail-modal-content,
.unit-detail-modal-overlay .unit-detail-modal-content {
    /* Custom scrollbar styling to preserve border-radius */
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 169, 97, 0.5) transparent;
}

/* Universal webkit scrollbar styling for modals */
.modal-overlay [class*="modal-content"]::-webkit-scrollbar,
.modal-overlay [class*="modal"]::-webkit-scrollbar,
[class*="modal-overlay"] [class*="content"]::-webkit-scrollbar,
.unit-type-modal-content::-webkit-scrollbar,
.floor-detail-modal-content::-webkit-scrollbar,
.unit-detail-modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-overlay [class*="modal-content"]::-webkit-scrollbar-track,
.modal-overlay [class*="modal"]::-webkit-scrollbar-track,
[class*="modal-overlay"] [class*="content"]::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 0 5px 5px 0;
}

.unit-type-modal-content::-webkit-scrollbar-track,
.floor-detail-modal-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 0 8px 8px 0;
}

.unit-detail-modal-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 0 12px 12px 0;
}

.modal-overlay [class*="modal-content"]::-webkit-scrollbar-thumb,
.modal-overlay [class*="modal"]::-webkit-scrollbar-thumb,
[class*="modal-overlay"] [class*="content"]::-webkit-scrollbar-thumb,
.unit-type-modal-content::-webkit-scrollbar-thumb,
.floor-detail-modal-content::-webkit-scrollbar-thumb,
.unit-detail-modal-content::-webkit-scrollbar-thumb {
    background: rgba(201, 169, 97, 0.5);
    border-radius: 4px;
    border: 1px solid transparent;
    background-clip: content-box;
}

.modal-overlay [class*="modal-content"]::-webkit-scrollbar-thumb:hover,
.modal-overlay [class*="modal"]::-webkit-scrollbar-thumb:hover,
[class*="modal-overlay"] [class*="content"]::-webkit-scrollbar-thumb:hover,
.unit-type-modal-content::-webkit-scrollbar-thumb:hover,
.floor-detail-modal-content::-webkit-scrollbar-thumb:hover,
.unit-detail-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 169, 97, 0.7);
    background-clip: content-box;
}

.modal-overlay [class*="modal-content"]::-webkit-scrollbar-corner,
.modal-overlay [class*="modal"]::-webkit-scrollbar-corner,
[class*="modal-overlay"] [class*="content"]::-webkit-scrollbar-corner,
.unit-type-modal-content::-webkit-scrollbar-corner,
.floor-detail-modal-content::-webkit-scrollbar-corner,
.unit-detail-modal-content::-webkit-scrollbar-corner {
    background: transparent;
}

/* =========================================
   ENHANCED MODAL SCROLLBAR STYLES
   ========================================= */

/* Alternative overlay scrolling approach for perfect border-radius */
.modal-content-wrapper {
    background: var(--warm-white);
    border-radius: 5px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 1400px;
    max-height: 95vh;
    position: relative;
    margin: auto;
    opacity: 1;
    animation: modalSlideIn 0.3s ease-out;
    box-sizing: border-box;
    overflow: hidden; /* Hide overflow on wrapper to preserve border-radius */
}

.modal-content-inner {
    max-height: 95vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px; /* Account for scrollbar width */
    margin-right: -8px; /* Pull content back to edge */
    box-sizing: border-box;
}

/* Styled scrollbar for modal content inner */
.modal-content-inner::-webkit-scrollbar {
    width: 8px;
}

.modal-content-inner::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.modal-content-inner::-webkit-scrollbar-thumb {
    background: rgba(201, 169, 97, 0.6);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-content-inner::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 169, 97, 0.8);
}

/* Firefox scrollbar styling */
.modal-content-inner {
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 169, 97, 0.6) rgba(0, 0, 0, 0.05);
}

/* =========================================
   APARTMENT MODAL STYLES
   ========================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
    overflow-y: auto;
}

.modal-overlay.show {
    display: flex !important;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content {
    background: var(--warm-white);
    border-radius: 5px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 1400px;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    margin: auto;
    opacity: 1;
    animation: modalSlideIn 0.3s ease-out;
    /* Ensure proper box-sizing */
    box-sizing: border-box;
    
    /* Custom scrollbar to preserve border-radius */
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 169, 97, 0.5) transparent;
}

/* Webkit scrollbar styling for modal content */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 0 5px 5px 0;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(201, 169, 97, 0.5);
    border-radius: 4px;
    border: 1px solid transparent;
    background-clip: content-box;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 169, 97, 0.7);
    background-clip: content-box;
}

.modal-content::-webkit-scrollbar-corner {
    background: transparent;
}

.modal-section-title {
    font-family: var(--font-serif);
    font-size: 28px;
    color: var(--deep-navy);
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-gold);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Ensure grid items don't overflow */
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.details-pane {
    border: 2px solid; 
    color: #e8e5e1;
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 15px;
    background: #F8F6F3;
    /* Ensure proper containment */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.modal-image-section {
    position: relative;
    margin: 30px 0px 0px 30px;
}

.gallery-main-title {
    font-family: var(--font-serif);
    font-size: 40px;
    font-weight: 700;
    color: var(--deep-navy);
    margin: 0 0 8px 0;
    padding: 0 20px 0 0;
    background: var(--warm-white);
}

.modal-image {
    height: 850px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2C2C2C;
    margin-top: 0;
    position: relative;
    overflow: hidden;
    cursor: grab;
    border: 2px solid #E8E5E1;
    border-radius: 12px;
}

.modal-image.zoomed {
    cursor: move;
}

.modal-image.grabbing {
    cursor: grabbing;
}

.modal-details {
    padding: 30px;
    position: relative;
    /* Ensure content doesn't overflow the container */
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Zoom controls overlay */
.zoom-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    padding: 10px;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.zoom-controls:hover {
    opacity: 1;
}

.zoom-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #2C2C2C;
    transition: all 0.2s ease;
}

.zoom-btn:hover {
    background: #C9A961;
    color: white;
    transform: scale(1.1);
}

.zoom-btn:active {
    transform: scale(0.95);
}

/* Fullscreen overlay */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    cursor: grab;
}

.fullscreen-overlay.active {
    display: flex;
}

.fullscreen-overlay.grabbing {
    cursor: grabbing;
}

.fullscreen-image {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    transition: transform 0.3s ease;
    user-select: none;
}

.fullscreen-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    padding: 15px;
}

.fullscreen-controls .zoom-btn {
    width: 40px;
    height: 40px;
    font-size: 20px;
}

.zoom-info {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    height:40px;
}

.modal-details .availability-badge {
    position: static;
    top: auto;
    right: auto;
    z-index: auto;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 8px;
}

.modal-title {
    font-family: var(--font-serif);
    font-size: 45px;
    font-weight: 700;
    color: var(--deep-navy);
    margin: 0 0 0 0;
}

.modal-title-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
}

.modal-type {
    font-size: 25px;
    color: var(--charcoal);
    opacity: 1;
    margin-bottom: 10px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 5px;
    font-size: 16px;
    /* Ensure grid items don't overflow */
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.features-section {
    margin: 15px 0;
}

.features-title {
    font-family: var(--font-serif);
    font-size: 30px;
    color: var(--deep-navy);
    margin-bottom: 15px;
}

.features-list {
    display: grid;
    gap: 8px;
}

/* 2-Column Balanced Features Layout */
.features-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    width: 100%;
    /* Ensure proper containment */
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.features-column {
    flex: 1;
    min-width: 0; /* Prevents overflow */
}

.features-column-1 {
    padding-right: 12px;
}

.features-column-2 {
    padding-left: 12px;
}

/* Mobile responsive: stack in single column */
@media (max-width: 768px) {
    .features-container {
        flex-direction: column;
    }
    
    .features-column-1,
    .features-column-2 {
        padding: 0;
        margin-bottom: 0px;
    }
    
    .features-column-2 {
        margin-bottom: 0;
    }
}

/* Tablet responsive: maintain columns but with less padding */
@media (max-width: 1024px) and (min-width: 769px) {
    .features-column-1 {
        padding-right: 8px;
    }
    
    .features-column-2 {
        padding-left: 8px;
    }
}

.feature-item {
    display: flex;
    align-items: center;
    color: var(--charcoal);
}

.feature-check {
    color: var(--primary-gold);
    margin-right: 10px;
    font-weight: bold;
}

.floorplan-section {
    margin: 30px 0;
}

.floorplan-image {
    width: 100%;
    border-radius: 4px;
    border: 1px solid #E8E5E1;
    margin-bottom: 30px;
    background: #E8E5E1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.inquiry-btn {
    background: linear-gradient(135deg, var(--primary-gold), #B8965A);
    color: var(--warm-white);
    padding: 16px 32px;
    border: none;
    width: 100%;
    font-weight: 500;
    font-size: 16px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 7px;
}

.inquiry-btn:hover {
    background: var(--deep-navy);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

/* ===========================================
   APARTMENT LOADING INDICATOR
   =========================================== */

.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
    background: var(--warm-white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--silver);
    border-top: 4px solid var(--primary-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===========================================
   FULLSCREEN GALLERY BUTTONS
   =========================================== */

.fullscreen-btn-container {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

.fullscreen-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-5px);
}

.modal-gallery-main-display:hover .fullscreen-btn {
    opacity: 1;
    transform: translateY(0);
}

.fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

/* Fullscreen Overlay Styles */
.fullscreen-gallery-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.fullscreen-gallery-overlay.active {
    opacity: 1;
    visibility: visible;
}

.fullscreen-gallery-container {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Fullscreen Header */
.fullscreen-gallery-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    z-index: 10;
}

.fullscreen-gallery-counter {
    color: white;
    font-size: 16px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.fullscreen-gallery-disclaimer {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 400;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    font-style: italic;
    max-width: 400px;
    line-height: 1.3;
    opacity: 0.8;
}

.fullscreen-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.fullscreen-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Fullscreen Content */
.fullscreen-gallery-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 20px;
    box-sizing: border-box;
}

.modal-gallery-main-display.fullscreen-mode {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0;
}

.modal-gallery-main-display.fullscreen-mode .modal-gallery-main-image {
    max-width: 90vw;
    max-height: 75vh;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    background: transparent;
}

/* Title/Caption */
.modal-gallery-title {
    min-height: 2rem;
    color: #fff;
    text-align: center;
    font-size: 1rem;
    word-break: break-word;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 90vw;
}

/* Fullscreen Image Title */
.fullscreen-image-title {
    font-family: var(--font-serif);
    color: white;
    font-size: 20px;
    font-weight: 500;
    margin-top: 5px;
    text-align: center;
    width: 100%;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    padding: 0 20px;
    box-sizing: border-box;
}

.modal-gallery-main-display.fullscreen-mode .modal-gallery-navigation {
    padding: 40px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-gallery-main-display.fullscreen-mode:hover .modal-gallery-navigation {
    opacity: 1;
}

.modal-gallery-main-display.fullscreen-mode .modal-gallery-nav-btn {
    width: 50px;
    height: 50px;
    font-size: 24px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.modal-gallery-main-display.fullscreen-mode .modal-gallery-nav-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

/* Hide fullscreen button in fullscreen mode */
.modal-gallery-main-display.fullscreen-mode .fullscreen-btn-container {
    display: none;
}

/* ===========================================
   UNIT TYPES GRID VIEW (APARTMENT-SPECIFIC)
   =========================================== */

.unit-types-grid {
    display: grid;
    grid-template-columns: 1fr; /* Single column instead of auto-fit */
    gap: 10px;
    padding: 10px 0;
}

.unit-type-card {
    background: var(--warm-white);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.4s ease;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    position: relative;
    margin-bottom: 10px;
    animation: slideInUp 0.6s ease-out;
}

.unit-type-image {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    object-position: center;
    transition: transform 0.3s ease;
    background: #f8f8f8; /* Light background for letterboxing if needed */
}

.unit-type-image:hover {
    transform: scale(1.05);
}

.unit-type-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.unit-type-card-header {
    padding: 30px 30px 20px;
    background: linear-gradient(135deg, var(--pearl) 0%, var(--warm-white) 100%);
    border-bottom: 1px solid var(--silver);
    display: block
}

.unit-type-title {
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 500;
    color: var(--deep-navy);
    margin-bottom: 8px;
    display:block;
}

.unit-type-subtitle {
    color: var(--charcoal);
    opacity: 0.7;
    font-size: 16px;
    margin-bottom: 15px;
}

.unit-type-availability {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
}

.unit-type-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.availability-count {
    background: rgba(34, 197, 94, 0.1);
    color: #059669;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.total-count {
    color: var(--charcoal);
    opacity: 0.6;
    font-size: 14px;
}

/* Update existing .unit-type-card-body to better control layout */
.unit-type-card-body {
    padding: 25px 30px;
    display: flex; /* Changed from grid to flex */
    gap: 25px;
    align-items: stretch; /* Changed from 'start' to 'stretch' */
    min-height: 200px; /* Ensure minimum height */
}

/* Content wrapper takes up available space */
.card-content-wrapper {
    flex: 1; /* Take up remaining space in flex layout */
    min-width: 0; /* Prevents overflow issues */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Align content to top */
}

/* Update price-size grid - align items to the left */
.price-size-grid {
    display: grid;
    grid-template-columns: auto auto; /* Use 'auto' instead of '1fr' for left alignment */
    gap: 20px 40px; /* Horizontal and vertical gaps */
    margin-bottom: 16px;
    justify-content: start; /* Align grid to the left */
    width: fit-content; /* Only take up needed space */
}

/* Range items - keep vertical layout but make them compact */
.price-range,
.size-range {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Left align content */
    gap: 4px;
    min-width: 140px; /* Ensure consistent minimum width */
}

.range-label {
    font-size: 12px;
    color: var(--charcoal);
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.range-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--deep-navy);
    margin: 0;
}

/* Floor indicators - ensure they don't take too much space */
.floor-indicators {
    margin-bottom: 16px;
    flex-shrink: 0; /* Prevent shrinking */
}

.floor-indicators-label {
    font-size: 12px;
    color: var(--charcoal);
    opacity: 0.6;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.floor-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.floor-tag {
    background: var(--silver);
    color: var(--charcoal);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.floor-tag.has-available {
    background: var(--primary-gold);
    color: var(--warm-white);
    cursor: pointer; /* Show it's clickable */
    position: relative;
}

/* Enhanced hover state with light green theme */
.floor-tag.has-available:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3); /* Light green shadow */
    background: rgba(34, 197, 94, 0.1); /* Light green background */
    color: #059669; /* Green text - matches availability badge */
}

/* Active state for better click feedback */
.floor-tag.has-available:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(34, 197, 94, 0.2);
}

/* Small arrow for tooltip */
.floor-tag.has-available::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(44, 62, 80, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    margin-bottom: 1px;
}

.floor-tag.has-available:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Prevent tooltip from showing on mobile/touch devices */
@media (hover: none) and (pointer: coarse) {
    .floor-tag.has-available::after,
    .floor-tag.has-available::before {
        display: none;
    }
}

/* Focus state for accessibility */
.floor-tag.has-available:focus {
    outline: 2px solid #059669; /* Green focus outline to match hover */
    outline-offset: 2px;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Unit type features - make more compact */
.unit-type-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto; /* Push to bottom of content area */
}

.feature-tag {
    background: var(--pearl);
    color: var(--charcoal);
    padding: 5px 10px; /* Slightly smaller padding */
    border-radius: 16px;
    font-size: 11px; /* Slightly smaller font */
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap; /* Prevent line breaks in tags */
}

.feature-icon {
    font-size: 12px;
}

/* ===========================================
   UNIT TYPE MODAL (APARTMENT-SPECIFIC)
   =========================================== */

.unit-type-modal {
    max-width: 1400px;
    max-height: 95vh;
}

.unit-type-modal-header {
    padding: 40px 50px 30px;
    background: linear-gradient(135deg, var(--pearl) 0%, var(--warm-white) 100%);
    border-bottom: 1px solid var(--silver);
    text-align: center;
}

.unit-type-modal-header .modal-title {
    font-size: 42px;
    margin-bottom: 10px;
}

.modal-subtitle {
    font-size: 18px;
    color: var(--charcoal);
    opacity: 0.7;
    margin-bottom: 25px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: var(--warm-white);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-gold);
    display: block;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 12px;
    color: var(--charcoal);
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

.unit-type-modal-body {
    padding: 40px 50px;
}

/* Floor Availability Grid */
.floor-availability-section {
    margin-bottom: 50px;
}

.floor-availability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.floor-availability-card {
    background: var(--pearl);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.floor-availability-card:hover {
    border-color: var(--primary-gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.floor-availability-card.no-availability {
    opacity: 0.5;
    background: var(--silver);
}

.floor-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.floor-name {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 500;
    color: var(--deep-navy);
}

.floor-availability-badge {
    background: rgba(34, 197, 94, 0.875);
    color: #2C2C2C;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.floor-availability-badge.no-availability {
    background: rgba(239, 68, 68, 0.65);
    color: #ffffff;
}

.floor-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.floor-detail-item {
    text-align: center;
}

.floor-detail-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--deep-navy);
    display: block;
}

.floor-detail-label {
    font-size: 11px;
    color: var(--charcoal);
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 3px;
}

/* Photo Gallery */
.photo-gallery-section {
    margin-bottom: 50px;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.gallery-item {
    aspect-ratio: 4/3;
    background: var(--silver);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--charcoal);
    opacity: 0.5;
    font-size: 14px;
    text-align: center;
    flex-direction: column;
    gap: 8px;
}

.gallery-placeholder::before {
    content: "🏠";
    font-size: 24px;
    display: block;
}

/* Modal Photo Gallery Section Styles */
.modal-photo-gallery-section {
    margin-top: 15px;
    padding-top: 20px;
    border-top: 1px solid #E8E5E1;
}

.modal-photo-gallery-container {
    background: #F8F6F3;
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    width: 100%;
    max-width: 630px;
    box-sizing: border-box;
    overflow: hidden;
    margin: auto;
    border: solid 2px #e8e5e1;
    /* Ensure the gallery doesn't force width expansion */
    min-width: 0;
}

/* Main Gallery Display */
.modal-gallery-main-display {
    position: relative;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    width: 100%;
    max-width: 100%;
}

.modal-gallery-main-image {
    width: 100%;
    height: 400px;
    max-height: 50vh;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

/* Gallery Navigation Buttons */
.modal-gallery-navigation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-gallery-main-display:hover .modal-gallery-navigation {
    opacity: 1;
}

.modal-gallery-nav-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-gallery-nav-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.modal-gallery-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.modal-gallery-thumbnails-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    height: 75px;
}

.modal-gallery-thumbnails-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-width: 0;
    /* Ensure container doesn't expand beyond available space */
    max-width: 100%;
}

/* Thumbnail Strip */
.modal-gallery-thumbnails {
    display: flex;
    gap: 8px;
    padding: 10px 0;
    transition: transform 0.3s ease;
    width: fit-content;
    flex-wrap: nowrap;
    flex-shrink: 0;
    position: relative;
    left: 0;
}

.modal-gallery-thumbnail {
    flex-shrink: 0;
    width: 55px;
    height: 55px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-sizing: border-box;
    min-width: 55px;
    max-width: 55px;
}

.modal-gallery-thumbnail:hover {
    border-color: #C9A961;
    transform: scale(1.05);
}

.modal-gallery-thumbnail.active {
    border-color: #C9A961;
    box-shadow: 0 0 0 2px rgba(201, 169, 97, 0.3);
}

.modal-gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Thumbnail Navigation Buttons */
.modal-gallery-thumb-nav {
    position: static;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.modal-gallery-thumb-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.modal-gallery-thumb-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Gallery Counter */
.modal-gallery-counter {
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
    color: #2C2C2C;
    opacity: 0.7;
}

.modal-gallery-disclaimer {
    text-align: center;
    margin-top: 8px;
    font-size: 11px;
    color: #666;
    opacity: 0.8;
    font-style: italic;
    line-height: 1.3;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Gallery Loading/Error States */
.modal-gallery-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    background: #F8F6F3;
    border-radius: 8px;
    color: #2C2C2C;
    opacity: 0.7;
}

.modal-gallery-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #C9A961;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: modal-gallery-spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes modal-gallery-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.modal-gallery-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    background: #F8F6F3;
    border-radius: 8px;
    color: #666;
    font-style: italic;
}

/* Unit Features Grid */
.unit-features-section {
    margin-bottom: 30px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.feature-card {
    background: var(--pearl);
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.feature-card-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--warm-white);
    font-size: 24px;
    flex-shrink: 0;
}

.feature-card-content h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--deep-navy);
    margin-bottom: 5px;
}

.feature-card-content p {
    font-size: 14px;
    color: var(--charcoal);
    opacity: 0.7;
    margin: 0;
}

/* Modal Footer */
.unit-type-modal-footer {
    padding: 30px 50px;
    background: var(--pearl);
    border-top: 1px solid var(--silver);
    display: flex;
    gap: 15px;
    justify-content: center;
}

.inquiry-btn.primary {
    background: linear-gradient(135deg, var(--primary-gold), #B8965A);
    color: var(--warm-white);
    flex: 1;
    max-width: 250px;
    border-radius: 6px;
}

.inquiry-btn.secondary {
    background: transparent;
    color: var(--primary-gold);
    border: 2px solid var(--primary-gold);
    flex: 1;
    max-width: 250px;
    border-radius: 6px;
}

.inquiry-btn.secondary:hover {
    background: var(--primary-gold);
    color: var(--warm-white);
}

/* ====================================
   APARTMENT-SPECIFIC ANIMATIONS
   ==================================== */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fullscreen-gallery-overlay.active .fullscreen-gallery-container {
    animation: fadeInScale 0.3s ease-out;
}

.unit-type-card:nth-child(1) { animation-delay: 0.1s; }
.unit-type-card:nth-child(2) { animation-delay: 0.2s; }
.unit-type-card:nth-child(3) { animation-delay: 0.3s; }
.unit-type-card:nth-child(4) { animation-delay: 0.4s; }
.unit-type-card:nth-child(5) { animation-delay: 0.5s; }
.unit-type-card:nth-child(6) { animation-delay: 0.6s; }
.unit-type-card:nth-child(7) { animation-delay: 0.7s; }
.unit-type-card:nth-child(8) { animation-delay: 0.8s; }
.unit-type-card:nth-child(9) { animation-delay: 0.9s; }

/* ===============================================
   APARTMENT-SPECIFIC RESPONSIVE OVERRIDES
   =============================================== */

/* Responsive Design Updates */

/* Large Desktop - 1280px and up */
@media (min-width: 1281px) {
    .unit-type-card-body {
        grid-template-columns: 1fr 220px; /* Even larger image on big screens */
        gap: 30px;
    }
    
    .card-image-wrapper {
        width: 220px;
    }
    
    .price-size-grid {
        gap: 25px 50px;
    }
}

@media (max-width: 1280px) {
    .modal-photo-gallery-container {
        max-width: 540px !important;    
    }
    
    /* Ensure modal content fits better on smaller large screens */
    .modal-content {
        max-width: 1200px;
        margin: 20px;
    }
    
    .modal-details {
        padding: 25px 20px;
    }
    
    .details-grid {
        gap: 15px;
    }
    
    .features-column-1 {
        padding-right: 10px;
    }
    
    .features-column-2 {
        padding-left: 10px;
    }
    
    .unit-type-card-body {
        grid-template-columns: 1fr 160px;
        gap: 20px;
    }
    
    .card-image-wrapper {
        width: 160px;
        min-height: 130px;
    }
    
    .price-size-grid {
        grid-template-columns: auto auto;
        gap: 16px 30px;
    }
    
    .price-range,
    .size-range {
        min-width: 120px;
    }
}

/* Tablet - 768px to 1024px */
@media (max-width: 1024px) {
    /* Better modal sizing for tablets */
    .modal-content {
        max-width: 1000px;
        margin: 15px;
    }
    
    .modal-details {
        padding: 20px 15px;
    }
    
    .details-grid {
        gap: 12px;
        font-size: 15px;
    }
    
    .features-title {
        font-size: 26px;
    }
    
    .features-column-1 {
        padding-right: 8px;
    }
    
    .features-column-2 {
        padding-left: 0px;
    }
    
    .unit-type-card-body {
        grid-template-columns: 1fr 140px;
        gap: 18px;
        min-height: 160px;
    }
    
    .card-image-wrapper {
        width: 140px;
        min-height: 120px;
    }
    
    .price-size-grid {
        gap: 14px 25px;
    }
    
    .range-value {
        font-size: 16px;
    }
    
    /* Tablet photo gallery constraints */
    .modal-photo-gallery-container {
        max-width: 500px;
        padding: 18px;
    }
    
    .modal-gallery-thumbnails-container {
        /* Allow up to 6 thumbnails on tablet */
        max-width: calc(6 * 52px + 5 * 7px);
    }
    
    .modal-gallery-thumbnails {
        gap: 7px;
        max-width: calc(6 * 52px + 5 * 7px);
    }
    
    .modal-gallery-thumbnail {
        width: 52px;
        height: 52px;
        min-width: 52px;
        max-width: 52px;
    }
    
    .price-range,
    .size-range {
        min-width: 110px;
    }
}

/* Mobile - up to 768px */
@media (max-width: 768px) {
    .filters-container {
        grid-template-columns: 1fr;
        padding: 30px 20px;
    }
    
    .results-summary {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .modal-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-main-title {
        font-size: 20px;
        padding: 15px 15px 0 0;
    }
    
    .modal-image {
        height: 275px;
    }

    .zoom-controls {
        top: 10px;
        right: 10px;
        padding: 8px;
        gap: 6px;
    }

    .zoom-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .fullscreen-controls {
        top: 10px;
        right: 10px;
        padding: 10px;
        gap: 8px;
    }

    .fullscreen-controls .zoom-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .zoom-info {
        top: 10px;
        left: 10px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .modal-details {
        padding: 0px 30px 30px 30px;
    }
    
    /* Mobile photo gallery - strict width constraints */
    .modal-photo-gallery-container {
        max-width: 100%;
        margin: 15px 0;
        padding: 15px;
        overflow: hidden;
    }
    
    .modal-gallery-thumbnails-wrapper {
        overflow: hidden;
        max-width: 100%;
    }
    
    .modal-gallery-thumbnails-container {
        max-width: 100%;
        overflow: hidden;
    }
    
    .modal-gallery-thumbnails {
        max-width: 100%;
        overflow: hidden;
        flex-wrap: nowrap;
    }
    
    .floor-units-grid {
        grid-template-columns: 1fr;
    }
    
    .residences-grid {
        grid-template-columns: 1fr;
    }
    
    .unit-types-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .unit-type-card-header {
        padding: 20px;
    }

    /* Keep horizontal layout for tablet (768px down to 481px) */
    .unit-type-card-body {
        padding: 20px 15px;
        gap: 18px;
        min-height: auto;
    }
    
    .card-image-wrapper {
        flex: 0 0 35%; /* Slightly larger image area for tablet */
        min-height: 140px;
    }
    
    /* Return to 2-column grid for price/size on mobile for better use of space */
    .price-size-grid {
        grid-template-columns: 1fr 1fr; /* Equal columns on mobile */
        gap: 16px 20px;
        margin-bottom: 16px;
        justify-content: stretch; /* Use full width on mobile */
        width: 100%;
    }
    
    .price-range,
    .size-range {
        min-width: auto; /* Remove min-width constraint on mobile */
        text-align: left;
    }
    
    .range-value {
        font-size: 16px;
    }
    
    .range-label {
        font-size: 11px;
    }
    
    .unit-type-modal-header,
    .unit-type-modal-body,
    .unit-type-modal-footer {
        padding: 20px;
    }
    
    .unit-type-modal-header .modal-title {
        font-size: 32px;
    }
    
    .floor-availability-grid {
        grid-template-columns: 1fr;
    }
    
    .photo-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .unit-type-modal-footer {
        flex-direction: column;
    }
    
    .inquiry-btn.primary,
    .inquiry-btn.secondary {
        max-width: none;
    }

    .modal-gallery-main-image {
        height: 300px;
        max-height: 40vh;
    }
    
    .modal-gallery-navigation {
        padding: 15px;
    }
    
    .modal-gallery-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .modal-gallery-thumbnails-wrapper {
        gap: 10px;
        height: 65px;
    }
    
    .modal-gallery-thumbnail {
        width: 45px;
        height: 45px;
        min-width: 45px;
        max-width: 45px;
    }
    
    .modal-gallery-thumb-nav {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
    
    .modal-gallery-thumbnails {
        gap: 6px;
    }

    .fullscreen-gallery-header {
        height: 50px;
        padding: 0 20px;
    }
    
    .fullscreen-gallery-counter {
        font-size: 14px;
    }
    
    .fullscreen-close-btn {
        font-size: 28px;
        width: 35px;
        height: 35px;
    }
    
    .fullscreen-gallery-content {
        padding: 50px 15px 15px;
    }
    
    .modal-gallery-main-display.fullscreen-mode .modal-gallery-navigation {
        padding: 20px;
    }
    
    .modal-gallery-main-display.fullscreen-mode .modal-gallery-nav-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .fullscreen-btn-container {
        top: 10px;
        right: 10px;
    }
    
    .fullscreen-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* Small Mobile - up to 480px */
@media (max-width: 480px) {
    .unit-type-card-body {
        padding: 20px;
        gap: 16px;
    }
    
    .card-image-wrapper {
        height: 140px;
        min-height: 140px;
    }
    
    .price-size-grid {
        gap: 12px 16px;
    }
    
    .range-value {
        font-size: 15px;
    }
    
    .feature-tag {
        font-size: 10px;
        padding: 4px 8px;
    }
}

@media (max-width: 600px) {
    .modal-gallery-main-image {
        max-width: 96vw;
        max-height: 60vh;
    }
    
    .modal-gallery-title {
        font-size: 0.95rem;
    }
}

/* Mobile - 480px and below: Vertical stacking for unit-type cards */
@media (max-width: 480px) {
    .unit-type-card-body {
        flex-direction: column;
        padding: 20px;
        gap: 16px;
        min-height: auto;
    }
    
    .card-image-wrapper {
        flex: none;
        width: 100%;
        height: 180px;
        min-height: 180px;
        order: -1; /* Image on top */
    }
    
    .card-content-wrapper {
        flex: none;
        width: 100%;
    }
}

/* Extra Small Mobile - 320px and below: Reduced padding for modal bodies */
@media (max-width: 320px) {
    .modal-body-container {
        padding: 30px 10px !important;
    }
    
    .floor-detail-body-container {
        padding: 30px 10px !important;
    }
}