/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f8f9fa;
    color: #222;
    line-height: 1.5;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== HEADER ===== */
.header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.logo a {
    font-size: 1.2rem;
    font-weight: 600;
    color: #222;
    text-decoration: none;
}
.logo span {
    color: #3f8ae0;
}
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}
.main-nav a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    font-size: 0.95rem;
}
.main-nav a:hover {
    color: #3f8ae0;
}

/* ===== HERO ===== */
.hero {
    background: #fff;
    padding: 25px 0 15px;
    border-bottom: 1px solid #eee;
}
.hero h1 {
    font-size: 2rem;
    font-weight: 700;
}
.hero .subtitle {
    font-size: 1.1rem;
    color: #666;
}

/* ===== ОСНОВНОЙ БЛОК ===== */
.apartment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

/* ----- Галерея ----- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.gallery-item {
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.gallery-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    transition: transform 0.3s;
}
.gallery-item img:hover {
    transform: scale(1.03);
}
.gallery-note {
    font-size: 0.85rem;
    color: #888;
    margin-top: 8px;
}

/* ----- Информация ----- */
.price-block {
    margin-bottom: 15px;
}
.price {
    font-size: 2rem;
    font-weight: 700;
    color: #e74c3c;
}
.per-night {
    font-size: 1rem;
    color: #888;
}
.features ul {
    list-style: none;
    padding: 0;
}
.features li {
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
}

/* ----- Форма ----- */
.booking-form {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    margin-top: 20px;
}
.booking-form h3 {
    margin-bottom: 15px;
}
.form-row {
    margin-bottom: 12px;
}
.form-row label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 0.9rem;
}
.form-row input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

/* ----- Кнопки ----- */
.btn {
    display: inline-block;
    background: #3f8ae0;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}
.btn:hover {
    background: #2a6cb8;
}
.btn-primary {
    background: #ffd500;
    color: #222;
}
.btn-primary:hover {
    background: #f0c000;
}
.btn-secondary {
    background: #fff;
    color: #3f8ae0;
    border: 2px solid #3f8ae0;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}
.btn-secondary:hover {
    background: #3f8ae0;
    color: #fff;
}
.btn-large {
    padding: 14px 35px;
    font-size: 1.1rem;
}
.form-note {
    font-size: 0.85rem;
    color: #888;
    margin-top: 10px;
}

/* ===== ОПИСАНИЕ ===== */
.apartment-description {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    margin-top: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.apartment-description h2 {
    margin-bottom: 15px;
    font-size: 1.4rem;
}
.apartment-description ul {
    padding-left: 20px;
}

/* ===== КАЛЬКУЛЯТОР ===== */
.price-calculator {
    margin-top: 15px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
}
.price-calculator > div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.price-calculator > div:first-child > div {
    margin: 4px 0;
}
.price-calculator #calcDays {
    font-size: 1.1rem;
    font-weight: 600;
}
.price-calculator #calcSum {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e74c3c;
}
.price-calculator > div:last-child {
    font-size: 0.85rem;
    color: #888;
    margin-top: 5px;
    text-align: center;
}

/* ===== МОДАЛКА ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0,0,0,0.85);
    padding: 15px;
}
.modal-content {
    background: #fff;
    margin: 20px auto;
    padding: 15px;
    border-radius: 10px;
    max-width: 900px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}
.close-btn {
    position: sticky;
    top: 0;
    float: right;
    font-size: 2rem;
    font-weight: 700;
    color: #aaa;
    cursor: pointer;
    background: #fff;
    padding: 0 12px;
    border-radius: 50%;
    line-height: 1;
    z-index: 10;
}
.close-btn:hover {
    color: #222;
}
.modal-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 10px;
}
.modal-gallery-item {
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.modal-gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}
.modal-gallery-item img:hover {
    transform: scale(1.03);
}

/* ===== ПРОЧИЕ СТРАНИЦЫ ===== */
.page-contacts, .page-terms, .payment-page, .success-page, .fail-page {
    padding: 30px 0;
    background: #fff;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.contacts-block .contact-item {
    margin-bottom: 12px;
}
.error-list {
    color: #d32f2f;
    padding-left: 20px;
}
.payment-details {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}
.total-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e74c3c;
}

/* ===== FOOTER ===== */
.footer {
    background: #fff;
    border-top: 1px solid #eee;
    padding: 25px 0 10px;
    margin-top: 30px;
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}
.footer-contacts p {
    margin: 4px 0;
}
.footer-payment {
    text-align: right;
}
.footer-payment img {
    max-width: 100px;
}
.footer-bottom {
    text-align: center;
    padding-top: 15px;
    font-size: 0.85rem;
    color: #aaa;
    border-top: 1px solid #f0f0f0;
    margin-top: 15px;
}

/* ========================================================= */
/* ========== АДАПТИВНОСТЬ (mobile-first) ========== */
/* ========================================================= */

/* Планшеты и мелкие ноутбуки */
@media (max-width: 1024px) {
    .apartment-grid {
        gap: 20px;
    }
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .gallery-item img {
        height: 110px;
    }
}

/* Мобильные (ширина ≤ 768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
    .apartment-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 20px 0;
    }
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .gallery-item img {
        height: 100px;
    }
    .hero h1 {
        font-size: 1.6rem;
    }
    .hero .subtitle {
        font-size: 1rem;
    }
    .price {
        font-size: 1.6rem;
    }
    .booking-form {
        padding: 15px;
    }
    .btn {
        padding: 10px 20px;
        font-size: 0.95rem;
        width: 100%;
        text-align: center;
    }
    .btn-secondary {
        width: 100%;
        text-align: center;
    }
    .btn-large {
        padding: 12px 20px;
        font-size: 1rem;
    }
    .apartment-description {
        padding: 15px;
    }
    .apartment-description h2 {
        font-size: 1.2rem;
    }
    .modal-content {
        margin: 10px;
        padding: 10px;
    }
    .modal-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .modal-gallery-item img {
        height: 120px;
    }
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
    .footer-payment {
        text-align: center;
    }
    .header-inner {
        flex-direction: column;
        gap: 8px;
    }
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }
    .main-nav a {
        font-size: 0.85rem;
    }
    .price-calculator #calcSum {
        font-size: 1.3rem;
    }
    .price-calculator > div:first-child {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}

/* Очень маленькие телефоны (≤ 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 8px;
    }
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        gap: 5px;
    }
    .gallery-item img {
        height: 80px;
    }
    .hero h1 {
        font-size: 1.3rem;
    }
    .hero .subtitle {
        font-size: 0.9rem;
    }
    .price {
        font-size: 1.4rem;
    }
    .features li {
        font-size: 0.85rem;
    }
    .booking-form {
        padding: 12px;
    }
    .form-row input {
        font-size: 0.9rem;
        padding: 8px 10px;
    }
    .btn {
        font-size: 0.9rem;
        padding: 10px 16px;
    }
    .apartment-description {
        padding: 12px;
    }
    .apartment-description h2 {
        font-size: 1.1rem;
    }
    .modal-gallery {
        grid-template-columns: 1fr 1fr;
    }
    .modal-gallery-item img {
        height: 100px;
    }
    .price-calculator #calcSum {
        font-size: 1.1rem;
    }
}