/* ============================================
   СЕКЦИЯ ВЫБОРА КВАРТИР (ОБНОВЛЕННАЯ)
   ============================================ */

.apartments-section {
    padding: 60px 0;
    background: #fff;
}

.apartments-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.apartments-main-title {
    font-family: 'Manrope', sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 30px 0;
    text-align: center;
}

/* ========== ТАБЫ ========== */
.apartments-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 40px;
    justify-content: center;
}

.tab-btn {
    padding: 10px 24px;
    background: #f0f0f0;
    border: none;
    border-radius: 20px;
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: #e0e0e0;
}

.tab-btn.active {
    background: #856639;
    color: #fff;
}

/* ========== КОНТЕНТ ТАБОВ ========== */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========== ВЕРХНЯЯ ПАНЕЛЬ ========== */
.apartments-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

/* ========== СЧЕТЧИК ========== */
.apartments-counter {
    font-family: 'Manrope', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

/* Переключатель вида (в верхней панели) */
.view-switcher {
    display: flex;
    gap: 0;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 4px;
}

.view-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #717676;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-btn:hover {
    color: #1a1a1a;
}

.view-btn.active {
    background: #fff;
    color: #856639;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ========== ФИЛЬТРЫ ========== */
.apartments-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: flex-end;
}

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

.filter-group label {
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #717676;
}

.filter-select {
    padding: 10px 18px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    min-width: 180px;
    transition: all 0.2s ease;
}

.filter-select:hover {
    border-color: #856639;
}

.filter-select:focus {
    outline: none;
    border-color: #856639;
    box-shadow: 0 0 0 3px rgba(133, 102, 57, 0.1);
}

/* Фильтр комнат */
.rooms-filter {
    display: flex;
    gap: 6px;
}

.room-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.room-btn:hover {
    border-color: #856639;
    background: #faf8f5;
}

.room-btn.active {
    background: #856639;
    color: #fff;
    border-color: #856639;
}

/* ========== ВИД: СПИСОК ========== */
.apartments-list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.apartment-list-item {
    display: flex;
    align-items: center;
    padding: 18px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apartment-list-item:hover {
    border-color: #856639;
    box-shadow: 0 2px 8px rgba(133, 102, 57, 0.15);
}

.list-item-image {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 18px;
    flex-shrink: 0;
}

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

.list-item-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.list-item-title {
    font-family: 'Manrope', sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.list-item-details {
    display: flex;
    gap: 15px;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    color: #717676;
}

.list-item-price {
    font-family: 'Manrope', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #856639;
    white-space: nowrap;
}

/* ========== ВИД: ПЛИТКА ========== */
.apartments-grid-view {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.apartment-grid-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apartment-grid-item:hover {
    border-color: #856639;
    box-shadow: 0 4px 12px rgba(133, 102, 57, 0.15);
    transform: translateY(-2px);
}

.grid-item-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

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

.grid-item-content {
    padding: 18px;
}

.grid-item-title {
    font-family: 'Manrope', sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.grid-item-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    color: #717676;
    margin-bottom: 12px;
}

.grid-item-price {
    font-family: 'Manrope', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #856639;
}

/* ========== ВИД: ШАХМАТКА (ОБНОВЛЕННАЯ) ========== */

/* Легенда */
.chess-legend {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    color: #1a1a1a;
}

.legend-color {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.legend-color.available {
    background: #e8dcc8;
}

.legend-color.sold {
    background: #e8e8e8;
}

.legend-color.reserved {
    background: #d0d0d0;
}

/* Шахматка */
.chess-board {
    background: #fafafa;
    border-radius: 12px;
    padding: 20px;
    overflow-x: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chess-floor {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.floor-number {
    width: 50px;
    text-align: center;
    font-family: 'Manrope', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #717676;
    flex-shrink: 0;
}

.floor-apartments {
    display: flex;
    gap: 10px;
}

.chess-apartment {
    width: 120px;
    height: 120px;
    padding: 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.chess-apartment.available {
    background: #e8dcc8;
}

.chess-apartment.available:hover {
    background: #856639;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(133, 102, 57, 0.3);
}

.chess-apartment.available:hover .apt-rooms,
.chess-apartment.available:hover .apt-area,
.chess-apartment.available:hover .apt-price {
    color: #fff;
}

.chess-apartment.sold {
    background: #e8e8e8;
    cursor: not-allowed;
    opacity: 0.6;
}

.chess-apartment.reserved {
    background: #d0d0d0;
    cursor: not-allowed;
    opacity: 0.7;
}

.apt-rooms {
    font-family: 'Manrope', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 6px;
    line-height: 1;
}

.apt-area {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    color: #717676;
    margin-bottom: 8px;
    line-height: 1.2;
}

.apt-price {
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #856639;
    line-height: 1.3;
    text-align: center;
}

/* ========== ПАРКИНГ ========== */
.parking-info {
    padding: 40px;
    background: #f9f9f9;
    border-radius: 12px;
    text-align: center;
}

.parking-info h3 {
    font-family: 'Manrope', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.parking-info p {
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    color: #717676;
    margin-bottom: 8px;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО КВАРТИРЫ (ОБНОВЛЕННОЕ)
   ============================================ */

.apartment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
}

.apartment-modal.active {
    display: block;
}

.modal-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 480px;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 2001;
    animation: slideInRight 0.3s ease;
    overflow-y: auto;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.modal-plan-image {
    width: 100%;
    height: 320px;
    overflow: hidden;
    background: #f5f5f5;
}

.modal-plan-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
}

.modal-apartment-info {
    padding: 30px;
}

#modalApartmentTitle {
    font-family: 'Manrope', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.modal-price {
    font-family: 'Manrope', sans-serif;
    font-size: 30px;
    font-weight: 700;
    color: #856639;
    margin-bottom: 25px;
}

.modal-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8e8e8;
}

.detail-label {
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    color: #717676;
}

.detail-value {
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

.btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    background: #25D366;
    border: none;
    border-radius: 12px;
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-whatsapp:hover {
    background: #20BA5A;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    transform: translateY(-1px);
}