/**
 * Filtered Properties Component Styles - FINAL FIGMA MATCH
 * File: /assets/css/filtered-properties.css
 * 
 * FINAL FIXES:
 * - Active states: Brown background (#5A4F42) with white text
 * - Bedroom/Bathroom layout: 1-3 on first row, 4-5+ on second row
 * - Pagination: Only right arrow (no left arrow)
 * - Loop back to page 1 when beyond last page
 */

/* ============================================================
   MAIN WRAPPER - SIDE BY SIDE LAYOUT
   ============================================================ */

   .filtered-properties-section {
    width: 100%;
    padding: 80px 0;
    background: #FFF;
}

.filtered-properties-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 70px;
    align-items: flex-start;
}

/* ============================================================
   SIDEBAR FILTERS (LEFT SIDE - 300PX) - FIGMA EXACT
   ============================================================ */

.filters-sidebar {
    width: 300px;
    min-width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.filters-title {
    color: var(--Primary, #5A4F42);
    font-size: 24px;
    font-family: 'Roboto', 'HK Grotesk', 'Hanken Grotesk', sans-serif;
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
}

.filters-divider {
    width: 100%;
    height: 0px;
    outline: 1px var(--300, #E8E5DF) solid;
    outline-offset: -0.50px;
}

.filters-container {
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Filter Group */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.filter-label {
    color: var(--Primary, #5A4F42);
    font-size: 18px;
    font-family: 'Roboto', 'HK Grotesk', 'Hanken Grotesk', sans-serif;
    font-weight: 400;
    line-height: 1.2;
}

/* Dropdown Filters - FIGMA EXACT */
.filter-dropdown {
    position: relative;
    width: 100%;
}

.filter-select {
    width: 100%;
    height: 50px;
    padding: 13px 20px;
    background: var(--White, white);
    border-radius: 3px;
    outline: 1px var(--400, #CCC8C0) solid;
    outline-offset: -1px;
    color: var(--600, #928A80);
    font-size: 16px;
    font-family: 'Roboto', 'HK Grotesk', 'Hanken Grotesk', sans-serif;
    font-weight: 300;
    appearance: none;
    cursor: pointer;
    transition: outline-color 0.3s ease;
    box-sizing: border-box;
    border: none;
}

.filter-select:focus {
    outline: 2px var(--Primary, #5A4F42) solid;
    outline-offset: -2px;
}

.filter-select option {
    color: var(--Primary, #5A4F42);
    font-weight: 400;
}

.dropdown-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 6.17px;
    color: var(--600, #958E81);
    font-size: 10px;
    pointer-events: none;
    line-height: 1;
}

/* Price Input Fields - FIGMA EXACT */
.filter-input-wrapper {
    position: relative;
    width: 100%;
}

.currency-symbol {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--600, #958E81);
    font-size: 18px;
    font-family: 'Roboto', 'HK Grotesk', 'Hanken Grotesk', sans-serif;
    font-weight: 300;
    pointer-events: none;
    z-index: 1;
}

.filter-input {
    width: 100%;
    height: 50px;
    padding: 13px 20px;
    padding-left: 40px !important;
    background: var(--White, white);
    border-radius: 3px;
    outline: 1px var(--400, #CCC8C0) solid;
    outline-offset: -1px;
    color: var(--Primary, #5A4F42);
    font-size: 16px;
    font-family: 'Roboto', 'HK Grotesk', 'Hanken Grotesk', sans-serif;
    font-weight: 400;
    transition: outline-color 0.3s ease;
    box-sizing: border-box;
    border: none;
}

.filter-input:focus {
    outline: 2px var(--Primary, #5A4F42) solid;
    outline-offset: -2px;
}

.filter-input::placeholder {
    color: var(--600, #928A80);
}

/* Filter Buttons (Bedrooms/Bathrooms) - LAYOUT: 1-3 / 4-5+ */
.filter-buttons {
    display: grid;
    grid-template-columns: repeat(3, 62px);
    gap: 10px;
    width: 100%;
}

/* First 3 buttons in first row */
.filter-btn:nth-child(1),
.filter-btn:nth-child(2),
.filter-btn:nth-child(3) {
    grid-row: 1;
}

/* Last 2 buttons in second row */
.filter-btn:nth-child(4) {
    grid-row: 2;
    grid-column: 1;
}

.filter-btn:nth-child(5) {
    grid-row: 2;
    grid-column: 2;
}

.filter-btn {
    width: 62px;
    height: 50px;
    padding: 9px 18px;
    background: var(--White, white);
    border-radius: 3px;
    outline: 1px var(--400, #CCC8C0) solid;
    outline-offset: -1px;
    color: var(--600, #928A80);
    font-size: 18px;
    font-family: 'Roboto', 'HK Grotesk', 'Hanken Grotesk', sans-serif;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

/* Hover State - Brown border only */
.filter-btn:hover {
    outline: 1px var(--Primary, #5A4F42) solid;
    outline-offset: -1px;
}

/* Active/Clicked State - Brown background, white text */
.filter-btn.active {
    background: var(--Primary, #5A4F42) !important;
    outline: 1px var(--Primary, #5A4F42) solid !important;
    outline-offset: -1px !important;
    color: var(--White, white) !important;
}

/* ============================================================
   MAIN CONTENT AREA (RIGHT SIDE - 830PX)
   ============================================================ */

.properties-main-content {
    flex: 1;
    max-width: 830px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* ============================================================
   PAGINATION (BOTTOM ONLY) - RIGHT ARROW ONLY
   ============================================================ */

.properties-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 40px;
}

/* Hide top pagination - only show bottom */
.properties-pagination.top {
    display: none !important;
}

/* Show bottom pagination */
.properties-pagination.bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 40px;
}

/* Hide left/previous arrow button */
.pagination-btn.prev {
    display: none !important;
}

/* Pagination Right Arrow - FIGMA EXACT */
.pagination-btn.next {
    width: 40px;
    height: 40px;
    padding: 7px 14px;
    background: var(--White, white);
    outline: 1px var(--400, #CCC8C0) solid;
    outline-offset: -1px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    box-sizing: border-box;
    position: relative;
}

/* Hover State - Brown border */
.pagination-btn.next:hover:not(:disabled) {
    outline: 1px var(--Primary, #5A4F42) solid;
    outline-offset: -1px;
}

.pagination-btn.next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Pagination Icon (Right Arrow) */
.pagination-icon {
    width: 7.40px;
    height: 12px;
    color: var(--Primary, #5A4F42);
    font-size: 20px;
    font-family: 'Roboto', 'HK Grotesk', 'Hanken Grotesk', sans-serif;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

/* Number Buttons Container */
.pagination-numbers {
    display: flex;
    gap: 10px;
}

/* Pagination Number Buttons - FIGMA EXACT */
.pagination-number {
    width: 40px;
    height: 40px;
    padding: 7px 14px;
    background: var(--White, white);
    outline: 1px var(--400, #CCC8C0) solid;
    outline-offset: -1px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    box-sizing: border-box;
    position: relative;
    color: var(--Primary, #5A4F42);
    font-size: 20px;
    font-family: 'Roboto', 'HK Grotesk', 'Hanken Grotesk', sans-serif;
    font-weight: 400;
}

/* Hover State - Brown border */
.pagination-number:hover {
    outline: 1px var(--Primary, #5A4F42) solid;
    outline-offset: -1px;
}

/* Active State - Brown background, white text, brown border */
.pagination-number.active {
    background: var(--Primary, #5A4F42) !important;
    outline: 1px var(--Primary, #5A4F42) solid !important;
    outline-offset: -1px !important;
    color: var(--White, white) !important;
}

/* ============================================================
   PROPERTIES GRID (2 COLUMNS, 400PX EACH)
   ============================================================ */

.properties-grid {
    display: grid;
    grid-template-columns: repeat(2, 400px);
    gap: 30px;
    width: 100%;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.properties-grid.is-fading {
    opacity: 0; 
}

/* ============================================================
   PROPERTY CARD
   ============================================================ */

.property-card {
    width: 400px;
    background: white;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.property-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 100%;
}

.property-card-image {
    width: 100%;
    height: 350px;
    overflow: hidden;
    position: relative;
}

.property-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.property-card:hover .property-card-image img {
    transform: scale(1.05);
}

.property-card-content {
    padding: 30px 0;
    background: white;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.property-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 10px;
}

.property-card-title {
    flex: 1;
    color: #5A4F42;
    font-size: 24px;
    font-family: 'HK Grotesk', 'Hanken Grotesk', 'Roboto', sans-serif;
    font-weight: 500;
    text-transform: capitalize;
    margin: 0;
    line-height: 1.3;
}

/* Status Badge */
.property-badge {
    padding: 5px 15px;
    background: #6A8375;
    color: white;
    font-size: 16px;
    font-family: 'HK Grotesk', 'Hanken Grotesk', 'Roboto', sans-serif;
    font-style: italic;
    font-weight: 400;
    white-space: nowrap;
    display: inline-block;
    flex-shrink: 0;
}

.property-badge.badge-available,
.property-badge.badge-on-sale {
    background: #6A8375;
}

.property-badge.badge-pre-sale {
    background: #6B6D80;
}

.property-badge.badge-in-construction {
    background: transparent;
    color: #5A4F42;
    border: 1px solid #5A4F42;
}

.property-badge.badge-sold {
    background: #F05759;
}

.property-badge.badge-pending,
.property-badge.badge-reserved {
    background: #F5A623;
}

/* Property Specs */
.property-card-specs {
    color: #766C61;
    font-size: 18px;
    font-family: 'HK Grotesk', 'Hanken Grotesk', 'Roboto', sans-serif;
    font-weight: 400;
    margin: 0;
    line-height: 1.4;
}

/* No Results Message */
.no-results {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    background: white;
    border-radius: 8px;
}

.no-results p {
    color: #766C61;
    font-size: 18px;
    font-family: 'HK Grotesk', 'Hanken Grotesk', 'Roboto', sans-serif;
    margin: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1200px) {
    .filtered-properties-wrapper {
        max-width: 1000px;
        gap: 50px;
    }
    
    .properties-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .property-card {
        width: 100%;
    }
}

@media (max-width: 1024px) {
    .filtered-properties-wrapper {
        gap: 40px;
    }
    
    .filters-sidebar {
        width: 250px;
        min-width: 250px;
        position: static;
    }
    
    .filters-container {
        width: 100%;
    }
    
    .properties-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .filtered-properties-section {
        padding: 60px 0;
    }
    
    .filtered-properties-wrapper {
        flex-direction: column;
        gap: 40px;
    }
    
    .filters-sidebar {
        width: 100%;
        min-width: 100%;
    }
    
    .filters-container {
        width: 100%;
    }
    
    .properties-main-content {
        max-width: 100%;
    }
    
    .properties-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .property-card-image {
        height: 250px;
    }
    
    .property-card-title {
        font-size: 20px;
    }
    
    .pagination-btn,
    .pagination-number {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .pagination-icon {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .filtered-properties-section {
        padding: 40px 0;
    }
    
    .filtered-properties-wrapper {
        padding: 0 15px;
    }
    
    .filters-sidebar {
        gap: 20px;
    }
    
    .filters-container {
        gap: 25px;
    }
    
    .filter-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .filter-btn {
        width: 100%;
        height: 44px;
        font-size: 16px;
    }
    
    .property-card-content {
        padding: 20px 0;
    }
    
    .property-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .property-badge {
        font-size: 14px;
        padding: 4px 12px;
    }
    
    .property-card-title {
        font-size: 18px;
    }
    
    .property-card-specs {
        font-size: 16px;
    }
    
    .pagination-numbers {
        gap: 8px;
    }
}