/*
Theme Name: Shopwell Child
Template: shopwell
Version: 1.0
*/

/* Исправление несовместимости плагина Filter Everything и темы*/
.offscreen-panel {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1600;
    display: none;
}

/*Стили для сетки категорий*/
.cars-logo-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 20px;
}

.cars-logo {
    text-align: center;
    width: 100px;
}

.cars-logo img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
}

.cars-logo span {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

/* Кликабельность "Похожие товары" */
.related.products {
    pointer-events: inherit !important;
}

.header-logo {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
}
.header-logo:not(.no-logo) .site-title {
    font-size: 32px !important;
    margin: 0 !important;
    clip: auto !important;
    clip-path: none !important;
    height: auto !important;
    /*margin: -1px;*/
    overflow: clip !important;
    /*padding: 0;*/
    position: relative !important;
    width: auto !important;
    /*word-wrap: normal !important;*/
}
.header-logo:not(.no-logo) .site-title a {
    display: block !important;
    transition: none !important;
}

.custom-logo-link, .site-header__mobile .header-logo > a img, .site-header__mobile .header-logo > a svg {
    width: 64px !important;
}

/* =========================================
   Стили для каталога (как на bamper.by)
   ========================================= */

.katalog-page h1 {
    margin-bottom: 24px;
    font-size: 26px;
    font-weight: 700;
}

.katalog-page h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Макет с сайдбаром */
.katalog-layout {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

.katalog-sidebar {
    width: 260px;
    flex-shrink: 0;
}

.katalog-content {
    flex-grow: 1;
    min-width: 0; /* Fix for grid overflow */
    width: 100%; /* Занимаем всю доступную ширину */
}

/* Стили для сайдбара */
.sidebar-block {
    margin-bottom: 30px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 20px;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    text-transform: uppercase;
}

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

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-menu li:last-child {
    margin-bottom: 0;
}

.sidebar-menu a {
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: color 0.2s;
    display: block;
}

.sidebar-menu a:hover {
    color: #000;
    text-decoration: underline;
}

.sidebar-banner img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

/* Сетка для марок и запчастей (Карточки) */
.katalog-grid {
    display: grid;
    /* Изменено: автозаполнение колонок, минимальная ширина 180px */
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    width: 100%; /* Сетка на всю ширину */
}

.katalog-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    height: 100%;
    position: relative;
}

.katalog-card:hover {
    border-color: #999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    color: #000;
    z-index: 2;
}

.katalog-card__icon {
    font-size: 32px;
    margin-bottom: 12px;
    color: #666;
}

.katalog-card__title {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
}

/* Сетка для моделей (Компактные блоки) */
.katalog-columns {
    display: grid;
    /* Изменено: автозаполнение колонок, минимальная ширина 150px */
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 40px;
    width: 100%; /* Сетка на всю ширину */
}

.katalog-columns a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 15px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 3px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    min-height: 48px;
}

.katalog-columns a:hover {
    background-color: #f8f8f8;
    border-color: #666;
    color: #000;
}

/* Адаптив */
@media (max-width: 992px) {
    .katalog-layout {
        flex-direction: column;
    }

    .katalog-sidebar {
        width: 100%;
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) {
    .katalog-grid {
        /* На мобильных оставляем 2 колонки, но можно сделать и auto-fill с меньшим minmax */
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .katalog-card {
        padding: 15px 10px;
    }

    .katalog-columns {
        /* На мобильных тоже auto-fill */
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}
