
:root { 
    --primary-color: #2c3e50; 
    --accent-color: #e74c3c; 
    --bg-light: #f8f9fa; 
    --text-dark: #333; 
    --border-color: #ddd; 
}

* {
    box-sizing: border-box;
}

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    margin: 0; 
    padding: 0; 
    color: var(--text-dark); 
    line-height: 1.5; 
    background: #f5f5f5;
}

.container { 
    max-width: 1100px; 
    margin: 0 auto; 
    padding: 15px; 
}

/* Логотип */
.logo-container {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: opacity 0.3s, transform 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.logo-container:hover {
    opacity: 0.8;
}

.logo-container:active {
    transform: scale(0.98);
}

.logo-container img {
    max-width: 200px;
    height: auto;
    display: inline-block;
    pointer-events: none;
}

@media (hover: none) {
    .logo-container:hover {
        opacity: 1;
    }
}

/* Заголовок с бейджем */
.header-with-badge { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    flex-wrap: wrap; 
    gap: 12px; 
    margin-bottom: 20px; 
    background: white;
    padding: 20px 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-with-badge h1 { 
    margin: 0; 
    color: var(--primary-color); 
    font-size: 1.5rem; 
    text-align: center; 
    line-height: 1.3;
    word-break: break-word;
}

.apartment-id-badge { 
    background: var(--primary-color); 
    color: white; 
    padding: 6px 16px; 
    border-radius: 20px; 
    font-size: 0.9rem; 
    font-weight: 600; 
    letter-spacing: 0.5px; 
    opacity: 0.9; 
    transition: opacity 0.3s; 
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    white-space: nowrap; 
}

.apartment-id-badge:hover { 
    opacity: 1; 
}

.apartment-id-badge i { 
    font-size: 0.8rem; 
    color: var(--accent-color); 
}

/* Галерея */
.gallery-grid { 
    display: grid; 
    grid-template-columns: repeat(5, 1fr); 
    gap: 8px; 
    margin-bottom: 20px; 
}

.gallery-item { 
    position: relative; 
    overflow: hidden; 
    border-radius: 8px; 
    cursor: pointer; 
    aspect-ratio: 1 / 1; 
    background-color: #eee; 
    width: 100%; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.gallery-item img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.3s ease; 
    display: block; 
}

.gallery-item:hover img { 
    transform: scale(1.1); 
}

/* Модальное окно */
.modal { 
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.95); 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
}

.modal-content-wrapper { 
    position: relative; 
    width: 95%; 
    height: 80vh; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
}

.modal-content { 
    max-width: 100%; 
    max-height: 100%; 
    border-radius: 8px; 
    box-shadow: 0 0 20px rgba(0,0,0,0.5); 
    object-fit: contain; 
}

.close-modal { 
    position: absolute; 
    top: 15px; 
    right: 20px; 
    color: #f1f1f1; 
    font-size: 40px; 
    font-weight: bold; 
    cursor: pointer; 
    z-index: 1001; 
    line-height: 1;
}

.close-modal:hover { 
    color: var(--accent-color); 
}

.prev-btn, .next-btn { 
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    color: white; 
    font-size: 30px; 
    font-weight: bold; 
    cursor: pointer; 
    padding: 12px; 
    user-select: none; 
    background: rgba(0,0,0,0.3); 
    border-radius: 5px; 
    z-index: 1001; 
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.prev-btn:hover, .next-btn:hover { 
    background: rgba(0,0,0,0.8); 
    color: var(--accent-color); 
}

.prev-btn { 
    left: 5px; 
} 

.next-btn { 
    right: 5px; 
}

.caption { 
    position: absolute; 
    bottom: 15px; 
    width: 100%; 
    text-align: center; 
    color: #ccc; 
    font-size: 1rem; 
    z-index: 1001; 
    background: rgba(0,0,0,0.5);
    padding: 8px;
}

/* Информация */
.info-section { 
    background: white; 
    padding: 20px; 
    border-radius: 10px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    margin-bottom: 20px; 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: space-between; 
    align-items: center; 
}

.address-block { 
    flex: 1; 
    min-width: 280px; 
    margin-bottom: 15px; 
}

.address-link { 
    display: inline-flex; 
    align-items: center; 
    text-decoration: none; 
    color: var(--primary-color); 
    font-size: 1.1rem; 
    font-weight: bold; 
    border-bottom: 2px solid transparent; 
    transition: 0.3s; 
    word-break: break-word;
    line-height: 1.3;
}

.address-link:hover { 
    border-bottom: 2px solid var(--accent-color); 
    color: var(--accent-color); 
}

.address-link i { 
    margin-right: 10px; 
    color: var(--accent-color); 
    font-size: 1.3rem; 
    flex-shrink: 0;
}

.price-block { 
    text-align: right; 
    min-width: 180px; 
}

.price-tag { 
    font-size: 1.8rem; 
    font-weight: bold; 
    color: var(--primary-color); 
    line-height: 1.2;
}

.price-period { 
    font-size: 0.9rem; 
    color: #777; 
}

.contact-block { 
    width: 100%; 
    text-align: center; 
    margin-top: 15px; 
    padding-top: 15px; 
    border-top: 1px solid #eee; 
}

/* Кнопки */
.phone-btn { 
    display: inline-block; 
    background-color: var(--primary-color); 
    color: white; 
    padding: 14px 30px; 
    border-radius: 50px; 
    text-decoration: none; 
    font-size: 1.1rem; 
    transition: 0.3s; 
    margin-bottom: 15px; 
    width: 100%;
    max-width: 300px;
}

.phone-btn:hover { 
    background-color: var(--accent-color); 
    transform: translateY(-2px); 
}

.phone-btn i { 
    margin-right: 8px; 
}

.messengers-container { 
    display: flex; 
    justify-content: center; 
    gap: 10px; 
    flex-wrap: wrap; 
    margin-top: 10px; 
}

.messenger-btn { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    padding: 12px 15px; 
    border-radius: 50px; 
    text-decoration: none; 
    color: white; 
    font-weight: 600; 
    font-size: 0.95rem; 
    transition: transform 0.2s, opacity 0.2s; 
    min-width: 120px; 
    flex: 1 1 auto;
}

.messenger-btn:hover { 
    transform: translateY(-2px); 
    opacity: 0.9; 
}

.messenger-btn i { 
    margin-right: 8px; 
    font-size: 1.2rem; 
}

.btn-whatsapp { 
    background-color: #25D366; 
}

.btn-telegram { 
    background-color: #0088cc; 
}

.btn-max { 
    background-color: #8e44ad; 
}

/* Характеристики и описание */
.details-section { 
    background: white; 
    padding: 20px; 
    border-radius: 10px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    margin-bottom: 20px; 
}

.specs-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); 
    gap: 15px; 
    margin-bottom: 20px; 
    text-align: center; 
}

.spec-item { 
    background: var(--bg-light); 
    padding: 12px; 
    border-radius: 8px; 
    border: 1px solid #eee; 
}

.spec-item i { 
    font-size: 1.6rem; 
    color: var(--accent-color); 
    margin-bottom: 8px; 
    display: block; 
}

.spec-label { 
    font-size: 0.8rem; 
    color: #777; 
    margin-bottom: 4px; 
    display: block; 
}

.spec-value { 
    font-size: 1rem; 
    font-weight: bold; 
    color: var(--primary-color); 
    word-break: break-word;
}

.description-text { 
    font-size: 1rem; 
    line-height: 1.6; 
    color: #444; 
    border-top: 1px solid #eee; 
    padding-top: 15px; 
}

.description-title { 
    font-size: 1.2rem; 
    font-weight: bold; 
    color: var(--primary-color); 
    margin-bottom: 10px; 
    display: block; 
}

/* Форма */
.booking-form-container { 
    background: white; 
    padding: 20px; 
    border-radius: 10px; 
    border: 1px solid #e1e1e1; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.booking-form-container h2 { 
    margin-top: 0; 
    margin-bottom: 20px;
    color: var(--primary-color); 
    text-align: center; 
    font-size: 1.4rem;
}

form { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
}

.form-group { 
    display: flex; 
    flex-direction: column; 
}

.form-group.full-width { 
    grid-column: 1 / -1; 
}

label { 
    margin-bottom: 6px; 
    font-weight: 600; 
    font-size: 0.9rem; 
}

input[type="text"], 
input[type="tel"], 
input[type="date"], 
input[type="email"] { 
    padding: 12px; 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    font-size: 1rem; 
    outline: none; 
    background: white; 
    cursor: pointer; 
    width: 100%;
    -webkit-appearance: none;
}

input:focus { 
    border-color: var(--primary-color); 
}

.contact-method-label {
    grid-column: 1 / -1;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-color);
    margin: 5px 0 0 0;
    padding-left: 5px;
}

.contact-method-group { 
    grid-column: 1 / -1; 
    display: flex; 
    gap: 10px; 
    margin-top: 5px; 
    flex-wrap: wrap;
}

.contact-option { 
    flex: 1 1 200px; 
    position: relative; 
}

.contact-option input { 
    position: absolute; 
    opacity: 0; 
    cursor: pointer; 
    height: 0; 
    width: 0; 
}

.contact-option label { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    padding: 12px; 
    background: white; 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    font-weight: normal; 
    margin-bottom: 0; 
    gap: 8px; 
    text-align: center;
}

.contact-option label i { 
    font-size: 1.1rem; 
}

.contact-option input:checked + label { 
    background-color: var(--primary-color); 
    color: white; 
    border-color: var(--primary-color); 
    font-weight: 600; 
}

.contact-option input:checked + label i { 
    color: white; 
}

.contact-option label:hover { 
    border-color: var(--primary-color); 
    background-color: #f0f4f8; 
}

.checkbox-group { 
    grid-column: 1 / -1; 
    display: flex; 
    align-items: flex-start; 
    gap: 10px; 
    font-size: 0.9rem; 
    flex-wrap: wrap;
}

.checkbox-group input { 
    margin-top: 5px; 
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

button.submit-btn { 
    grid-column: 1 / -1; 
    background-color: var(--accent-color); 
    color: white; 
    border: none; 
    padding: 15px; 
    font-size: 1.1rem; 
    font-weight: bold; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: 0.3s; 
    text-transform: uppercase; 
    width: 100%;
}

button.submit-btn:hover { 
    background-color: #c0392b; 
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .logo-container img {
        max-width: 150px;
    }
    
    .header-with-badge { 
        flex-direction: column; 
        padding: 15px 10px;
    }
    
    .header-with-badge h1 { 
        font-size: 1.3rem; 
    }
    
    .apartment-id-badge {
        font-size: 0.8rem;
        padding: 5px 12px;
    }
    
    .gallery-grid {
        gap: 5px;
    }
    
    form { 
        grid-template-columns: 1fr; 
        gap: 12px;
    }
    
    .info-section { 
        flex-direction: column; 
        text-align: center; 
        padding: 15px;
    }
    
    .address-block {
        text-align: center;
        min-width: auto;
    }
    
    .address-link {
        justify-content: center;
        font-size: 1rem;
    }
    
    .address-link i {
        margin-right: 5px;
    }
    
    .price-block { 
        text-align: center; 
        margin-top: 10px; 
    }
    
    .price-tag {
        font-size: 1.6rem;
    }
    
    .messenger-btn {
        min-width: 100px;
        font-size: 0.9rem;
        padding: 10px 12px;
    }
    
    .specs-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px;
    }
    
    .spec-item {
        padding: 10px;
    }
    
    .spec-item i {
        font-size: 1.4rem;
    }
    
    .prev-btn, .next-btn { 
        font-size: 24px; 
        width: 40px;
        height: 40px;
        padding: 8px;
    }
    
    .contact-method-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .contact-option {
        flex: 1 1 auto;
    }
    
    .contact-option label {
        padding: 10px;
    }
    
    .booking-form-container h2 {
        font-size: 1.3rem;
    }
    
    input[type="text"], 
    input[type="tel"], 
    input[type="date"], 
    input[type="email"] {
        padding: 10px;
    }
    
    .checkbox-group {
        font-size: 0.85rem;
    }
    
    .checkbox-group input {
        width: 16px;
        height: 16px;
    }
    
    button.submit-btn {
        padding: 14px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .header-with-badge h1 { 
        font-size: 1.2rem; 
    }
    
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .specs-grid { 
        grid-template-columns: 1fr 1fr; 
    }
    
    .messengers-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .messenger-btn {
        width: 100%;
    }
    
    .phone-btn {
        max-width: 100%;
        padding: 12px 20px;
    }
    
    .address-link {
        font-size: 0.95rem;
    }
    
    .price-tag {
        font-size: 1.5rem;
    }
    
    .modal-content-wrapper {
        width: 100%;
        height: 70vh;
    }
    
    .prev-btn, .next-btn {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

@media (max-width: 360px) {
    .specs-grid { 
        grid-template-columns: 1fr; 
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-with-badge h1 { 
        font-size: 1.1rem; 
    }
}

button.gallery-item, .modal button {border:0; font-family:inherit}
button.gallery-item {padding:0;display:block}
.modal .close-modal {background:transparent}
.modal-content {touch-action:pan-y pinch-zoom;user-select:none;-webkit-user-drag:none;cursor:grab}
.modal-content.dragging {cursor:grabbing;transform:translateX(var(--drag-x,0px))}
.gallery-empty {grid-column:1/-1;text-align:center;color:#666}
@media(prefers-reduced-motion:reduce){.modal-content.dragging {transform:none}}
