
/*
 * POSUDASKLAD
 * WooCommerce catalog and product category archives
 */

/* Контейнер каталога */
body.post-type-archive-product .site-main,
body.tax-product_cat .site-main {
    width: min(100% - 40px, var(--container-width, 1440px));
    margin-left: auto;
    margin-right: auto;
    padding-top: 35px;
    padding-bottom: 60px;
}

/* Заголовок каталога и категории */
body.post-type-archive-product .woocommerce-products-header,
body.tax-product_cat .woocommerce-products-header {
    margin-bottom: 24px;
}

body.post-type-archive-product .woocommerce-products-header__title,
body.tax-product_cat .woocommerce-products-header__title {
    margin: 0 0 12px;
    color: var(--color-dark, #343a40);
    font-size: 30px;
    line-height: 1.25;
    font-weight: 700;
}

/* Количество товаров и сортировка */
body.post-type-archive-product .woocommerce-result-count,
body.tax-product_cat .woocommerce-result-count {
    margin: 8px 0 18px;
    color: var(--color-muted, #777f87);
    font-size: 14px;
}

body.post-type-archive-product .woocommerce-ordering,
body.tax-product_cat .woocommerce-ordering {
    margin: 0 0 18px;
}

body.post-type-archive-product .woocommerce-ordering select,
body.tax-product_cat .woocommerce-ordering select {
    min-height: 40px;
    padding: 8px 34px 8px 12px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 6px;
    background: #fff;
    color: var(--color-text, #252a2e);
    font: inherit;
}

/* Сетка каталога */
body.post-type-archive-product .woocommerce ul.products,
body.tax-product_cat .woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 20px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

body.post-type-archive-product .woocommerce ul.products::before,
body.post-type-archive-product .woocommerce ul.products::after,
body.tax-product_cat .woocommerce ul.products::before,
body.tax-product_cat .woocommerce ul.products::after {
    display: none !important;
    content: none !important;
}

/* Карточка товара */
body.post-type-archive-product .woocommerce ul.products li.product,
body.tax-product_cat .woocommerce ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
    float: none !important;
    clear: none !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 14px !important;
    overflow: hidden;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 9px;
    background: #fff;
    box-sizing: border-box;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

body.post-type-archive-product .woocommerce ul.products li.product:hover,
body.tax-product_cat .woocommerce ul.products li.product:hover {
    border-color: #d5d9dd;
    box-shadow: 0 7px 20px rgba(37, 42, 46, .07);
    transform: translateY(-2px);
}

/* Фотография товара */
body.post-type-archive-product .woocommerce ul.products li.product a img,
body.tax-product_cat .woocommerce ul.products li.product a img {
    display: block;
    width: 100% !important;
    height: 230px !important;
    margin: 0 0 14px !important;
    object-fit: contain !important;
    object-position: center center;
    background: #fff;
}

/* Название */
body.post-type-archive-product .woocommerce ul.products li.product .woocommerce-loop-product__title,
body.tax-product_cat .woocommerce ul.products li.product .woocommerce-loop-product__title {
    min-height: 42px;
    margin: 0 0 9px !important;
    padding: 0 !important;
    color: var(--color-dark, #343a40);
    font-size: 14px;
    line-height: 1.45;
    font-weight: 600;
}

/* Цена */
body.post-type-archive-product .woocommerce ul.products li.product .price,
body.tax-product_cat .woocommerce ul.products li.product .price {
    display: block;
    margin: 0 0 13px !important;
    color: var(--color-text, #252a2e);
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
}

body.post-type-archive-product .woocommerce ul.products li.product .price del,
body.tax-product_cat .woocommerce ul.products li.product .price del {
    color: var(--color-muted, #777f87);
    font-size: 13px;
    font-weight: 400;
}

body.post-type-archive-product .woocommerce ul.products li.product .price ins,
body.tax-product_cat .woocommerce ul.products li.product .price ins {
    color: var(--color-orange, #f47700);
    text-decoration: none;
}

/* Кнопка покупки */
body.post-type-archive-product .woocommerce ul.products li.product .button,
body.tax-product_cat .woocommerce ul.products li.product .button {
    align-self: flex-start;
    margin: auto 0 0 !important;
    padding: 10px 16px !important;
    border: 0;
    border-radius: 5px;
    background: var(--color-orange, #f47700);
    color: #fff;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 600;
}

body.post-type-archive-product .woocommerce ul.products li.product .button:hover,
body.tax-product_cat .woocommerce ul.products li.product .button:hover {
    background: var(--color-orange-hover, #df6900);
    color: #fff;
}

/* Метка распродажи */
body.post-type-archive-product .woocommerce ul.products li.product .onsale,
body.tax-product_cat .woocommerce ul.products li.product .onsale {
    top: 12px !important;
    left: 12px !important;
    right: auto !important;
    min-height: 0;
    min-width: 0;
    margin: 0;
    padding: 6px 9px;
    border-radius: 4px;
    background: var(--color-orange, #f47700);
    color: #fff;
    font-size: 11px;
    line-height: 1.2;
}

/* Пагинация */
body.post-type-archive-product .woocommerce nav.woocommerce-pagination,
body.tax-product_cat .woocommerce nav.woocommerce-pagination {
    margin-top: 35px;
}

body.post-type-archive-product .woocommerce nav.woocommerce-pagination ul,
body.tax-product_cat .woocommerce nav.woocommerce-pagination ul {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    border: 0;
}

body.post-type-archive-product .woocommerce nav.woocommerce-pagination ul li,
body.tax-product_cat .woocommerce nav.woocommerce-pagination ul li {
    float: none;
    border: 0;
}

body.post-type-archive-product .woocommerce nav.woocommerce-pagination ul li a,
body.post-type-archive-product .woocommerce nav.woocommerce-pagination ul li span,
body.tax-product_cat .woocommerce nav.woocommerce-pagination ul li a,
body.tax-product_cat .woocommerce nav.woocommerce-pagination ul li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
    padding: 7px 11px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 5px;
}

/* Планшеты */
@media (max-width: 1000px) {
    body.post-type-archive-product .woocommerce ul.products,
    body.tax-product_cat .woocommerce ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 16px !important;
    }

    body.post-type-archive-product .woocommerce ul.products li.product a img,
    body.tax-product_cat .woocommerce ul.products li.product a img {
        height: 210px !important;
    }
}

/* Телефоны */
@media (max-width: 650px) {
    body.post-type-archive-product .site-main,
    body.tax-product_cat .site-main {
        width: calc(100% - 24px);
        padding-top: 22px;
    }

    body.post-type-archive-product .woocommerce ul.products,
    body.tax-product_cat .woocommerce ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    body.post-type-archive-product .woocommerce ul.products li.product,
    body.tax-product_cat .woocommerce ul.products li.product {
        padding: 10px !important;
    }

    body.post-type-archive-product .woocommerce ul.products li.product a img,
    body.tax-product_cat .woocommerce ul.products li.product a img {
        height: 155px !important;
        margin-bottom: 10px !important;
    }

    body.post-type-archive-product .woocommerce ul.products li.product .woocommerce-loop-product__title,
    body.tax-product_cat .woocommerce ul.products li.product .woocommerce-loop-product__title {
        min-height: 0;
        font-size: 12px;
    }

    body.post-type-archive-product .woocommerce ul.products li.product .price,
    body.tax-product_cat .woocommerce ul.products li.product .price {
        font-size: 16px;
    }

    body.post-type-archive-product .woocommerce ul.products li.product .button,
    body.tax-product_cat .woocommerce ul.products li.product .button {
        padding: 9px 11px !important;
        font-size: 12px;
    }
}

/* Фиксированная область изображений в каталоге */
.woocommerce ul.products li.product a img {
    width: 100%;
    height: 230px;
    object-fit: contain;
    object-position: center;
    margin: 0 0 15px;
}

/* Единая высота области изображения */
.woocommerce ul.products li.product {
    display: flex;
    flex-direction: column;
}

.woocommerce ul.products li.product a:first-child {
    display: block;
}

/* Адаптация для планшетов */
@media (max-width: 1000px) {
    .woocommerce ul.products li.product a img {
        height: 210px;
    }
}

/* Адаптация для мобильных */
@media (max-width: 650px) {
    .woocommerce ul.products li.product a img {
        height: 155px;
    }
}


/* =========================================
   CATALOG — UNIFIED PRODUCT GRID
========================================= */

/* Сетка каталога */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 36px 40px !important;
    margin: 0 !important;
    padding: 0 !important;
}

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

/* Карточка товара */
.woocommerce ul.products li.product {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;

    min-width: 0;
    height: 100%;
}

/* Ссылка с изображением и названием */
.woocommerce ul.products li.product > a:first-child {
    display: block;
    width: 100%;
    text-decoration: none;
}

/* Изображение */
.woocommerce ul.products li.product a img {
    display: block;
    width: 100% !important;
    height: 230px !important;
    object-fit: contain !important;
    object-position: center;
    margin: 0 0 14px !important;
}

/* Название — максимум две строки */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;

    height: 38px;
    min-height: 38px;

    line-height: 19px;
    margin: 0 0 6px !important;
    padding: 0 !important;
}

/* Цена */
.woocommerce ul.products li.product .price {
    display: block;
    min-height: 20px;
    margin: 0 0 12px !important;
    line-height: 20px;
}

/* Кнопки */
.woocommerce ul.products li.product .button {
    display: block !important;
    width: 100%;
    box-sizing: border-box;
    margin: auto 0 0 !important;
    text-align: center;
}

/* Адаптация */
@media (max-width: 1000px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 30px 24px !important;
    }

    .woocommerce ul.products li.product a img {
        height: 210px !important;
    }
}

@media (max-width: 650px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 26px 16px !important;
    }

    .woocommerce ul.products li.product a img {
        height: 155px !important;
    }

    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 13px;
        line-height: 17px;
        height: 34px;
        min-height: 34px;
    }
}


/* =========================================
   CATALOG — VISUAL STYLE
========================================= */

/* Основной шрифт каталога */
.woocommerce-page {
    font-family: 'Inter', Arial, sans-serif;
}

/* Заголовок каталога */
.woocommerce-products-header__title {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.25;
    color: #252b32;
    margin-bottom: 24px;
}

/* Карточки */
.woocommerce ul.products li.product {
    padding: 12px !important;
    border: 1px solid #eeeeee;
    border-radius: 9px;
    background: #ffffff;
    transition: transform .25s ease, box-shadow .25s ease,
                border-color .25s ease;
}

/* Hover карточки */
.woocommerce ul.products li.product:hover {
    transform: translateY(-4px);
    border-color: #dedede;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}

/* Изображения */
.woocommerce ul.products li.product a img {
    height: 220px !important;
    margin-bottom: 16px !important;
}

/* Название товара */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: #252b32 !important;
    height: 42px;
    min-height: 42px;
    margin-bottom: 9px !important;
}

/* Цена */
.woocommerce ul.products li.product .price {
    font-size: 15px !important;
    font-weight: 600;
    color: #b47a00 !important;
    margin-bottom: 14px !important;
}

/* Кнопки каталога */
.woocommerce ul.products li.product .button {
    width: 100%;
    min-height: 42px;
    display: flex !important;
    align-items: center;
    justify-content: center;

    padding: 10px 14px !important;
    border: none !important;
    border-radius: 6px !important;

    background: #f28c00 !important;
    color: #ffffff !important;

    font-family: inherit;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none;

    transition: background .2s ease,
                transform .2s ease,
                box-shadow .2s ease;
}

/* Hover кнопки */
.woocommerce ul.products li.product .button:hover {
    background: #d97700 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(242, 140, 0, .25);
}

/* Фокус клавиатуры */
.woocommerce ul.products li.product .button:focus-visible {
    outline: 2px solid #252b32;
    outline-offset: 3px;
}

/* Счётчик товаров */
.woocommerce-result-count {
    font-size: 13px;
    color: #747b84;
}

/* Сортировка */
.woocommerce-ordering select {
    min-height: 42px;
    font-family: inherit;
    font-size: 14px;
    border-radius: 6px;
}

/* Планшеты */
@media (max-width: 1000px) {
    .woocommerce ul.products li.product a img {
        height: 200px !important;
    }
}

/* Мобильные */
@media (max-width: 650px) {
    .woocommerce ul.products li.product {
        padding: 8px !important;
    }

    .woocommerce ul.products li.product a img {
        height: 145px !important;
    }

    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 14px !important;
        height: 40px;
        min-height: 40px;
    }

    .woocommerce ul.products li.product .price {
        font-size: 14px !important;
    }

    .woocommerce ul.products li.product .button {
        font-size: 13px !important;
        min-height: 38px;
    }
}


/* =========================================
   CATALOG — PRODUCT CARDS DESIGN
========================================= */

/* Светлый фон области каталога */
.woocommerce-page .site-main {
    background: #f7f8fa;
}

/* Карточки товаров */
.woocommerce ul.products li.product {
    background: #ffffff !important;
    border: 1px solid #e1e5ea !important;
    border-radius: 12px !important;

    padding: 14px !important;

    box-shadow: 0 2px 8px rgba(25, 35, 45, 0.04);

    transition:
        transform .25s ease,
        box-shadow .25s ease,
        border-color .25s ease;
}

/* Наведение на карточку */
.woocommerce ul.products li.product:hover {
    transform: translateY(-5px);

    border-color: #f28c00 !important;

    box-shadow:
        0 8px 24px rgba(25, 35, 45, 0.10);
}

/* Изображение товара */
.woocommerce ul.products li.product a img {
    border-radius: 7px;
}

/* Название */
.woocommerce ul.products li.product
.woocommerce-loop-product__title {
    color: #252b32 !important;
}

/* Цена */
.woocommerce ul.products li.product .price {
    color: #b87500 !important;
}

/* Кнопки */
.woocommerce ul.products li.product .button {
    background: #f28c00 !important;
    border-radius: 7px !important;
}

.woocommerce ul.products li.product .button:hover {
    background: #d97700 !important;
}

/* Убираем изменение карточки на мобильных устройствах */
@media (hover: none) {
    .woocommerce ul.products li.product:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(25, 35, 45, 0.04);
    }
}

