@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

:root {
    --main-color: #000;
    --accent-color: #628b35;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #e9e5e5;
    color: var(--main-color);
}

/* ========== ФИКСИРОВАННАЯ КОРЗИНА И ПРОФИЛЬ ========== */
.cart-icon-wrapper {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    background: var(--accent-color);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s, background 0.2s;
    cursor: pointer;
}
.cart-icon-wrapper:hover {
    transform: scale(1.05);
    background: #4a6b27;
}
.cart-fixed-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
}
.cart-icon-wrapper img {
    width: 32px;
    height: 32px;
    filter: brightness(0) invert(1);
}
.cart-count-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e3342f;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.profile-icon-wrapper {
    position: fixed;
    top: 20px;
    right: 90px;
    z-index: 1001;
    background: #2c3e50;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s, background 0.2s;
    cursor: pointer;
}
.profile-icon-wrapper:hover {
    transform: scale(1.05);
    background: #1a252f;
}
.profile-fixed-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
}
.profile-icon-wrapper img {
    width: 32px;
    height: 32px;
    filter: brightness(0) invert(1);
}

@media (max-width: 768px) {
    .cart-icon-wrapper {
        width: 48px;
        height: 48px;
        top: 12px;
        right: 12px;
    }
    .cart-icon-wrapper img {
        width: 26px;
        height: 26px;
    }
    .cart-count-badge {
        width: 20px;
        height: 20px;
        font-size: 10px;
        top: -4px;
        right: -4px;
    }
    .profile-icon-wrapper {
        width: 48px;
        height: 48px;
        top: 12px;
        right: 72px;
    }
    .profile-icon-wrapper img {
        width: 26px;
        height: 26px;
    }
}
@media (max-width: 480px) {
    .profile-icon-wrapper {
        right: 68px;
        width: 40px;
        height: 40px;
        top: 10px;
    }
    .profile-icon-wrapper img {
        width: 22px;
        height: 22px;
    }
    .cart-icon-wrapper {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }
    .cart-icon-wrapper img {
        width: 22px;
        height: 22px;
    }
    .cart-count-badge {
        width: 18px;
        height: 18px;
        font-size: 9px;
        top: -3px;
        right: -3px;
    }
}

/* ========== HEADER ========== */
.main__header {
    padding: 10px 0;
    box-shadow: inset 0px -1px 0px rgba(0,0,0,0.1);
    background-color: #f9f9f9;
}
.header__container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 55px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.menu__body {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.menu__list {
    display: flex;
    align-items: center;
    column-gap: 40px;
    list-style: none;
}
.menu__link {
    text-decoration: none;
    color: var(--main-color);
    font-weight: 500;
    transition: color 0.3s;
}
.menu__link:hover { color: var(--accent-color); }
.logo {
    font-size: 35px;
    font-weight: 700;
}
.logo-link {
    display: inline-flex;
    align-items: baseline;
    text-decoration: none;
    color: var(--main-color);
}
.logo-sub {
    font-size: 24px;
    font-weight: 400;
    margin-left: 2px;
}
@media (max-width: 768px) {
    .header__container { justify-content: center; gap: 15px; padding: 0 20px; }
    .menu__list { column-gap: 20px; }
    .logo-sub { font-size: 18px; }
}

/* ========== СТРАНИЦА ГАЛЕРЕИ ========== */
.gallery-page {
    max-width: 1920px;
    margin: 40px auto;
    padding: 0 55px;
}
.gallery-title {
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 30px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .gallery-page {
        padding: 0 20px;
    }
}

/* Плитка */
.gallery-tile {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}
.gallery-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.tile-slider {
    position: relative;
    overflow: hidden;
    height: 280px;
    background: #f0f0f0;
    cursor: pointer;
}
.tile-slider-inner {
    display: flex;
    transition: transform 0.2s ease;
    height: 100%;
}
.tile-slide {
    flex: 0 0 100%;
    height: 100%;
}
.tile-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* Убрано pointer-events: none, чтобы изображения были кликабельны */
    cursor: pointer;
}
.tile-slider-loading, .tile-no-images, .tile-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #777;
    font-size: 14px;
}

.tile-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.tile-count {
    font-size: 13px;
    color: #777;
}
.tile-detail-btn {
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-start;
    transition: background 0.2s;
    margin-top: 6px;
}
.tile-detail-btn:hover {
    background: #4a6b27;
}

/* Описание под плиткой */
.tile-description {
    padding: 10px 15px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    display: none;
}

/* Кнопка "Показать ещё" и загрузчик */
.load-more-btn {
    display: block;
    margin: 40px auto 20px;
    padding: 12px 40px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}
.load-more-btn:hover {
    background: #4a6b27;
}
.loader-more {
    text-align: center;
    padding: 20px;
    font-size: 16px;
    color: #777;
}

/* ========== МОДАЛЬНОЕ ОКНО ДЛЯ ЗУМА ========== */
.zoom-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    justify-content: center;
    align-items: center;
}
.zoom-modal-content {
    display: block;
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    margin: 20px auto;
}
.zoom-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 2001;
}
.zoom-close:hover {
    color: #bbb;
}

/* ========== ФУТЕР И ОБЩИЕ МОДАЛКИ ========== */
footer {
    margin-top: 60px;
    background: #fff;
    border-top: 1px solid #ddd;
    padding: 40px 20px 20px;
}
.footer-top {
    max-width: 1200px;
    margin: 0 auto 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}
.footer-left .logo { font-size: 28px; }
.phone-label { font-size: 12px; color: #999; }
.phone-number { font-size: 22px; font-weight: 500; text-decoration: none; color: #000; display: inline-block; margin: 8px 0 15px; }
.footer-nav { display: flex; gap: 40px; flex-wrap: wrap; }
.footer-column ul { list-style: none; }
.footer-column a { text-decoration: none; color: #777; font-size: 14px; }
.footer-column a:hover { color: var(--accent-color); }
.footer-bottom {
    text-align: center;
    font-size: 12px;
    color: #999;
    border-top: 1px solid #ddd;
    padding-top: 15px;
}
.modal {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}
.modal .modal-content {
    background: #fff;
    margin: 20% auto;
    padding: 20px;
    width: 80%;
    max-width: 500px;
    border-radius: 12px;
}
.modal .close {
    float: right;
    font-size: 28px;
    cursor: pointer;
}