/*
Theme Name: Web Site Anril
Theme URI: https://anril.site
Author: Web Developer
Author URI: https://anril.site
Description: Індивідуальна тема для інтернет-магазину на базі WooCommerce.
Version: 1.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: web-site-anril
Tags: custom-logo, e-commerce, woocommerce, two-columns, right-sidebar, translation-ready
*/

body { margin: 0; font-family: sans-serif; }

header {
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Верхній банер */
.top-banner-area { background: #cce6ff; width: 100%; text-align: center; }
.top-banner-widget { padding: 10px; font-weight: bold; color: #000; }
.top-banner-widget p { margin: 0; }
.top-banner-widget img { max-width: 100%; height: auto; display: block; margin: 0 auto; }

/* Шапка */
.site-header { display: flex; align-items: center; gap: 15px; padding: 10px 20px; background: #222; color: #fff; flex-wrap: wrap; position: relative; }
.hamburger { display: none; background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; }
.logo { display: flex; align-items: center; }
.logo a { text-decoration: none; }
.logo h2 { margin: 0; color: #00a046; }
.logo img { max-height: 40px; }

.btn-catalog { padding: 10px 15px; background: rgba(255,255,255,0.1); border: none; color: #fff; border-radius: 4px; cursor: pointer; display: flex; gap: 8px; align-items: center; }

.search-bar { flex-grow: 1; display: flex; background: #fff; border-radius: 4px; overflow: hidden; min-width: 200px; }
.search-bar input { width: 100%; padding: 10px; border: none; outline: none; }
.search-bar .mic { background: none; border: none; padding: 0 10px; cursor: pointer; font-size: 18px; }
.search-bar .find { padding: 10px 20px; background: #00a046; color: #fff; border: none; cursor: pointer; }

.header-actions { display: flex; gap: 15px; font-size: 20px; align-items: center; }

/* Каталог */
#catalog-menu { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; color: #333; box-shadow: 0 4px 5px rgba(0,0,0,0.2); z-index: 100; min-height: 400px; }
.catalog-left { width: 300px; background: #f5f5f5; padding: 10px 0; }
.catalog-left li { padding: 10px 20px; cursor: pointer; list-style: none; margin: 0; }
.catalog-left li:hover, .catalog-left li.active { background: #fff; color: #00a046; }

.catalog-right { padding: 20px; flex-grow: 1; }
.sub-cats { display: none; gap: 40px; flex-wrap: wrap; }
.sub-cats.active { display: flex; }
.sub-col { width: 200px; }
.sub-col h4 { margin-top: 0; margin-bottom: 10px; font-size: 16px; }
.sub-col ul { list-style: none; padding: 0; margin: 0; }
.sub-col ul li { margin-bottom: 8px; font-size: 14px; }
.sub-col ul li a { text-decoration: none; color: #3e77aa; }
.sub-col ul li a:hover { color: #f84147; text-decoration: underline; }

/* Нижня панель для мобільних */
.mobile-bottom-nav { display: none; position: fixed; bottom: 0; left: 0; width: 100%; background: #fff; box-shadow: 0 -2px 5px rgba(0,0,0,0.1); z-index: 1000; justify-content: space-around; padding: 10px 0; font-size: 11px; color: #666; }
.mobile-bottom-nav div { display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; }
.mobile-bottom-nav div i { font-size: 20px; font-style: normal; }

/* Адаптивність шапки */
@media (max-width: 768px) {
    body { padding-bottom: 60px; }
    .btn-catalog, .header-actions .hide-mobile, .search-bar .find { display: none; }
    .hamburger, .mobile-bottom-nav { display: flex; }
    .site-header { padding: 10px; gap: 10px; justify-content: space-between; }
    .search-bar { order: 4; width: 100%; flex-basis: 100%; margin-top: 5px; }
    #catalog-menu { flex-direction: column; }
    .catalog-left { width: 100%; }
}

:root :where(p.has-background) { padding: 0; }

/* Сітка категорій (Головна сторінка) */
.category-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); 
    border-top: 1px solid #e9e9e9;
    border-left: 1px solid #e9e9e9;
}

.cat-card { 
    padding: 20px; 
    border-right: 1px solid #e9e9e9; 
    border-bottom: 1px solid #e9e9e9; 
    background: #fff;
    display: flex;
    flex-direction: column;
}

.cat-img { height: 150px; display: flex; align-items: center; justify-content: center; margin-bottom: 15px; }
.cat-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cat-title { font-size: 16px; margin: 0 0 10px 0; font-weight: normal; }
.cat-title a { color: #3e77aa; text-decoration: none; }
.cat-title a:hover { color: #f84147; text-decoration: underline; }
.cat-subs { list-style: none; padding: 0; margin: 0; }
.cat-subs li { margin-bottom: 8px; font-size: 13px; }
.cat-subs li a { color: #3e77aa; text-decoration: none; }
.cat-subs li a:hover { color: #f84147; text-decoration: underline; }

/* Макет сторінки каталогу */
.shop-layout { display: flex; gap: 30px; align-items: flex-start; }
.shop-sidebar { width: 260px; flex-shrink: 0; }
.shop-content { flex-grow: 1; min-width: 0; }

/* Сітка товарів WooCommerce (5 колонок) */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 15px;
    margin: 0;
    padding: 0;
    clear: both;
}
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none !important; }

/* Адаптивність сітки */
@media (max-width: 1200px) { .woocommerce ul.products { grid-template-columns: repeat(4, 1fr) !important; } }
@media (max-width: 992px) { .woocommerce ul.products { grid-template-columns: repeat(3, 1fr) !important; } }
@media (max-width: 768px) {
    .shop-layout { flex-direction: column; }
    .shop-sidebar { width: 100%; }
    .woocommerce ul.products { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ======= СІТКА ТОВАРІВ (ФІКС ШИРИНИ) ======= */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important; /* Рівно 5 колонок */
    gap: 15px !important;
    margin: 20px 0 !important;
    padding: 0 !important;
    list-style: none !important;
}
/* ======= ПАНЕЛЬ ІНСТРУМЕНТІВ МАГАЗИНУ ======= */
/* Новий контейнер для заголовка та кнопок */
.shop-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Вирівнювання по верху, щоб довгий заголовок не ламав кнопки */
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}

.shop-title-group h1.page-title {
    margin: 0 0 5px 0 !important;
    font-size: 28px;
    font-weight: bold;
    color: #000;
}

.shop-result-count {
    font-size: 14px;
    color: #666;
}

/* Оновлений тулбар (прибираємо зайві рамки та маржини, бо вони тепер у батька) */
.shop-toolbar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 0 !important;
    border-bottom: none !important;
    padding: 0 !important;
}

/* Адаптивність для мобілок */
@media (max-width: 768px) {
    .shop-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .shop-toolbar {
        width: 100%;
        justify-content: space-between;
    }
}

.view-switcher {
    display: flex;
    gap: 5px;
}

.view-btn {
    width: 38px;
    height: 38px;
    background: #fff;
    border: 1px solid #e9e9e9;
    color: #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

/* Зелена рамка для активної кнопки як на скрині */
.view-btn.active {
    border-color: #00a046 !important;
    color: #00a046 !important;
}

.woocommerce-ordering select {
    height: 38px;
    border: 1px solid #e9e9e9 !important;
    background: #fff !important;
    padding: 0 10px !important;
    color: #333;
    font-size: 14px;
    border-radius: 2px !important;
}
/* Стилізація стандартного сортування WooCommerce */
.woocommerce-ordering {
    margin: 0 !important; /* Прибираємо стандартні маржини */
    float: none !important;
}


.woocommerce-ordering select:hover {
    border-color: #d2d2d2 !important;
}

/* Ховаємо дублікат сортування, який може виводити woocommerce_content() */
.shop-content > .woocommerce-ordering:last-of-type {
    display: none;
}
/* 1. Панель вправо */
.shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end !important; /* Принудительно вправо */
    gap: 15px;
    padding: 10px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

/* 2. РЕЖИМ СПИСКА (List View) */
ul.products.list-view {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
}

ul.products.list-view li.product {
    flex-direction: row !important; /* Фото зліва, текст справа */
    align-items: stretch !important;
    padding: 15px !important;
    min-height: 150px; /* Обмежуємо висоту */
    padding-bottom: 15px !important;
}

/* Обмежуємо фото у списку */
ul.products.list-view li.product .woocommerce-loop-product__link {
    width: 150px !important; /* Фіксована ширина фото */
    height: 150px !important;
    margin-right: 20px !important;
    margin-bottom: 0 !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

ul.products.list-view li.product .woocommerce-loop-product__link img {
    max-height: 130px !important;
    width: auto !important;
}

/* Текстова частина у списку */
ul.products.list-view li.product .woocommerce-loop-product__title {
    min-height: 0 !important; /* У списку назва може бути в один рядок */
    margin-top: 5px !important;
    font-size: 16px !important;
}

ul.products.list-view li.product .rating-actions-row {
    margin-top: 10px !important;
    justify-content: flex-start !important;
    gap: 15px;
}

/* Ціна та кошик у списку */
ul.products.list-view li.product .price {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    margin-top: 20px !important;
    font-size: 26px !important;
}

ul.products.list-view li.product .button {
    bottom: 15px !important;
    right: 15px !important;
}

/* Адаптив для списка */
@media (max-width: 600px) {
    ul.products.list-view li.product {
        flex-direction: column !important;
    }
    ul.products.list-view li.product .woocommerce-loop-product__link {
        width: 100% !important;
        margin-right: 0 !important;
    }
}

/* ======= КАРТКА ТОВАРУ (ОСНОВА) ======= */
.woocommerce ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
    background: #fff !important;
    border: 1px solid #e9e9e9 !important;
    border-radius: 4px !important;
    padding: 15px !important;
    padding-bottom: 45px !important; /* Місце під ціну та кошик */
    margin: 0 !important;
    width: auto !important; /* Дозволяємо гриду керувати шириною */
    position: relative !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
}

/* Ефект при наведенні */
.woocommerce ul.products li.product:hover {
    transform: scale(1.03) translateY(-5px) !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
    border-color: #00a046 !important;
    z-index: 10 !important;
}

/* Фото товару */
.woocommerce ul.products li.product .woocommerce-loop-product__link img {
    max-height: 180px !important;
    width: auto !important;
    margin: 0 auto 15px !important;
    display: block !important;
    object-fit: contain !important;
}

/* Назва товару */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 14px !important;
    color: #333 !important;
    font-weight: normal !important;
    line-height: 1.4 !important;
    margin: 0 0 5px 0 !important;
    min-height: 2.8em !important; /* Рівно 2 рядки */
    display: block !important;
}

/* ======= РЕЙТИНГ ТА КНОПКИ (В ОДИН РЯДОК) ======= */
.rating-actions-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: auto !important; /* Притискає блок до низу назви */
    margin-bottom: 15px !important;
    height: 24px !important;
}

/* Контейнер для рейтингу та цифри відгуків */
.card-rating-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
}

.review-count {
    font-size: 12px;
    color: #888;
}

/* ======= МАГІЯ ЗІРОЧОК ======= */
.star-rating {
    overflow: hidden;
    position: relative;
    height: 1.2em;
    line-height: 1;
    font-size: 14px !important;
    width: 75px !important; /* Фіксована ширина для 5 зірок */
    font-family: 'WooCommerce' !important;
}

/* Фон (сірі зірки) */
.star-rating::before {
    content: '\s\s\s\s\s' !important; /* Символи порожніх зірок у шрифті WC */
    color: #e0e0e0 !important;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
    letter-spacing: 2px;
}

/* Заповнення (жовті зірки) */
.star-rating span {
    overflow: hidden;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
    padding-top: 1.5em; /* Ховаємо текст, залишаємо фон */
}

.star-rating span::before {
    content: '\S\S\S\S\S' !important; /* Символи заповнених зірок */
    top: 0;
    position: absolute;
    left: 0;
    color: #ffa900 !important; /* Твій золотий колір */
    letter-spacing: 2px;
}

/* Якщо шрифт WooCommerce не підтягнувся, використовуємо стандартні символи як бекап */
@font-face {
    font-family: 'WooCommerce';
    src: url('/wp-content/plugins/woocommerce/assets/fonts/WooCommerce.eot');
    src: url('/wp-content/plugins/woocommerce/assets/fonts/WooCommerce.eot?#iefix') format('embedded-opentype'),
         url('/wp-content/plugins/woocommerce/assets/fonts/WooCommerce.woff') format('woff'),
         url('/wp-content/plugins/woocommerce/assets/fonts/WooCommerce.ttf') format('truetype'),
         url('/wp-content/plugins/woocommerce/assets/fonts/WooCommerce.svg#WooCommerce') format('svg');
    font-weight: normal;
    font-style: normal;
}

/* Кнопки Ваги та Серце */
.card-actions { display: flex !important; gap: 10px !important; }
.card-actions .action-btn { 
    font-size: 18px !important; 
    color: #888 !important; 
    text-decoration: none !important; 
}
.action-btn.compare-btn { color: #ffa900 !important; }
.action-btn:hover { color: #f84147 !important; transform: scale(1.1); }

/* ======= ЦІНА ТА КОШИК ======= */
.woocommerce ul.products li.product .price {
    position: absolute !important;
    bottom: 7px !important;
    left: 15px !important;
    font-size: 22px !important;
    font-weight: bold !important;
    color: #f84147 !important;
    display: block !important;
}

.woocommerce ul.products li.product .button {
    position: absolute !important;
    bottom: 15px !important;
    right: 15px !important;
    background: transparent !important;
    color: #00a046 !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    font-size: 0 !important; /* Ховаємо текст */
    border: none !important;
}
.woocommerce ul.products li.product .button::before {
    content: '🛒' !important;
    font-size: 26px !important;
    line-height: 36px !important;
    display: block !important;
}

/* Очищення від сміття плагінів */
.woosw-btn, .woosc-btn, .woosw-adapter, .button.woosw-button { display: none !important; }

/* Адаптивність */
@media (max-width: 1200px) { .woocommerce ul.products { grid-template-columns: repeat(4, 1fr) !important; } }
@media (max-width: 992px) { .woocommerce ul.products { grid-template-columns: repeat(3, 1fr) !important; } }
@media (max-width: 768px) { .woocommerce ul.products { grid-template-columns: repeat(2, 1fr) !important; } }




/* ======= ТЕМНИЙ ФУТЕР ======= */
.site-footer-dark { background: #222; color: #ccc; font-size: 14px; margin-top: 40px; }
.site-footer-dark a { color: #ccc; text-decoration: none; transition: 0.3s; }
.site-footer-dark a:hover { color: #fff; }
.site-footer-dark .footer-container { max-width: 1400px; margin: 0 auto; padding: 50px 20px; }
.site-footer-dark .footer-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 30px; }
.site-footer-dark .footer-col { flex: 1; min-width: 250px; }
.site-footer-dark h4 { color: #fff; margin: 0 0 25px 0; font-size: 16px; font-weight: normal; padding-left: 10px; border-left: 3px solid #4CAF50; line-height: 1; }
.mt-20 { margin-top: 30px !important; }

.contact-item { display: flex; align-items: center; margin-bottom: 20px; gap: 15px; }
.contact-item .icon { width: 36px; height: 36px; border: 1px solid #444; display: flex; align-items: center; justify-content: center; filter: sepia(100%) hue-rotate(80deg) saturate(300%); }

.border-list ul { list-style: none; padding: 0; }
.border-list ul li { border-bottom: 1px solid #333; padding: 12px 0; }
.border-list ul li:last-child { border-bottom: none; }

.social-blocks { display: flex; gap: 5px; }
.social-blocks a { display: flex; align-items: center; justify-content: center; width: 45px; height: 45px; color: #fff; }
.soc-fb { background: #3b5998; } .soc-ig { background: #517fa4; } .soc-yt { background: #bb0000; } .soc-tk { background: #000; }

.footer-bottom-dark { background: #1a1a1a; text-align: center; padding: 20px; font-size: 13px; color: #666; }