body {
    font-family: "Inter", sans-serif;
    background-color: #f9fafb;
}

html {
    scrollbar-gutter: stable;
}

.main-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    height: 56px;
    max-height: 56px;
    box-sizing: border-box;
}
.main-header-inner > * {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}
.main-header-inner .logo img {
    max-height: 36px !important;
    height: 36px !important;
    min-height: 0 !important;
    width: auto !important;
    object-fit: contain !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: content-box !important;
}
header.sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1020;
    width: 100%;
}

.custom-sidebar-wrapper {
    z-index: 2000;
    position: relative;
}

.category-sidebar a:hover {
    background-color: #f97316;
    color: white;
    padding-left: 1.25rem;
}

.category-sidebar a {
    line-height: 1.6;
}
.category-sidebar li {
    position: relative;
}
.category-sidebar .current-cat > a,
.category-sidebar .current-cat-parent > a {
  color: #ffffff !important;
  background-color: #f97316 !important;
  padding-left: 1.25rem;
  font-weight: bold;
}

.category-sidebar .current-cat > a:hover,
.category-sidebar .current-cat-parent > a:hover {
  color: #ffffff !important;
  background-color: #f97316 !important;
}

/* Highlight Products title when on shop page */
body.post-type-archive-product h3.shop-active a,
body.woocommerce-shop h3.shop-active a {
  color: #f97316 !important;
  font-weight: bold;
}

.category-sidebar .submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: -1px;
    width: 250px;
    z-index: 9999;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 0.5rem;
}
.category-sidebar li:hover > .submenu {
    display: block;
}
.category-sidebar .submenu li {
    border: none;
}
.category-sidebar .submenu li a {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: #374151;
    font-weight: normal;
    border-radius: 0.25rem;
    transition: background-color 0.2s, color 0.2s;
}
.category-sidebar .submenu li a:hover {
    background-color: #f97316;
    color: #ffffff;
}

.woocommerce-message,
.woocommerce-info {
    border-top-color: #f97316;
}

.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce button.button.alt {
    background-color: #f97316 !important;
    color: white !important;
}
.woocommerce #respond input#submit:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce button.button.alt:hover {
    background-color: #ea580c !important;
    color: white !important;
}

.woocommerce ul.products {
    display: grid;
    grid-gap: 1.5rem; /* Расстояние между карточками */
    /* Используем auto-fill, чтобы НЕ растягивать элементы */
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    /* Дополнительно можно прижать элементы влево */
    justify-content: flex-start;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
    content: none;
    display: none;
}

.woocommerce ul.products li.product {
    margin: 0 !important;
    width: 240px !important;
    float: none !important;
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #ffffff;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
}
.woocommerce ul.products li.product .woocommerce-loop-product__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}
.woocommerce ul.products li.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(100, 75, 75, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
.woocommerce ul.products li.product img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.woocommerce ul.products li.product:hover img {
    transform: scale(1.05);
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    padding: 1rem 1rem 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    flex-grow: 1; 
}
.woocommerce ul.products li.product .price {
    display: block;
    padding: 0 1rem 1rem;
    color: #111827;
    font-size: 1.5rem;
    font-weight: 700;
}
.woocommerce ul.products li.product .button {
    display: block;
    width: calc(100% - 2rem);
    margin: 0 1rem 1rem;
    text-align: center;
    margin-top: auto;
}

.woocommerce-pagination {
    margin-top: 4rem;
    display: flex;
    justify-content: center;
}
.woocommerce-pagination ul.page-numbers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
}
.woocommerce-pagination .page-numbers li {
    margin: 0;
}
.woocommerce-pagination .page-numbers a,
.woocommerce-pagination .page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #e5e7eb;
    border-radius: 0.25rem;
    background-color: #fff;
    color: #374151;
    transition: all 0.2s ease;
    text-decoration: none;
}
.woocommerce-pagination .page-numbers a:hover {
    background-color: #f97316;
    color: #fff;
    border-color: #f97316;
}
.woocommerce-pagination .page-numbers span.current {
    background-color: #f97316;
    color: #fff;
    border-color: #f97316;
    font-weight: bold;
}

.lang-active {
    font-weight: bold;
    color: #f97316;
    text-decoration: underline;
}
.polylang-switcher .current-lang a {
    font-weight: 700;
    color: #F97316;
    cursor: default;
}
.polylang-switcher li:not(.current-lang) a {
    opacity: 0.7;
    transition: opacity 0.2s;
}
.polylang-switcher li:not(.current-lang) a:hover {
    opacity: 1;
}
.polylang-switcher li a {
    text-transform: uppercase;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
}

.custom-cart-styles .wc-block-cart__submit-button {
    background-color: #f97316;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 0.25rem;
    padding: 0.6rem 1.2rem;
    font-size: 0.875rem;
    text-align: center;
    border: none;
    width: auto;
    float: right;
    clear: both;
}
.custom-cart-styles .wc-block-cart__submit-button:hover {
    background-color: #ea580c;
    color: white;
}
.custom-checkout-styles .wc-block-components-checkout-place-order-button {
    background-color: #f97316;
    color: white !important;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 0.50rem;
    padding: 0.6rem 1.2rem;
    font-size: 0.875rem;
    text-align: center;
    border: none;
    height: auto;
    width: auto;
    float: right;
}
.custom-checkout-styles .wc-block-components-checkout-place-order-button:hover {
    background-color: #ea580c;
    color: white !important;
}
.single-product .quantity + .single_add_to_cart_button {
    margin-left: 1rem;
}
.single-product .single_add_to_cart_button {
    padding: 0.6rem 1.2rem !important;
    font-size: 0.875rem !important;
}
html {
    scrollbar-gutter: stable;
}


/* --- Стили для карточек брендов на странице категорий --- */

.brand-card {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Центрируем содержимое по вертикали */
    align-items: center;     /* Центрируем содержимое по горизонтали */
    background-color: #ffffff;
    min-height: 180px; /* Задаем минимальную высоту для карточки */
}

.brand-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.brand-image-container {

    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-card img,
.brand-logo {
    max-width: 200px;     /* Ограничиваем ширину логотипа */
    max-height: 170px;     /* Ограничиваем высоту логотипа */
    width: auto;
    height: auto;
    object-fit: contain;  /* Сохраняем пропорции логотипа */
    object-position: center; /* Центрируем изображение */
}

.brand-card h2 {
    margin-top: 1rem; /* Добавляем отступ, если картинки нет */
    text-align: center;
    line-height: 1.2;
}

/* --- Улучшение стилей для карточек в конфигураторе --- */

/* 1. Делаем правую часть (цена и кнопки) одинаковой ширины */
.product-configurator-container .flex.justify-between > .flex.flex-col {
    min-width: 160px; /* Задаем минимальную ширину для блока с ценой/кнопками */
    flex-shrink: 0; /* Запрещаем блоку сжиматься */
}

/* 2. Улучшаем вид текста "Pēc pieprasījuma" */
.product-configurator-container .text-lg.font-semibold {
    white-space: nowrap; /* Запрещаем тексту переноситься на новую строку */
    margin-bottom: 2.25rem; /* Добавляем отступ снизу, чтобы выровнять с карточками, где есть кнопки */
}

/* ========================================
   СКРЫТИЕ СЧЕТЧИКОВ ТОВАРОВ В КАТЕГОРИЯХ
   ======================================== */

/* Убираем количество товаров в скобках у названий категорий */
.count,
.product-count {
    display: none !important;
}

/* Убираем скобки с количеством товаров в названиях категорий */
.woocommerce-loop-category__title .count,
.wc-block-product-categories-list .wc-block-product-categories-list-item .count,
h2.woocommerce-loop-category__title .count {
    display: none !important;
}
