/* ========================================
   KEYMEX - Estilos Específicos Comprar
   ======================================== */

body {
    background: #f5f5f5;
}

/* Main Container */
.container {
    display: flex;
    max-width: 1600px;
    margin: 30px auto;
    gap: 30px;
    padding: 0 20px;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    padding: 25px;
    border-radius: 8px;
    height: fit-content;
    position: sticky;
    top: 90px;
    transition: all 0.3s ease;
}

.sidebar-close {
    display: none;
}

.sidebar:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.filter-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #333;
}

.filter-option {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    color: #666 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 5px;
    padding-left: 5px;
}

.filter-option:hover {
    color: #333 !important;
    background: rgba(0, 0, 0, 0.05) !important;
    transform: translateX(5px);
}

/* FORZAR que NUNCA haya rojo */
.filter-option,
.filter-option.active,
.filter-option.location,
.filter-option.type,
.filter-option.location.active,
.filter-option.type.active {
    color: #666 !important;
    background: transparent !important;
}

.filter-option:hover,
.filter-option.active:hover,
.filter-option.location:hover,
.filter-option.type:hover {
    color: #333 !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

.filter-count {
    color: #999;
}

.search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #c9302c;
    outline: none;
    box-shadow: 0 0 0 3px rgba(201, 48, 44, 0.1);
}

.apply-button {
    width: 100%;
    padding: 12px;
    background: #c9302c;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.apply-button:hover {
    background: #a82824;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(201, 48, 44, 0.3);
}

.apply-button:active {
    transform: translateY(0);
}

.room-selector {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.room-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}

.room-btn:hover {
    border-color: #c9302c;
    color: #c9302c;
    transform: scale(1.05);
}

/* Main Content */
.main-content {
    flex: 1;
}

/* Properties Grid */
#properties-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* Property Card */
.property-card {
    background: white;
    border-radius: 15px;
    margin-bottom: 20px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 320px 1fr 200px;
    gap: 0;
    transition: box-shadow 0.3s;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 0;
    align-items: stretch;
}

.property-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.property-image {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.property-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #c9302c;
    color: white;
    padding: 5px 12px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    z-index: 1;
}

.page-header {
    background: white;
    padding: 20px 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: #c9302c;
    margin-bottom: 5px;
}

.results-count {
    font-size: 13px;
    color: #666;
}

.sort-options {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    align-items: center;
}

.sort-options label {
    font-size: 13px;
    color: #666;
}

.sort-select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-select:hover {
    border-color: #c9302c;
}

/* Property Card Sections */
.property-info {
    padding: 20px 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.property-title {
    font-size: 16px;
    font-weight: 700;
    color: #c9302c;
    margin: 0;
    line-height: 1.3;
    text-transform: uppercase;
}

.property-location {
    font-size: 13px;
    color: #666;
    margin: 0;
    font-weight: 400;
}

.property-description {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    margin: 6px 0;
}

.property-features {
    display: flex;
    gap: 0;
    margin: 8px 0;
    font-size: 13px;
    color: #333;
    flex-wrap: wrap;
}

.property-feature {
    display: inline-block;
    position: relative;
    padding: 0 12px;
    border-right: 1px solid #999;
}

.property-feature:first-child {
    padding-left: 0;
}

.property-feature:last-child {
    border-right: none;
}

.property-agent {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.agent-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #e0e0e0;
    flex-shrink: 0;
}

.agent-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.agent-name {
    font-size: 13px;
    color: #333;
    font-weight: 600;
}

.agent-contact {
    font-size: 12px;
    color: #666;
}

.property-price-section {
    text-align: right;
    padding: 20px 15px;
    border-left: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    min-width: 200px;
}

.property-price-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
}

.property-price {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: auto;
}

.property-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: auto;
    align-items: center;
}

.btn-whatsapp {
    width: 45px;
    height: 45px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-whatsapp svg {
    width: 22px;
    height: 22px;
}

.btn-whatsapp:hover {
    background: #20BA5A;
    transform: scale(1.05);
}

.btn-more-details {
    background: #ad1d28;
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
    flex: 1;
    white-space: nowrap;
}

.btn-more-details:hover {
    background: #8f1821;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(173, 29, 40, 0.3);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
}

.pagination button {
    width: 35px;
    height: 35px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}

.pagination button.active {
    background: #c9302c;
    color: white;
    border-color: #c9302c;
    transform: scale(1.1);
}

.pagination button:hover:not(.active) {
    border-color: #c9302c;
    color: #c9302c;
    transform: translateY(-2px);
}

/* Footer */
footer {
    background: white;
    padding: 40px 50px 20px;
    margin-top: 60px;
    text-align: center;
}

.footer-logo {
    margin-bottom: 15px;
}

.footer-logo h3 {
    font-size: 28px;
    font-weight: 700;
    color: #c9302c;
}

.footer-logo p {
    font-size: 11px;
    color: #666;
    letter-spacing: 2px;
}

.footer-text {
    font-size: 10px;
    line-height: 1.8;
    color: #666;
    margin: 20px 0;
}

.copyright {
    font-size: 10px;
    color: #999;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        padding: 20px;
    }

    .sidebar {
        width: 100%;
        position: static;
        margin-bottom: 20px;
    }

    .property-card {
        flex-direction: column;
    }

    .property-image {
        width: 100%;
        height: 250px;
    }

    .property-price-section {
        border-left: none;
        border-top: 1px solid #eee;
        padding-top: 15px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .main-content {
        display: block;
        width: 100%;
    }

    /* Responsiveness for property cards */
    .property-card {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .property-image img {
        height: auto;
    }

    .property-info {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .property-card {
        padding: 10px;
    }
    
    .property-image {
        height: 200px;
    }
}

/* Botón de filtros flotante para móvil */
.floating-filters {
    display: none;
}

@media (max-width: 1024px) {
    .floating-filters {
        display: flex;
        position: fixed;
        bottom: 20px;
        left: 20px;
        background: var(--color-primary);
        color: white;
        padding: 12px 24px;
        border-radius: 30px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        z-index: 100;
        align-items: center;
        gap: 8px;
        border: none;
        cursor: pointer;
        font-weight: 600;
        font-size: 14px;
        transition: all 0.3s ease;
    }
    
    .floating-filters:active {
        transform: scale(0.95);
    }
    
    /* Sidebar como modal en móvil */
    .sidebar.active {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: white;
        z-index: 1001;
        overflow-y: auto;
        padding: 70px 20px 20px;
        display: block;
    }
    
    .sidebar-close {
        display: block;
        position: absolute;
        top: 20px;
        right: 20px;
        background: none;
        border: none;
        font-size: 30px;
        color: var(--color-primary);
        cursor: pointer;
        z-index: 1002;
    }
}

/* Botón de filtros flotante para móvil */
.floating-filters {
    display: none;
}

@media (max-width: 1024px) {
    .floating-filters {
        display: flex;
        position: fixed;
        bottom: 20px;
        left: 20px;
        background: var(--color-primary);
        color: white;
        padding: 12px 24px;
        border-radius: 30px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        z-index: 100;
        align-items: center;
        gap: 8px;
        border: none;
        cursor: pointer;
        font-weight: 600;
        font-size: 14px;
        transition: all 0.3s ease;
    }
    
    .floating-filters:active {
        transform: scale(0.95);
    }
    
    /* Sidebar como modal en móvil */
    .sidebar.active {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: white;
        z-index: 1001;
        overflow-y: auto;
        padding: 70px 20px 20px;
    }
}
