html, body {
    height: 100%;
}

body {
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #000;
    margin: 0;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
    /* --- ▼▼▼ ВИПРАВЛЕННЯ 1: Прибираємо фіксований відступ, щоб контент не "залазив" під меню ▼▼▼ --- */
    padding: 0;
}

/* --- ▼▼▼ НОВИЙ КЛАС-КОНТЕЙНЕР (ЯК НА ROZETKA) ▼▼▼ --- */
.site-container {
    width: 100%;
    max-width: 1440px; /* <--- МАКСИМАЛЬНА ШИРИНА САЙТУ */
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;  /* Відступи безпеки зліва */
    padding-right: 20px; /* Відступи безпеки справа */
    box-sizing: border-box; /* Важливо, щоб padding не додавався до ширини */
}


/* --- ▼▼▼ ЗМІНЕНО: .site-header тепер 100% фон, відступи видалено ▼▼▼ --- */
.site-header {
    padding: 15px 0; /* Тільки вертикальні відступи */
    background: #000;
    color: #fff;
    position: relative;
    /* Всі flex-властивості переїхали в .site-header-container */
}

/* --- ▼▼▼ НОВИЙ КЛАС: Керує layout всередині шапки ▼▼▼ --- */
.site-header-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}


.logo a {
    text-decoration: none;
    font-weight: bold;
    font-size: 27px;
    color: #fff;
}

/* Стилі для кнопки Каталог */
.catalog-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #000;
    color: #fff;
    padding: 12px 40px;
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    border-radius: 12px;
    border: 2px solid #fff;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
    margin-left: 20px;
    vertical-align: middle;
    flex-shrink: 0;
}

.catalog-btn:hover {
    background: #1a1a1a;
    border-color: #eee;
    transform: scale(1.03);
}

.catalog-btn:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 3px;
}

.catalog-btn .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
}

.catalog-btn .icon svg {
    display: block;
    width: 28px;
    height: 21px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

.catalog-btn .text {
    display: inline-block;
    line-height: 1;
}

.catalog-btn:hover .text {
    transform: scale(1.04);
}

/* --- ▼▼▼ ЗМІНЕНО: Пошук тепер гнучкий, без absolute ▼▼▼ --- */
.search-bar {
    position: static;
    transform: none;
    flex-grow: 1;     /* Займає вільне місце */
    min-width: 200px;
    width: auto;
    max-width: 600px;
    margin: 0 20px;
}


.search-bar form {
    width: 100%;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    background: #e9e9e9;
    border: 1px solid #b5b5b5;
    border-radius: 12px;
}

.search-bar input[type="text"] {
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: #000;
    width: 100%;
    font-size: 15px;
}

.search-bar input[type="text"]:focus {
    outline: none;
}

.search-input-wrapper:focus-within {
    border-color: #000;
}


/* Base button styles */
.search-bar button:not(.search-submit),
.btn,
.catalog-btn,
button:not(.search-submit) {
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.search-submit {
    position: static;
    background: transparent;
    border: none;
    color: #777;
    font-size: 18px;
    cursor: pointer;
    padding: 0 16px 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.search-submit:hover {
    color: #000;
}

.search-submit:focus-visible {
    outline: 2px solid #000;
    outline-offset: 4px;
    border-radius: 12px;
}

.btn:hover,
.catalog-btn:hover,
.search-bar button:not(.search-submit):hover,
button:not(.search-submit):hover {
    transform: scale(1.05);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #000;
    z-index: 1000;
}

.search-suggestions ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-suggestions li a {
    display: block;
    padding: 5px 10px;
    color: #000;
    text-decoration: none;
}

.search-suggestions li a:hover {
    background: #000;
    color: #fff;
}

.suggest-title {
    font-weight: bold;
    padding: 5px 10px;
    background: #f5f5f5;
    border-bottom: 1px solid #000;
}

/* Auth & account pages */
.auth-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
    padding: 42px 48px;
    /* --- ▼▼▼ ЗМІНЕНО: Тепер центрується відносно .site-container --- */
    margin-left: auto;
    margin-right: auto;
}

.auth-title {
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 700;
}

.auth-subtitle {
    margin: 0 0 30px;
    color: #4a5568;
    line-height: 1.5;
}

.styled-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.styled-form label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    color: #2d3748;
}

.styled-form input,
.styled-form select,
.styled-form textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #cbd5f5;
    border-radius: 12px;
    font-size: 16px;
    background: #fdfdfd;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.styled-form input:focus,
.styled-form select:focus,
.styled-form textarea:focus {
    outline: none;
    border-color: #00a046;
    box-shadow: 0 0 0 3px rgba(0, 160, 70, 0.15);
}

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

.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea {
    border-color: #e53e3e;
    box-shadow: 0 0 0 2px rgba(229, 62, 62, 0.12);
}

.help-text {
    margin-top: 6px;
    font-size: 13px;
    color: #718096;
}

.form-global-errors {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.error-message {
    margin-top: 6px;
    font-size: 13px;
    color: #c53030;
}

.btn-wide {
    width: 100%;
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
    color: #4a5568;
}

.auth-footer a {
    color: #00a046;
    font-weight: 600;
}

.account-wrapper {
    display: flex;
    justify-content: center;
}

.account-card {
    width: 100%;
    max-width: 960px;
    background: #fff;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    padding: 40px 48px;
    /* --- ▼▼▼ ЗМІНЕНО: Тепер центрується відносно .site-container --- */
    margin-left: auto;
    margin-right: auto;
}

.account-title {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
}

.account-greeting {
    margin-top: 6px;
    color: #4a5568;
}

.account-tabs {
    display: flex;
    gap: 12px;
    margin: 36px 0 28px;
    flex-wrap: wrap;
}

.account-tabs .tab-link {
    border: 1px solid #d9e0f1;
    border-radius: 12px;
    padding: 12px 22px;
    font-weight: 600;
    background: #f1f4fb;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.2s ease;
}

.account-tabs .tab-link:hover {
    background: #e2e8f0;
}

.account-tabs .tab-link.active {
    background: #000000; /* <-- Чорний фон */
    color: #FFFFFF; /* <-- Білий текст */
    border-color: transparent; /* Залишаємо без рамки */
    box-shadow: none; /* <-- Прибираємо зелену тінь */
}

.account-card .tab-panel {
    display: none;
    animation: fadeIn 0.25s ease;
}

.account-card .tab-panel.active {
    display: block;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.order-list,
.favorites-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.order-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f9fafc;
    font-weight: 600;
    gap: 14px;
}

.order-number {
    color: #2d3748;
}

.order-date {
    color: #718096;
    font-size: 14px;
}

.order-total {
    color: #00a046;
}

.favorites-list li {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f9fafc;
}

.favorites-list a {
    text-decoration: none;
    color: #2d3748;
    font-weight: 600;
}

.favorites-list a:hover {
    color: #00a046;
}

.empty-state {
    text-align: center;
    color: #718096;
    padding: 30px 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    main {
        padding: 40px 0; /* --- ▼▼▼ ЗМІНЕНО --- */
    }

    .auth-card,
    .account-card {
        padding: 32px 24px;
        border-radius: 16px;
    }

    .account-tabs {
        gap: 8px;
    }

    .account-tabs .tab-link {
        flex: 1 0 100%;
        text-align: center;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Banner slider */
.banner-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-bottom: 20px;
    height: 200px;
}

.banner-slider .slides {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

.banner-slider .slide {
    min-width: 100%;
    height: 100%;
    flex-shrink: 0;
}

.banner-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.banner-slider .prev,
.banner-slider .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    padding: 8px;
    cursor: pointer;
}

.banner-slider .prev {
    left: 10px;
}

.banner-slider .next {
    right: 10px;
}

.banner-slider .prev:hover,
.banner-slider .next:hover {
    background: rgba(0,0,0,0.7);
}

.banner-slider .dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
}

.banner-slider .dot {
    width: 10px;
    height: 10px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    cursor: pointer;
}

.banner-slider .dot.active {
    background: #fff;
}


.header-icons {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex-shrink: 0;
}


.header-icons a,
.header-icons .lang-switch {
    color: #fff;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.header-icons .lang-switch {
    cursor: pointer;
}

.header-icons i {
    font-size: 22px;
    transition: color 0.3s ease;
}

.header-icons a:hover,
.header-icons .lang-switch:hover {
    transform: translateY(-2px);
}

.header-icons .lang-switch .lang-menu {
    display: none;
    position: absolute;
    background: #fff;
    color: #000;
    border: 1px solid #000;
    top: 100%;

    /* --- ВИПРАВЛЕННЯ ПОЗИЦІЇ --- */
    left: auto;  /* Скасовуємо прив'язку зліва */
    right: 0;    /* Притискаємо до правого краю, щоб не вилазило за екран */
    /* --------------------------- */

    z-index: 2000;
    min-width: 60px;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Переконайся, що цей блок точно виглядає так: */
.header-icons .lang-switch:hover .lang-menu,
.header-icons .lang-switch.active .lang-menu {
    display: block !important; /* !important - контрольний постріл, щоб точно показалось */
}

.header-icons .lang-switch button {
    background: none;
    border: none;
    padding: 8px 12px; /* <-- ЗМІНЕНО: Трохи зручніші кнопки */
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 14px; /* <-- ДОДАНО: Читабельний шрифт */
}

.header-icons .lang-switch button:hover {
    background-color: #f0f0f0; /* <-- ДОДАНО: Підсвітка при наведенні в меню */
}
/* --- ВИПРАВЛЕННЯ МОВНОГО МЕНЮ --- */

/* Примусово робимо текст чорним всередині випадаючого меню */
.header-icons .lang-switch .lang-menu a,
.header-icons .lang-switch .lang-menu button,
.header-icons .lang-switch .lang-menu li {
    color: #000 !important; /* Чорний колір тексту */
    text-align: left;
    white-space: nowrap; /* Щоб текст не переносився */
}

/* Додаємо підсвітку при наведенні/натисканні в меню */
.header-icons .lang-switch .lang-menu a:hover,
.header-icons .lang-switch .lang-menu button:hover {
    background-color: #f0f0f0;
    color: #00a046 !important; /* Зелений при наведенні */
}

.actions .buy-form {
    display: inline-block;
}

.monobank-hint {
    margin-top: 10px;
    font-size: 14px;
    color: #555;
}

.monobank-hint i {
    margin-right: 6px;
    color: #ff6f00;
}

.monobank-hint.unavailable {
    color: #b22222;
}

.header-icons .count {
    position: absolute;
    top: -5px;
    right: -10px;
    background: #fff;
    color: #000;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    border: 1px solid #000;
}

.logout-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
    font: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
}

.logout-btn:hover {
    text-decoration: underline;
}

/* ========================================= */
/* СТИЛІ ВЕРХНЬОЇ НАВІГАЦІЇ КАТЕГОРІЙ      */
/* ========================================= */

/* Цей блок ЗАМІНЮЄ старі стилі .categories-nav */

.categories-nav {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0; /* Світліша лінія */
    background: #fff !important; /* Чистий білий фон */
    min-height: auto; /* Скидаємо min-height */
}

.categories-nav-container {
    display: flex;
    gap: 12px; /* Проміжок між кнопками */
    width: 100%;
    align-items: center;

    overflow-x: auto; /* Додаємо скрол сюди */
    padding-bottom: 5px; /* Трохи місця знизу для естетики */

    /* Приховування скролбару (якщо хочеш): */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE */
}
/* Для Chrome/Safari щоб сховати скролбар */
.categories-nav-container::-webkit-scrollbar {
    display: none;
}

/* КОПІЯ СТИЛЮ .category-list a (те, що ти хотів) */
.categories-nav a {
    display: block;
    padding: 10px 14px;
    text-decoration: none;
    font-weight: 600;
    color: #333; /* <-- Прибрали !important, бо старий стиль видалено */
    background: #f9f9f9; /* Дуже світлий фон */
    border: 1px solid #eee;
    border-radius: 8px;
    transition: all 0.2s ease;
    line-height: 1.4; /* Додано для стабільності */
    font-size: 15px; /* Додано для стабільності */

    flex-shrink: 0;
}

/* КОПІЯ СТИЛЮ .category-list a:hover (те, що ти хотів) */
.categories-nav a:hover {
    background: #000; /* Чорний при наведенні */
    color: #fff; /* <-- Прибрали !important */
    border-color: #000;
    text-decoration: none; /* Прибираємо підкреслення */
    transform: scale(1.03);
}


/* --- ▼▼▼ ЗМІНЕНО: .container тепер НЕ має відступів, це робить .site-container ▼▼▼ --- */
.container {
    display: flex;
    align-items: flex-start;
    width: 100%; /* Займає 100% від .site-container */
}

.sidebar {
    width: 200px;
    padding: 20px 20px 20px 0; /* --- ▼▼▼ ЗМІНЕНО: прибираємо лівий відступ --- */
}

.sidebar a {
    color: #000;
    text-decoration: none;
}

.products {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px 0 20px 20px; /* --- ▼▼▼ ЗМІНЕНО: прибираємо правий відступ --- */
    align-content: start;
}

/* 1. Стиль самої картки */
.product {
    border: 1px solid #e0e0e0; /* Тонка рамка навколо всієї картки (опціонально, можна прибрати) */
    border-radius: 8px;        /* Заокруглені кути */
    overflow: hidden;          /* Щоб картинка не вилазила за заокруглення */
    padding: 0 !important;     /* ГОЛОВНЕ: прибираємо внутрішні відступи, щоб фото торкалось країв */
    background: #fff;
    display: flex;
    flex-direction: column;    /* Щоб елементи йшли зверху вниз */
    transition: box-shadow 0.3s ease;
}

.product:hover {
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

/* 2. Налаштування картинки */
/* 2. Налаштування картинки */
.product a.product-image-link {
    display: block;
    width: 100%;
    /* Десктоп: фіксована висота для рівної сітки */
    height: 260px;
    background-color: #fff;
    overflow: hidden;
    position: relative;
    /* Центрування картинки (вертикально і горизонтально) */
    display: flex;
    align-items: center;
    justify-content: center;
}

.product img {
    /* Обмежуємо розміри, щоб фото не вилазило */
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;

    /* contain: показує все фото цілком.
       З'являться білі поля, якщо пропорції не збігаються. */
    object-fit: contain;

    border: none;
    margin: 0 auto;
    display: block;

    /* Десктоп: додаємо трохи повітря навколо товару */
    padding: 10px;
    box-sizing: border-box;
    transition: transform 0.3s ease;
}

/* Ефект збільшення при наведенні (тільки для ПК) */
@media (hover: hover) {
    .product:hover img {
        transform: scale(1.05);
    }
}

/* Планшети (до 1100px) */
@media (max-width: 1100px) {
    .product a.product-image-link {
        height: 220px;
    }
}
/* Мобільні телефони (до 768px) */
@media (max-width: 768px) {
    .product a.product-image-link {
        /* Зменшуємо висоту блоку, щоб він був ближчим до квадрата.
           Це візуально робить фото БІЛЬШИМ, бо зникають зайві білі смуги зверху/знизу. */
        height: 160px;
    }

    .product img {
        /* ВАЖЛИВО: Прибираємо padding на телефонах!
           Тепер фото торкається країв і використовує 100% ширини екрану. */
        padding: 0;

        /* Додаткова страховка для деяких браузерів */
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 100%;
    }
}

/* Дуже маленькі телефони (до 480px) */
@media (max-width: 480px) {
    .product a.product-image-link {
        height: 150px; /* Ще компактніше для iPhone SE / mini */
    }
}

/* 3. Відступи для тексту (бо ми прибрали padding у .product) */
.product-details {
    padding: 15px; /* Відступ тексту від країв картки */
    display: flex;
    flex-direction: column;
    flex-grow: 1;  /* Розтягує блок на всю доступну висоту */
}

/* Адаптивність для мобільних */
@media (max-width: 768px) {
    .product a.product-image-link {
        height: 200px; /* Менша висота картинки на телефонах */
    }
}

.product .title {
    margin-top: 5px;
    font-weight: bold;
}

.product .price {
    font-weight: bold;
    margin-top: 5px;
}

.rating, .star-rating {
    display: flex;
    gap: 2px;
    align-items: center;
}

/* Загальні стилі для зірочок */
.fa-star {
    color: #ffc107;
    text-shadow: 0 1px 2px rgba(255, 193, 7, 0.3);
}

.fa-star-o {
    color: #ddd;
}

.star-rating .star {
    color: #ccc;
    cursor: pointer;
    font-size: 18px;
}

.star-rating .star.selected {
    color: #ffc107;
}

.rating .fa-star {
    color: #ffc107;
}

.rating .fa-star-o {
    color: #ccc;
}

.product .actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.btn {
    display: inline-block;
    padding: 6px 12px;
    background: #000;
    color: #fff;
    text-decoration: none;
    border: 1px solid #000;
    transition: background 0.3s ease, color 0.3s ease;
    cursor: pointer;
}

/* -- Змінено стиль основної кнопки -- */
.btn.btn-primary {
    background: #000000; /* Чорний фон */
    color: #FFFFFF; /* Білий текст */
    border: none; /* Без рамки */
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    padding: 14px 18px;
    transition: background-color 0.3s ease, transform 0.3s ease; /* Оновлено transition */
}

/* -- Змінено стиль основної кнопки при наведенні -- */
.btn.btn-primary:hover {
    background-color: #333333; /* Трохи світліший чорний при наведенні */
    color: #FFFFFF; /* Текст залишається білим */
    /* transform: scale(1.05); - Цей ефект вже є у .btn:hover */
}

.btn:hover {
    background: #fff;
    color: #000;
}

/* --- НОВІ СТИЛІ ДЛЯ КНОПКИ ФІЛЬТРІВ --- */
.btn-filter-toggle {
    display: none; /* Сховано на десктопі за замовчуванням */
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    color: #333;
    transition: background 0.3s ease;
}

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

.btn-filter-toggle:hover {
    background: #e9ecef;
}
/* --- КІНЕЦЬ НОВИХ СТИЛІВ --- */

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.cart-table th,
.cart-table td {
    border: 1px solid #000;
    padding: 10px;
    text-align: left;
}

.qty-input {
    width: 60px;
    padding: 5px;
    border: 1px solid #000;
    text-align: center;
}

.cart-actions {
    display: flex;
    gap: 10px;
}

/* --- ▼▼▼ ЗМІНЕНО: .site-footer тепер 100% фон, відступи видалено ▼▼▼ --- */
.site-footer {
    margin-top: 40px;
    background: #000;
    color: #fff;
    padding: 20px 0; /* Тільки вертикальні відступи */
    text-align: center;
}

.site-footer .footer-cols {
    display: flex;
    justify-content: space-between;
}

.site-footer .footer-cols .col {
    flex: 1;
    margin: 0 10px;
}

.site-footer h3 {
    margin-top: 0;
}

.site-footer a {
    color: #fff;
    text-decoration: none;
    margin: 0 10px;
}

/* Додатковий функціонал */
.filter-form input,
.filter-form select {
    width: 100%;
    padding: 5px;
    border: 1px solid #000;
    margin-bottom: 10px;
}

.filter-section {
    margin-bottom: 20px;
    border-bottom: 1px solid #000;
    padding-bottom: 10px;
}

.filter-section h3 {
    margin: 0 0 10px;
    font-size: 16px;
}

.filter-form ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.filter-form li {
    margin-bottom: 5px;
}

.filter-form input[type="checkbox"],
.filter-form input[type="radio"] {
    width: auto;
    margin-right: 5px;
}

.price-range {
    display: flex;
    gap: 10px;
}

.price-range input {
    width: 100%;
}

.coupon-form input {
    padding: 5px;
    border: 1px solid #000;
}

form .btn {
    margin-top: 10px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 20px;
}

.pagination a,
.pagination span {
    border: 1px solid #000;
    padding: 5px 10px;
    text-decoration: none;
    color: #000;
    background: #fff;
}

.pagination .current {
    background: #000;
    color: #fff;
}

.account-form input {
    width: 100%;
    padding: 5px;
    border: 1px solid #000;
    margin-bottom: 10px;
}

.favorites-list {
    list-style: none;
    padding: 0;
}

.favorites-list li {
    margin-bottom: 5px;
}

.favorites-actions {
    text-align: right;
    margin-bottom: 10px;
}


/* Сторінка товару */
.product-page {
    display: flex;
    gap: 40px;
    padding: 20px 0; /* --- ▼▼▼ ЗМІНЕНО: Відступи контролює .site-container --- */
}
.product-gallery {
    width: 50%;
}
/* --- ОНОВЛЕНІ СТИЛІ ДЛЯ ФОТО ТОВАРУ --- */
.product-gallery .main-view {
    border: none;         /* Прибираємо чорну рамку */
    padding: 0;           /* Прибираємо внутрішні відступи (білу рамку) */
    width: 100%;
    background-color: #fff; /* Чистий фон */
    overflow: hidden;     /* Щоб нічого не вилазило */
    display: flex;        /* Центрування */
    justify-content: center;
    align-items: center;
    position: relative;
}

.product-gallery .main-view img,
.product-gallery .main-view #viewer {
    width: 100%;          /* Ширина на весь контейнер */
    height: auto;         /* Висота підлаштовується автоматично */
    max-height: 500px;    /* Обмеження висоти для великих екранів, щоб фото не було гігантським */
    object-fit: contain;  /* ВАЖЛИВО: contain показує весь товар. Якщо хочеш "залити" як в списку - зміни на cover */
    display: block;
}

@media (max-width: 768px) {
    .product-page {
        flex-direction: column;
        gap: 20px;
    }

    .product-gallery {
        width: 100%; /* На мобільному галерея на всю ширину */
    }

    .product-gallery .main-view img {
        max-height: 320px; /* На мобільному висота трохи менша */
    }
}
.product-gallery .thumbs {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.product-gallery .thumbs img,
.product-gallery .thumbs .thumb360 {
    width: 80px;
    height: 80px;
    border: 1px solid #000;
    cursor: pointer;
    object-fit: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}
.product-info {
    flex: 1;
}
.product-info .rating {
    margin: 10px 0;
}
.product-info .price {
    font-size: 24px;
    font-weight: bold;
    margin: 15px 0;
}
.price .old {
    text-decoration: line-through;
    color: #888;
    margin-right: 5px;
}

.price .new {
    color: #e60000;
}
.product-tabs {
    margin: 40px 0; /* --- ▼▼▼ ЗМІНЕНО: Відступи контролює .site-container --- */
}
.product-tabs .tab-links {
    list-style: none;
    display: flex;
    padding: 0;
    margin: 0;
    border-bottom: 1px solid #000;
}
.product-tabs .tab-links li {
    padding: 10px 20px;
    border: 1px solid #000;
    border-bottom: none;
    margin-right: 5px;
    cursor: pointer;
    background: #f5f5f5;
}
.product-tabs .tab-links li.active {
    background: #000;
    color: #fff;
}
.product-tabs .tab-content {
    display: none;
    border: 1px solid #000;
    padding: 20px;
}
.product-tabs .tab-content.active {
    display: block;
}
.specs-table {
    width: 100%;
    border-collapse: collapse;
}
.specs-table th,
.specs-table td {
    border-bottom: 1px solid #000;
    padding: 5px;
    text-align: left;
}
.specs-table th {
    width: 150px;
}

/* Home page sections */
.main-content {
    flex: 1;
    /* --- ▼▼▼ ВИПРАВЛЕННЯ: Додаємо відступ зверху, щоб контент не "залазив" під сайдбар ▼▼▼ --- */
    padding: 20px 0 20px 20px;
}

.section-title {
    font-size: 24px;
    margin: 20px 0 10px;
}

.main-content .products {
    margin-bottom: 20px;
}

/* Catalog page */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px 0; /* --- ▼▼▼ ЗМІНЕНО: Відступи контролює .site-container --- */
}

.category-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    text-align: center;
}

.category-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.category-card a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 20px;
}

.category-icon {
    font-size: 40px;
    color: #00a046;
    margin-bottom: 10px;
}

.category-name {
    font-weight: bold;
    margin-bottom: 10px;
}

.subcategory-list {
    background: #f7f7f7;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    border-top: 1px solid #e0e0e0;
}

.subcategory-list a {
    font-size: 14px;
    color: #007bff;
    text-decoration: none;
}

.subcategory-list a:hover {
    text-decoration: underline;
}

/* Стилі для відгуків та рейтингу */
.reviews-summary {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.average-stars {
    display: flex;
    gap: 2px;
    font-size: 20px;
}

.average-stars .fa-star {
    color: #ffc107;
}

.average-stars .fa-star-o {
    color: #ccc;
}

.reviews-meta {
    color: #666;
    font-size: 14px;
}

.reviews-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.reviews-list li {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}

.reviews-list li:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
}

.review-stars {
    display: flex;
    gap: 2px;
}

.review-stars .fa-star {
    color: #ffc107;
    font-size: 14px;
}

.review-stars .fa-star-o {
    color: #ccc;
    font-size: 14px;
}

.review-date {
    color: #666;
    font-size: 12px;
    margin-left: auto;
}

.review-comment {
    color: #333;
    line-height: 1.5;
    margin: 0;
}

.my-review {
    background: #f0f8ff;
    padding: 10px;
    border-radius: 5px;
    border-left: 3px solid #007bff;
}

.no-reviews {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

.review-form-wrapper {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.review-form-wrapper h3 {
    margin: 0 0 15px;
    color: #333;
}

.star-rating {
    display: flex;
    gap: 8px;
    margin: 15px 0;
    align-items: center;
}

.star-rating .star {
    color: #ddd;
    cursor: pointer;
    font-size: 28px;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    position: relative;
    user-select: none;
}

.star-rating .star:hover {
    color: #ffc107;
    transform: scale(1.1);
    text-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.star-rating .star.selected,
.star-rating .star.fa-star {
    color: #ffc107;
    text-shadow: 0 2px 4px rgba(255, 193, 7, 0.4);
}

.star-rating .star.fa-star-o {
    color: #ddd;
}

.star-rating .star:hover ~ .star {
    color: #ddd;
}

/* Покращення для відображення рейтингу в списку товарів */
.product .rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 8px 0;
    font-size: 14px;
}

.product .rating .fa-star {
    color: #ffc107;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(255, 193, 7, 0.3);
}

.product .rating .fa-star-o {
    color: #ddd;
    font-size: 14px;
}

.rating-value {
    margin-left: 8px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.rating-count {
    margin-left: 5px;
    color: #666;
    font-size: 12px;
}

.rating-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.rating-label {
    margin: 0 0 10px;
    font-weight: 600;
    color: #333;
}

.rating-text {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.comment-field {
    margin-top: 15px;
}

.comment-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.comment-field textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.3s ease;
}

.comment-field textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.submit-review {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
}

.submit-review:hover {
    background: #0056b3;
}

.login-to-review {
    text-align: center;
    color: #666;
    padding: 20px;
}

.login-to-review a {
    color: #007bff;
    text-decoration: none;
}

.login-to-review a:hover {
    text-decoration: underline;
}

/* Покращення відображення рейтингу на картках товарів */
.product .rating {
    margin: 8px 0;
    font-size: 14px;
}

.product .rating .fa-star {
    color: #ffc107;
    font-size: 12px;
}

.product .rating .fa-star-o {
    color: #ccc;
    font-size: 12px;
}

.rating-value {
    margin-left: 5px;
    font-weight: bold;
    color: #333;
}

.rating-count {
    margin-left: 5px;
    color: #666;
    font-size: 12px;
}

/* Повідомлення */
.messages {
    margin: 20px;
}

.alert {
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 8px;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* Адаптивність для мобільних пристроїв */
@media (max-width: 768px) {
    .product-page {
        flex-direction: column;
        gap: 20px;
    }

    .product-gallery {
        width: 100%;
    }

    .reviews-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .review-date {
        margin-left: 0;
    }
}


/* --- СТИЛІ ДЛЯ НОВИХ ТЕГІВ ВІДГУКІВ --- */

/* Контейнер для тегів, що вже збережені у відгуку */
.review-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

/* Бейдж-тег, який просто відображається */
.review-tag-badge.view-only {
    background-color: #f0f0f0;
    border-radius: 15px;
    padding: 5px 12px;
    font-size: 13px;
    color: #333;
}

/* Контейнер для тегів у формі */
.review-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

/* Повністю ховаємо оригінальний чекбокс */
.review-tag-choice input[type="checkbox"] {
    display: none;
}

/* Стилізуємо <label> як клікабельний бейдж */
.review-tag-badge {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    background-color: #fff;
    transition: all 0.2s ease;
    user-select: none; /* Заборона виділення тексту */
}

/* Стиль бейджа при наведенні */
.review-tag-badge:hover {
    border-color: #aaa;
    background-color: #f9f9f9;
}

/* Стиль бейджа, коли відповідний чекбокс обрано */
.review-tag-choice input[type="checkbox"]:checked + .review-tag-badge {
    background-color: #d4edda; /* Колір успіху, як у alert-success */
    border-color: #c3e6cb;
    color: #155724;
    font-weight: 500;
}


/* ========================================= */
/* АДАПТИВНІ СТИЛІ (RESPONSIVE)              */
/* ========================================= */

/* --- Планшети (e.g., 769px - 1100px) --- */
@media (max-width: 1100px) {
    /* --- ▼▼▼ ЗМІНЕНО: .site-header-container тепер керує переносом --- */
    .site-header-container {
        justify-content: space-between; /* Logo/Catalog left, Icons right */
        gap: 15px;
    }
    .catalog-btn {
        margin-left: 10px;
    }
    .search-bar {
        order: 3; /* Пошук переходить на новий рядок */
        flex-basis: 100%; /* На всю ширину */
        margin: 0; /* Скидаємо відступи */
        max-width: 100%;
    }
    .header-icons {
        margin-left: 0;
    }

    .categories-nav {
        /* overflow-x: auto; вже є */
    }

    .container {
        /* .site-container вже має padding, тому тут не треба */
    }

    .sidebar {
        width: 180px;
        padding: 15px 15px 15px 0;
    }

    main {
        padding: 40px 0; /* --- ▼▼▼ ЗМІНЕНО --- */
    }

    .site-footer .footer-cols {
        /* .site-container вже має padding */
    }
}


/* --- Мобільні пристрої (~ до 768px) --- */
@media (max-width: 768px) {
    .site-header {
        padding: 10px 0;
    }
     .site-header-container {
        justify-content: space-between;
    }

    .logo {
        flex-basis: 50%;
    }

    .catalog-btn {
        order: 4; /* Кнопка "Каталог" ЙДЕ ПІСЛЯ Пошуку */
        margin: 10px 0 5px;
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }

    .search-bar {
        order: 3; /* Пошук залишається на 2-му рядку */
        margin-top: 10px;
    }

    .header-icons {
        flex-basis: auto;
        gap: 5px;
    }

    .header-icons .header-icon-text {
       display: none; /* Ховаємо текст біля іконок */
    }


    .categories-nav {
        padding: 8px 0;
    }
    /* --- ▼▼▼ ЗМІНЕНО: тепер .container - це flex-обгортка всередині .site-container --- */
    .container {
        flex-direction: column; /* Ставимо сайдбар НАД контентом */
        padding: 0; /* .site-container має відступи */
    }

    .sidebar {
        display: none;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ddd;
        padding: 15px 0 0 0; /* --- ▼▼▼ ЗМІНЕНО: відступи контролює .site-container --- */
    }

    .sidebar.is-open {
        display: block;
    }

    .btn-filter-toggle {
        display: block;
    }


    .main-content {
        padding: 15px 0 0 0; /* --- ▼▼▼ ЗМІНЕНО: відступи контролює .site-container --- */
    }

    /* Адаптуємо грід товарів */
    .products, .catalog-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
        padding: 15px 0; /* --- ▼▼▼ ЗМІНЕНО: відступи контролює .site-container --- */
    }
    .product {
        padding: 10px;
    }
    .product img {
        width: 150px;
        height: 150px;
    }

    .site-footer .footer-cols {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 0; /* --- ▼▼▼ ЗМІНЕНО: відступи контролює .site-container --- */
    }

    /* Зменшуємо шрифти для мобільних */
    body {
        font-size: 14px;
    }
    h1, .auth-title, .account-title {
        font-size: 22px;
    }
    .logo a {
        font-size: 22px;
    }
    .catalog-btn {
        font-size: 16px;
        padding: 10px 15px;
    }
     .catalog-btn .icon svg {
         width: 24px;
         height: 18px;
     }
}

/* --- Дуже маленькі екрани (~ до 480px) --- */
@media (max-width: 480px) {
    .site-header {
        padding: 10px 0;
    }
     .header-icons {
         gap: 5px; /* Ще менші проміжки */
     }
     .header-icons a, .header-icons .lang-switch, .logout-btn {
         padding: 4px 6px; /* Менші кнопки іконок */
         gap: 4px;
     }
    .products, .catalog-grid {
        /* Можна зробити 1-2 колонки */
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
     .product img {
         width: 130px;
         height: 130px;
     }

     /* Зменшуємо розмір шрифту ще трохи */
     body {
         font-size: 13px;
     }
     h1, .auth-title, .account-title {
         font-size: 20px;
     }
}


/* ========================================= */
/* СТИЛІ ДЛЯ ОФОРМЛЕННЯ ЗАМОВЛЕННЯ (CHECKOUT) */
/* ========================================= */

.checkout-wrapper {
    width: 100%;
    max-width: 960px; /* Трохи ширше, ніж картка авторизації */
    margin: 0 auto;
    background: #fff;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
    padding: 42px 48px;
    /* --- ▼▼▼ ЗМІНЕНО: Тепер центрується відносно .site-container --- */
    margin-left: auto;
    margin-right: auto;
}

/* Використовуємо ті ж стилі, що й для .auth-title */
.checkout-title {
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 700;
}
.checkout-subtitle {
    margin: 0 0 30px;
    color: #4a5568;
    line-height: 1.5;
}

/* --- Крок 1: Вибір способу оплати --- */
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.payment-option {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-option:hover {
    border-color: #cbd5f5;
    background: #fdfdfd;
}

/* Ховаємо оригінальний radio-button */
.payment-option input[type="radio"] {
    display: none;
}

/* Кастомний кружечок */
.radio-custom {
    display: inline-block;
    position: relative;
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5f5;
    border-radius: 50%;
    margin-right: 15px;
    flex-shrink: 0;
}

/* Внутрішня крапка */
.radio-dot {
    display: block;
    width: 10px;
    height: 10px;
    background: #000; /* Колір при виборі */
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.2s ease;
}

.radio-label {
    font-weight: 600;
    font-size: 16px;
    color: #2d3748;
}

.radio-label i {
    margin-right: 8px;
    color: #000000;
    width: 20px;
    text-align: center;
}

/* Стиль при виборі */
.payment-option input[type="radio"]:checked + .radio-dot {
    transform: translate(-50%, -50%) scale(1);
}

.payment-option input[type="radio"]:checked ~ .radio-label {
    color: #000;
}

/* -- Змінено стиль активного вибору методу оплати -- */
label.payment-option:has(input[type="radio"]:checked) {
    border-color: #000000; /* Чорна рамка замість зеленої */
    background: #f4f6f8; /* Ледь сірий фон замість зеленого */
}


/* --- Крок 2: Форма та кнопки --- */
.form-actions {
    display: flex;
    justify-content: flex-end; /* Кнопка "Далі" справа */
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    align-items: center;
}
/* Кнопка "Назад" */
.btn-secondary {
    background: #f1f4fb;
    color: #2d3748;
    border: 1px solid #d9e0f1;
}
.btn-secondary:hover {
    background: #e2e8f0;
    color: #000;
}

/* Вирівнювання кнопок в checkout */
.form-actions .btn {
    margin-top: 0; /* Скидаємо відступ з .btn */
}
/* Робимо кнопку "Назад" на одному рівні з "Далі" */
.form-actions a.btn {
    padding: 14px 18px; /* Вирівнюємо з .btn-primary */
    font-weight: 700;
    border-radius: 12px;
}
/* Кнопку "Далі" робимо крайньою правою */
.form-actions {
    justify-content: space-between;
}


/* Адаптивність для checkout */
@media (max-width: 768px) {
    .checkout-wrapper {
        padding: 32px 24px;
        border: none;
        box-shadow: none;
        background: transparent;
    }
}

/* Сторінка оплати */
.payment-page .payment-total {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: right;
    margin: 20px 0;
}
.payment-page .payment-error {
    color: #c53030;
    background: #fff5f5;
    border: 1px solid #feb2b2;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}


/* Стилі для статусів замовлень в кабінеті */
.order-list-item {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1.5fr 1fr;
    gap: 15px;
    align-items: center;
}
.order-status {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    background: #e2e8f0;
    color: #4a5568;
}
.order-status.status-awaiting_payment,
.order-status.status-payment_failed {
    background: #fff5f5;
    color: #c53030;
}
.order-status.status-processing,
.order-status.status-paid_processing {
    background: #fffbeb;
    color: #b45309;
}
.order-status.status-assembling {
    background: #f0f9ff;
    color: #0284c7;
}
.order-status.status-shipped,
.order-status.status-arrived {
    background: #f3e8ff;
    color: #7e22ce;
}
.order-status.status-completed {
    background: #f0fdf4;
    color: #15803d;
}

@media (max-width: 600px) {
    .order-list-item {
        grid-template-columns: 1fr 1fr; /* 2 колонки */
    }
    .order-status {
        grid-column: 1 / 3; /* Статус на всю ширину */
        grid-row: 2;
    }
    .order-total {
        text-align: right;
    }
}

/* ========================================= */
/* СТИЛІ ДЛЯ SELECT2 (НОВА ПОШТА)         */
/* ========================================= */

/* Вирівнюємо Select2 під загальний стиль .styled-form */
.select2-container .select2-selection--single {
    height: auto; /* Дозволяємо авто-висоту */
    padding: 14px 16px; /* Ті ж падінги, що й у .styled-form input */
    border: 1px solid #cbd5f5;
    border-radius: 12px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: inherit; /* Успадковуємо line-height */
    padding: 0;
    color: #000;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    top: 50%;
    transform: translateY(-50%);
    right: 10px;
}

/* Стиль при фокусі */
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #00a046;
    box-shadow: 0 0 0 3px rgba(0, 160, 70, 0.15);
}

/* Стилі для випадаючого списку */
.select2-dropdown {
    border: 1px solid #00a046;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.select2-results__option--highlighted[aria-selected] {
    background-color: #00a046;
}

/* Обробка помилок для Select2 */
.form-field.has-error .select2-container .select2-selection--single {
    border-color: #e53e3e;
    box-shadow: 0 0 0 2px rgba(229, 62, 62, 0.12);
}

/* ========================================= */
/* СТИЛІ ДЛЯ СІТКИ ФОРМИ (3+2, ЦЕНТР, ОНОВЛЕНО) */
/* ========================================= */

.checkout-form-grid {
    display: flex;
    flex-direction: column;
    /* Вертикальна дистанція МІЖ РЯДАМИ (залишаємо 24px) */
    gap: 24px;
    align-items: center;
}

.form-row {
    display: grid;
    /* Горизонтальна дистанція МІЖ ПОЛЯМИ (за замовчуванням) */
    gap: 24px;
    width: 100%;
}

/* Рядок на 3 колонки (Ім'я, Прізвище, Телефон) */
.form-row-3-col {
    /* ▼▼▼ ЗМІНА 1: Поля стали "чуть больше" (було 250px) ▼▼▼ */
    grid-template-columns: repeat(3, minmax(0, 350px));

    /* ▼▼▼ ЗМІНА 2: Дистанція "ИМЕННО" між верхніми стала більше ▼▼▼ */
    gap: 40px;

    /* Центруємо цю групу з 3-х полів */
    justify-content: center;
}

/* Рядок на 2 колонки (Місто, Відділення) */
.form-row-2-col-wide {
    /* Поля "менші": 2 колонки, кожна МАКСИМУМ 350px */
    grid-template-columns: repeat(2, minmax(0, 400px));
    /* Центруємо цю групу з 2-х полів */
    justify-content: center;
    /* Використовує 'gap: 24px' від .form-row, що добре */
}

/* Адаптивність для мобільних */
@media (max-width: 768px) {
    .form-row-3-col,
    .form-row-2-col-wide {
        /* Все в одну колонку на мобільних */
        grid-template-columns: 1fr;
    }
}


/* ========================================= */
/* СТИЛІ ФІЛЬТРІВ (SIDEBAR)                  */
/* ========================================= */

/* Я ПОВНІСТЮ ПЕРЕПИСАВ ЦЕЙ БЛОК,
ЩОБ ВІН НЕ КОНФЛІКТУВАВ ЗІ СТАРИМИ СТИЛЯМИ
*/

/* --- ▼▼▼ ВИПРАВЛЕННЯ: Блок .sidebar та його відступи ▼▼▼ --- */
.sidebar {
    width: 240px;
    padding: 20px 20px 20px 0;
    border-right: 1px solid #f0f0f0;
    flex-shrink: 0;
}

/* --- ▼▼▼ ВИПРАВЛЕННЯ: Базові стилі для .filter-form та .filter-section ▼▼▼ --- */
.filter-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.filter-section {
    margin-bottom: 0; /* Скидаємо старий стиль */
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 24px;
}

.filter-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.filter-section h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- ▼▼▼ ВИПРАВЛЕННЯ: Скидаємо старі стилі для .filter-form input/select ▼▼▼ --- */
.filter-form input,
.filter-form select {
    width: auto; /* Скидаємо 100% */
    padding: 0;
    border: none;
    margin-bottom: 0;
}

/* --- ▼▼▼ ВИПРАВЛЕННЯ: Нові стилі для Price Range ▼▼▼ --- */
.price-range {
    display: flex;
    gap: 10px;
    align-items: center;
}

.price-range input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #000;
    -moz-appearance: textfield;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.price-range input[type="number"]::-webkit-inner-spin-button,
.price-range input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.price-range input[type="number"]:focus {
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
    outline: none;
}

.price-range::before {
    content: "—";
    color: #aaa;
    flex-shrink: 0;
    order: 1;
}
.price-range input[name="min_price"] { order: 0; }
.price-range input[name="max_price"] { order: 2; }

/* --- ▼▼▼ ВИПРАВЛЕННЯ: Нові стилі для Checkbox & Radio ▼▼▼ --- */
.filter-form ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-form li {
    margin-bottom: 0; /* Скидаємо старий стиль */
}

.filter-form input[type="checkbox"],
.filter-form input[type="radio"] {
    opacity: 0;
    position: absolute;
    width: 1px;
    height: 1px;
}

.filter-form label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: color 0.2s ease;
    padding-left: 28px;
    position: relative;
    min-height: 22px;
}

.filter-form label:hover {
    color: #000;
}

.filter-form label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #aaa;
    background: #fff;
    transition: all 0.2s ease;
}

.filter-form input[type="radio"] + label::before {
    border-radius: 50%;
}

.filter-form input[type="checkbox"] + label::before {
    border-radius: 4px;
}

.filter-form input[type="checkbox"]:checked + label::before,
.filter-form input[type="radio"]:checked + label::before {
    background-color: #000;
    border-color: #000;
}

.filter-form input[type="checkbox"] + label::after {
    content: '\2713';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    transition: transform 0.1s ease;
    line-height: 1;
}

.filter-form input[type="checkbox"]:checked + label::after {
    transform: translateY(-50%) scale(1);
}

.filter-form input[type="radio"] + label::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s ease;
}

.filter-form input[type="radio"]:checked + label::after {
    transform: translateY(-50%) scale(1);
}

.filter-form input[type="checkbox"]:focus + label::before,
.filter-form input[type="radio"]:focus + label::before {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
    border-color: #000;
}

/* --- ▼▼▼ ВИПРАВЛЕННЯ: Нові стилі для Select (Sort by) ▼▼▼ --- */
.filter-section select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #fff;
    color: #000;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23000' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
    margin-bottom: 0;
}

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

/* --- ▼▼▼ ВИПРАВЛЕННЯ: Нові стилі для Apply Button ▼▼▼ --- */
.filter-form .btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    background: #000;
    color: #fff;
    border: 2px solid #000;
    transition: background-color 0.2s ease, transform 0.2s ease;
    margin-top: 10px;
}

.filter-form .btn:hover {
    background: #333;
    border-color: #333;
    color: #fff;
    transform: translateY(-2px);
}
/* ========================================= */
/* КІНЕЦЬ СТИЛІВ ФІЛЬТРІВ                  */
/* ========================================= */

/* --- ▼▼▼ ВИДАЛЕНО: Блок .category-list був тут ▼▼▼ --- */


/* --- Styles for Phone Verification UI --- */

.phone-verification-group {
    display: flex;
    gap: 10px;
    align-items: stretch; /* Щоб висота співпадала */
}

/* Робимо поле вводу телефону гнучким */
.phone-verification-group input {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Кнопка "Підтвердити" */
.btn-verify {
    background: #000; /* Чорний фон */
    color: #fff;      /* Білий текст */
    border: 1px solid #000;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: 0 2px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-verify:hover {
    background: #333;
}

.btn-verify:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

/* Стиль кнопки, коли номер підтверджено */
.btn-verify.verified {
    background: #00a046; /* Зелений */
    border-color: #00a046;
    cursor: default;
}

.verified-input {
    border-color: #00a046 !important;
    background-color: #f0fdf4 !important;
    color: #555;
}

/* Стиль для заблокованої кнопки "Реєстрація" */
button[type="submit"]:disabled {
    background-color: #ccc !important; /* Сірий колір */
    border-color: #ccc !important;
    color: #666 !important;
    cursor: not-allowed;
    transform: none !important; /* Прибираємо ефект збільшення */
}

/* --- Стилі для опису товару (Rich Text) --- */

.product-description {
    line-height: 1.6; /* Покращує читабельність тексту */
    color: #333;      /* Або ваш основний колір тексту */
    font-size: 16px;
}

/* Робимо картинки адаптивними */
.product-description img {
    max-width: 100% !important; /* Картинка ніколи не буде ширшою за контейнер */
    height: auto !important;    /* Зберігає пропорції */
    border-radius: 8px;         /* Легке заокруглення (опціонально) */
    margin: 10px 0;             /* Відступи зверху і знизу */
    display: block;             /* Щоб margin працював коректно */
}

/* Відступи між абзацами */
.product-description p {
    margin-bottom: 15px;
}

/* Стилізація списків (часто зникає через CSS-reset) */
.product-description ul,
.product-description ol {
    margin-left: 20px;
    margin-bottom: 15px;
    padding-left: 20px;
}

.product-description ul {
    list-style-type: disc; /* Повертає крапочки для списків */
}

.product-description ol {
    list-style-type: decimal; /* Повертає цифри для нумерованих списків */
}

/* Заголовки всередині опису */
.product-description h2 {
    font-size: 1.5em;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
}

.product-description h3 {
    font-size: 1.25em;
    margin-top: 15px;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Таблиці (якщо будете використовувати) */
.product-description table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.product-description table td,
.product-description table th {
    border: 1px solid #ddd;
    padding: 8px;
}
