/* Properties Archive Specific Styles */

.properties-page-header {
    background: linear-gradient(rgba(14, 17, 38, 0.8), rgba(14, 17, 38, 0.9)), url('https://images.unsplash.com/photo-1512917774080-9991f1c4c750?auto=format&fit=crop&w=1920&q=80') center/cover;
    padding: 120px 0;
    text-align: center;
    color: #fff;
    margin-top: -85px; /* Pull up under transparent header */
    padding-top: 180px; /* Offset the pull up */
}

/* Split View Layout */
.properties-main-content {
    display: flex;
    gap: 30px;
    margin-top: 30px;
    align-items: flex-start;
}

.properties-list-side {
    flex: 1;
    min-width: 0; /* Fix flex child overflow */
}

.properties-map-side {
    width: 40%;
    position: sticky;
    top: 100px;
    height: calc(100vh - 140px);
}

.property-map-container {
    height: 100%;
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    z-index: 1;
}

/* Adjust grid for sidebar layout */
.properties-list-side .archive-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns instead of 4 when map is visible */
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .properties-list-side .archive-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

@media (max-width: 992px) {
    .properties-main-content {
        flex-direction: column;
    }
    
    .properties-map-side {
        width: 100%;
        position: static;
        height: 350px;
        order: -1; /* Map on top for mobile/tablet */
        margin-bottom: 30px;
    }
    
    .property-map-container {
        border-radius: 20px;
    }
    
    .properties-list-side .archive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .properties-list-side .property-card .property-details {
        padding: 20px;
    }

    .properties-list-side .property-card .property-image-wrapper {
        height: 220px;
    }
}

@media (max-width: 600px) {
    .properties-map-side {
        height: 280px;
        margin-bottom: 25px;
    }
    .property-map-container {
        border-radius: 16px;
    }
    .properties-list-side .archive-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 20px;
    }
    .properties-list-side .property-card .property-image-wrapper {
        height: 200px;
    }
    .properties-list-side .property-card .property-details {
        padding: 15px 20px;
    }
    .properties-list-side .property-card .property-details h3 {
        font-size: 18px;
    }
    .properties-list-side .property-card .property-price {
        font-size: 20px;
        margin-bottom: 10px;
    }
}

.properties-page-header .section-subtitle {
    margin-bottom: 15px;
    background: #fff;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.properties-page-header .section-title-lux {
    color: #fff !important;
    font-size: clamp(36px, 5vw, 56px);
}

.header-desc {
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* Adjustments for the grid to handle any WooCommerce specific wrappers */
.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    width: 100%;
}

/* WooCommerce Pagination overriding */
.woocommerce-pagination {
    margin-top: 50px;
    text-align: center;
}

.woocommerce-pagination ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    opacity: 1;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    background: #fff;
    color: var(--primary-1);
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.woocommerce-pagination ul li span.current {
    background: var(--gradient-1);
    color: #fff;
}

.woocommerce-pagination ul li a:hover {
    background: var(--primary-1);
    color: #fff;
    transform: translateY(-3px);
}

/* Floating Filter UI */
.properties-archive-wrapper {
    margin-top: 0; /* Align to top */
}

/* Force eliminate padding gap from global section-padding */
.properties-archive-wrapper .section-padding {
    padding-top: 5px !important; /* Minimal spacing as requested */
}

/* Floating Actions Group Layout */
.floating-actions-group {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 2000;
}

.filter-floating-toggle, .geo-floating-toggle {
    background: var(--gradient-1); /* Use brand gradient */
    color: #fff;
    padding: 12px 28px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(42, 63, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(255,255,255,0.2);
    white-space: nowrap;
    min-width: 120px;
}

.toggle-text {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
}

.toggle-icon {
    transition: transform 0.4s ease;
}

.filter-floating-toggle.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

.filter-floating-toggle:hover, .geo-floating-toggle:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(14, 17, 38, 0.5);
    background: var(--primary-2);
}

.geo-floating-toggle.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    visibility: hidden;
}

.geo-floating-toggle.is-loading {
    animation: pulse-geo 1.5s infinite;
    pointer-events: none;
    opacity: 0.7;
}

@keyframes pulse-geo {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
    .floating-actions-group {
        bottom: 30px; /* Slightly higher for reach */
        width: 100%;
        padding: 0 20px;
        justify-content: center;
        box-sizing: border-box;
    }
    
    .filter-floating-toggle, .geo-floating-toggle {
        padding: 12px 20px;
        font-size: 13px;
        min-width: 110px;
    }

    /* Mobile Filter Panel Adjustments */
    .properties-filter-panel {
        padding: 30px 20px; /* Side padding to contain content */
        max-height: 85vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
    }
    .filter-panel-header {
        padding: 0; /* Let panel padding handle it */
        margin-bottom: 25px;
        width: 100%;
    }
    .property-filters-form {
        width: 100%;
        max-width: 100%;
    }
    .filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        padding-bottom: 80px; /* Generous buffer for dropdown lists */
        width: 100%;
        box-sizing: border-box;
    }
    .filter-group {
        width: 100%;
        min-width: 100%;
    }
    .filter-group.col-submit {
        margin-top: 10px;
    }
    .filter-group.col-submit .lux-btn {
        margin-top: 5px !important;
    }
}

/* Filter Panel Container */
.properties-filter-panel {
    position: fixed;
    bottom: -100%; /* Hidden off-screen */
    left: 0;
    right: 0; /* Use left/right instead of width: 100% */
    background: rgba(255, 255, 255, 0.98); /* Slightly more opaque for focus */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 3000; /* Ensure it stays above everything */
    padding: 40px 0;
    box-shadow: 0 -15px 50px rgba(0,0,0,0.15);
    transition: bottom 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-top: 1px solid rgba(0,0,0,0.05);
    box-sizing: border-box;
}

.properties-filter-panel.is-active {
    bottom: 0;
}

/* Filter Panel Header */
.filter-panel-header {
    max-width: 1300px;
    margin: 0 auto 30px;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-panel-header h3 {
    margin: 0;
    font-size: 24px;
    color: var(--primary-1);
}

.filter-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-close-btn:hover {
    background: #eee;
    transform: rotate(90deg);
}

/* Adjust filter layout for panel */
.property-filters-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.filter-group label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary-3);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    width: 100%;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group.col-search {
    flex: 3;
    min-width: 250px;
}

.filter-group.col-sort {
    flex: 1;
    min-width: 200px;
}

.filter-group.col-submit {
    flex: 0 0 auto;
}

.filter-group input[type="text"],
.filter-group select {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 18px; /* Slightly larger targets */
    border: 1px solid rgba(203, 212, 225, 0.5);
    border-radius: 10px; /* Aligned with site standard */
    font-family: inherit;
    font-size: 15px; /* Better legibility */
    color: var(--primary-1);
    background: #F9FAFB;
    transition: all 0.3s ease;
    height: 52px; /* Fixed height for consistency */
}

.filter-group input[type="text"]:focus,
.filter-group select:focus {
    border-color: #2A3FFF; /* Accent */
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(42, 63, 255, 0.1);
}

.filter-group.checkbox-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 2;
    background: #F9FAFB;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(203, 212, 225, 0.5);
}

.filter-group.checkbox-group .filter-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--secondary-3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Custom Map Markers */
.luxury-marker {
    background: var(--gradient-1);
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px !important;
    height: 20px !important;
}

.luxury-marker::after {
    content: '';
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
}

.luxury-marker.is-active {
    transform: scale(1.4);
    box-shadow: 0 0 20px rgba(42, 63, 255, 0.6);
    background: var(--primary-2);
    z-index: 2000 !important;
}

/* Custom Popup Style */
.luxury-map-popup .leaflet-popup-content-wrapper {
    border-radius: 15px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.luxury-map-popup .leaflet-popup-content {
    margin: 0;
    width: 240px !important;
}

.map-popup-card {
    padding: 12px;
}

.map-popup-card h4 {
    margin-bottom: 5px;
    color: var(--primary-1);
}

.map-popup-card p {
    color: var(--secondary-1); /* Gold/Brown price */
    font-weight: 700;
}
.filter-group.checkbox-group label {
    font-size: 14px;
    color: var(--primary-1);
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.filter-group.checkbox-group input[type="checkbox"] {
    accent-color: var(--primary-2);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ==========================================================================
   Property Card Swiper Slider Styles
   ========================================================================== */

.property-image-wrapper {
    position: relative;
    overflow: hidden;
}

.property-swiper {
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allow clicks to pass through to the link below */
}

.property-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: block;
}

.property-swiper .swiper-button-next,
.property-swiper .swiper-button-prev {
    color: #fff;
    background: rgba(14, 17, 38, 0.5);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    opacity: 0; /* Hidden by default again */
    margin-top: 0;
    transform: translateY(-50%);
    top: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 100 !important; /* Ensure they stay above everything */
    pointer-events: auto !important; /* Re-enable for arrows */
}

.property-swiper .swiper-button-next:after,
.property-swiper .swiper-button-prev:after {
    font-size: 12px;
    font-weight: 900;
}

.property-card:hover .property-swiper .swiper-button-next,
.property-card:hover .property-swiper .swiper-button-prev {
    opacity: 1 !important; /* Show on hover as requested */
    background: rgba(14, 17, 38, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.property-swiper .swiper-button-next:hover,
.property-swiper .swiper-button-prev:hover {
    background: var(--primary-2);
    color: #fff;
    border-color: var(--primary-2);
}

.property-swiper .swiper-button-next {
    right: 15px;
}

.property-swiper .swiper-button-prev {
    left: 15px;
}

.property-card-link {
    z-index: 20; /* Elevated above details and swiper container */
}
