/* ==========================================
   1. БАЗОВЫЕ СТИЛИ И СБРОС СЕЛЕКТОРОВ
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
}

body {
    background-color: #fcfaf7;
    color: #3c3c3c;
    line-height: 1.5;
}

/* Верхний зеленый инфо-бар */
.top-bar {
    background-color: #7fa99b;
    color: #fff;
    padding: 10px 5%;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.top-nav a {
    color: #fff;
    text-decoration: none;
    margin-left: 15px;
}
.top-nav a:hover {
    text-decoration: underline;
}

/* Главная шапка сайта */
.main-header {
    background-color: #fff;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Обновленный блок логотипа (Значок + Текст в одну линию) */
.logo {
    display: flex;
    align-items: center;
}

/* Настройка размеров значка хлопка */
.logo-icon {
    height: 45px;      /* Оптимальная высота значка для аккуратной шапки */
    width: auto;       /* Пропорции сохраняются автоматически */
    display: block;
    object-fit: contain;
}

/* Возвращаем ваши старые текстовые стили надписи */
.logo-text {
    font-size: 24px;   /* Чуть уменьшили шрифт, так как рядом появилась иконка */
    font-weight: 800;
    color: #557a6d;
    letter-spacing: 1px;
    white-space: nowrap; /* Чтобы надпись не переносилась на мобильных */
}
.logo-text span {
    color: #df9c87;
}

/* Компактный вид на смартфонах */
@media (max-width: 768px) {
    .logo-icon {
        height: 35px;  /* На мобильных делаем значок чуть меньше */
    }
    .logo-text {
        font-size: 20px; /* И шрифт надписи тоже пропорционально уменьшаем */
    }
}


.header-contacts {
    text-align: right;
}
.phone {
    font-size: 18px;
    font-weight: bold;
    color: #3c3c3c;
}
.email {
    font-size: 12px;
    color: #7f8c8d;
}

/* ==========================================
   2. ПРОМО-БАННЕР И ЖИВОЙ ПОИСК
   ========================================== */
.hero-banner {
    background: linear-gradient(135deg, #f3e9dc, #e5ded4);
    padding: 45px 5%;
    margin: 20px 5%;
    border-radius: 12px;
}
.hero-banner h1 {
    font-size: 30px;
    color: #435e55;
    margin-bottom: 10px;
}
.hero-banner p {
    color: #666;
    margin-bottom: 20px;
    max-width: 700px;
}

.features .badge {
    background-color: #fff;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: bold;
    color: #557a6d;
    margin-right: 12px;
    display: inline-block;
    box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}
.features .badge-cz {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
}

.cz-icon {
    height: 16px; /* Картинка сожмется ровно по высоте текста */
    width: auto;
    display: inline-block;
    flex-shrink: 0;
}



.search-bar-container {
    margin: 0 5% 15px 5%;
}
#search-input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #e1dbd3;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}
#search-input:focus {
    border-color: #557a6d;
}
/* ==========================================
   3. НАВИГАЦИЯ КАТЕГОРИЙ И ОПТОВАЯ ПАНЕЛЬ
   ========================================== */
.categories-nav {
    margin: 0 5% 25px 5%;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.category-btn {
    background-color: #fff;
    border: 1px solid #e1dbd3;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
}
.category-btn:hover, .category-btn.active {
    background-color: #557a6d;
    color: #fff;
    border-color: #557a6d;
}
.category-btn:active {
    transform: scale(0.95);
}

/* Статус-панель проверки лимита 10 000 руб */
.order-panel {
    background-color: #fff;
    margin: 0 5% 30px 5%;
    padding: 22px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 6px solid #df9c87;
}
.rules-title {
    font-weight: bold;
    font-size: 15px;
}
.rules-alert {
    font-size: 14px;
    font-weight: 600;
    margin-top: 5px;
    color: #7f8c8d;
}
.cart-widget {
    text-align: right;
}
.cart-totals {
    font-size: 17px;
    margin-bottom: 8px;
}

.btn-checkout {
    background-color: #557a6d;
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s;
}
.btn-checkout:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* ==========================================
   4. СЕТКА КАТАЛОГА И КАРТОЧКИ ТОВАРОВ
   ========================================== */
.catalog-section {
    padding: 0 5%;
}
.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 2px solid #e8e2da;
    padding-bottom: 12px;
    margin-bottom: 25px;
}
.catalog-note {
    font-size: 13px;
    color: #7f8c8d;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-card {
    background-color: #fff;
    border: 1px solid #ededed;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease;
    animation: fadeInUp 0.5s ease backwards;
}
.product-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 10px 25px rgba(85, 122, 109, 0.12);
}

.product-img-box {
    height: 240px;
    background-color: #f7f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #f0f0f0;
}
.product-info {
    padding: 18px;
}
.product-title {
    font-size: 15px;
    font-weight: 600;
    height: 44px;
    overflow: hidden;
    margin-bottom: 12px;
    color: #2c3e50;
}
.product-meta {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 12px;
    line-height: 1.6;
}

/* Блок размеров */
.sizes-block {
    margin-top: 10px;
    margin-bottom: 12px;
}
.sizes-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #95a5a6;
    margin-bottom: 5px;
    font-weight: 600;
}
.sizes-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.wb-size-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #e1dbd3;
    border-radius: 8px;
    padding: 6px 12px;
    background-color: #fff;
    min-width: 55px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}
.wb-size-badge:hover {
    border-color: #7fa99b;
    background-color: #f0f7f4;
}
.wb-size-num {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
}
.wb-size-height {
    font-size: 11px;
    color: #7f8c8d;
    margin-top: 2px;
}

/* Оформление цен */
.price-box {
    background-color: #fbfbfb;
    padding: 12px;
    border-radius: 6px;
    border: 1px dashed #e0e0e0;
}
.price-item {
    font-size: 19px;
    font-weight: bold;
    color: #2ecc71;
}
.price-pack {
    font-size: 12px;
    color: #555;
    margin-top: 3px;
}

/* Кнопки и инпуты количества */
.card-actions {
    padding: 0 18px 18px 18px;
    display: flex;
    gap: 10px;
}
.qty-input {
    width: 65px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
    font-size: 15px;
}

.btn-add-cart {
    background-color: #557a6d;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    flex-grow: 1;
    transition: transform 0.1s;
}
.btn-add-cart:not(:disabled):active {
    transform: scale(0.97);
}
.btn-add-cart:disabled {
    background-color: #bdc3c7 !important;
    cursor: not-allowed;
    transform: none !important;
}
/* ==========================================
   5. МОДALЬНЫЕ ОКНА (ОФОРМЛЕНИЕ РЕКВИЗИТОВ)
   ========================================== */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5); z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}
.modal-window {
    background-color: #fff;
    width: 100%;
    max-width: 450px;
    border-radius: 12px;
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}
.modal-overlay.open .modal-window {
    transform: translateY(0);
}
.modal-header {
    background-color: #557a6d;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h2 {
    font-size: 18px;
}
.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}
.modal-body {
    padding: 20px;
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #444;
}
.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}
.btn-submit-order {
    background-color: #2ecc71;
    color: white;
    border: none;
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

/* ==========================================
   6. АВТОНОМНЫЙ ЖИВОЙ ЧАТ ГАЛИНЫ
   ========================================== */
.chat-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1000;
}
.chat-btn {
    background-color: #557a6d;
    color: white;
    border: none;
    padding: 14px 22px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 320px;
    height: 400px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s ease;
}
.chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.chat-header {
    background-color: #557a6d;
    color: white;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}
.manager-avatar {
    font-size: 24px;
    background: rgba(255,255,255,0.2);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.manager-name {
    font-weight: bold;
    font-size: 14px;
}
.manager-status {
    font-size: 11px;
    color: #a3e2c9;
    margin-top: 2px;
}
.chat-close {
    position: absolute;
    right: 12px;
    top: 12px;
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    opacity: 0.7;
    pointer-events: auto;
}
.chat-body {
    flex-grow: 1;
    padding: 15px;
    background-color: #fcfaf7;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    word-break: break-word;
}
.system-msg {
    background-color: #fff;
    color: #333;
    align-self: flex-start;
    border: 1px solid #eadecf;
    border-top-left-radius: 2px;
}
.user-msg {
    background-color: #557a6d;
    color: white;
    align-self: flex-end;
    border-top-right-radius: 2px;
}
.chat-footer {
    display: flex;
    border-top: 1px solid #eee;
    padding: 10px;
    background: #fff;
}
#chat-input {
    flex-grow: 1;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 12px;
    outline: none;
    font-size: 13px;
}
.chat-send {
    background: none;
    border: none;
    color: #557a6d;
    font-size: 18px;
    padding: 0 10px;
    cursor: pointer;
}

/* Обновленные стили подвала для красивого отображения блоков */
.main-footer {
    background-color: #435e55;
    color: #fff;
    padding: 40px 5%;
    margin-top: 50px;
}
.main-footer a:hover {
    color: #df9c87 !important; /* Плавное изменение цвета ссылок при наведении */
}


/* Мобильная адаптация подвала */
@media (max-width: 768px) {
    .main-footer {
        padding: 30px 20px;
        text-align: center; /* На телефонах центрируем текст */
    }
}


/* ==========================================
   7. ВСПЛЫВАЮЩИЕ УВЕДОМЛЕНИЯ И ТОСТЫ
   ========================================== */
.toast-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast-notification {
    background-color: #435e55;
    color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInLeft 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both, fadeOut 0.5s ease 2.7s forwards;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ==========================================
   8. МОБИЛЬНАЯ АДАПТИВНОСТЬ (МЕДИА-ЗАПРОСЫ)
   ========================================== */
@media (max-width: 768px) {
    .top-bar { flex-direction: column; gap: 8px; text-align: center; }
    .top-nav { display: flex; justify-content: center; gap: 10px; }
    .top-nav a { margin-left: 0; }
    .main-header { flex-direction: column; gap: 12px; text-align: center; }
    .header-contacts { text-align: center; }
    .hero-banner { padding: 30px 20px; margin: 15px 15px; text-align: center; }
    .hero-banner h1 { font-size: 22px; }
    .features .badge { margin-bottom: 8px; margin-right: 4px; }

    .order-panel { flex-direction: column; gap: 15px; text-align: center; margin: 0 15px 20px 15px; }
    .cart-widget { text-align: center; }
    .btn-checkout { width: 100%; }

    .catalog-header { flex-direction: column; align-items: center; gap: 10px; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 12px; }
    .product-card { font-size: 13px; }
    .product-title { font-size: 13px; height: 38px; }
    .card-actions { padding: 10px; flex-direction: column; gap: 8px; }
    .qty-input { width: 100%; }

    .chat-widget { bottom: 15px; right: 15px; }
    .chat-window { width: calc(100vw - 30px); right: 0; bottom: 60px; }

    /* Тосты наверх на мобильных, чтобы не перекрывать чат */
    .toast-container { top: 20px; left: 50%; bottom: auto; transform: translateX(-50%); width: 90%; max-width: 320px; }
    .toast-notification { animation: slideInDown 0.3s ease both, fadeOut 0.5s ease 2.7s forwards; }
}
@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}
/* Проверьте, чтобы в style.css эти блоки выглядели именно так: */
.wb-size-badge.selected {
    border-color: #557a6d !important;
    background-color: #f0f7f4 !important;
    box-shadow: 0 0 0 2px rgba(85, 122, 109, 0.2);
}
.wb-size-badge.selected .wb-size-num {
    color: #557a6d !important;
}
/* Настройка контейнера логотипа */
.logo {
    display: flex;
    align-items: center;
    max-height: 60px; /* Жестко ограничиваем высоту шапки */
}

/* Ограничение размеров картинки логотипа */
.logo-img {
    height: 55px;    /* Идеальная высота, чтобы шапка оставалась аккуратной */
    width: auto;     /* Ширина подстроится сама без искажений пропорций */
    display: block;
    object-fit: contain;
}

/* Мобильная адаптация логотипа */
@media (max-width: 768px) {
    .logo-img {
        height: 45px; /* На смартфонах делаем логотип чуть компактнее */
    }
}
