/* ============ КНОПКИ (общие) ============ */

.btn-yellow {
    gap: 5px;
    display: grid;
    /* max-width: 40%; */
    align-items: center;
    justify-content: left;
    padding: 5px;
    border: none;
    background: #fac207;
    padding: 8px;
    border-radius: 3px;
    color: #000;
    font-weight: 400;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.btn-yellow:hover {}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 4px;
    border: 1px solid #ffcc00;
    background: #fff;
    color: #000;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.btn-outline:hover {
    background: #ffcc00;
    color: #000;
}

/* ============ КНОПКИ (общие) ============ */

.btn-yellow-1 {
    gap: 5px;
    display: grid;
    max-width: 40%;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border: none;
    background: transparent;
    padding: 8px;
    border-radius: 3px;
    color: #000;
    font-weight: 400;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.btn-yellow-1:hover {
    font-weight: 600;

}

.btn-outline-1 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 4px;
    border: 1px solid #ffcc00;
    background: #fff;
    color: #000;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.btn-outline-1:hover {
    background: #ffcc00;
    color: #000;
}

/* ============ СЧЁТЧИК КОРЗИНЫ + TOAST ============ */

.blok-icon-korzina-header {
    position: relative;
}

.cart-count-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    padding: 2px 4px;
    border-radius: 999px;
    background: #ffcc00;
    color: #000;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.cart-count-badge--hidden {
    display: none;
}

.cart-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: #111;
    color: #fff;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 9999;
}

.cart-toast--visible {
    opacity: 0.95;
    transform: translateY(0);
}

/* ============ КАТАЛОГ ============ */

.catalog-main {
    padding: 100px 0 80px;
    min-height: 700px;
}

@media (max-width: 1100px) {
    .catalog-main {
        padding: 60px 0 80px;

    }
}

.catalog-page {
    width: 100%;
}

.catalog-container {
    max-width: 1410px;
    margin: 0 auto;
    padding: 0 20px;
}

.catalog-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 24px;
}

/* верхняя панель: селект + поиск */

.catalog-controls {
    margin-bottom: 20px;
}

.catalog-filters-row {
    display: flex;
    /* flex-wrap: wrap; */
    gap: 10px;
    align-items: center;
}

.catalog-filter-select-wrap {
    flex: 0 0 290px;
}

.catalog-filter-select {
    width: 100%;
    height: 36px;
    border-radius: 3px;
    border: 1px solid #ccc;
    padding: 0 12px;
    font-size: 14px;
    background-color: #fff;
    appearance: none;
}

.catalog-search-wrap {
    flex: 1 1 260px;
}

.catalog-search-input {
    width: 100%;
    height: 36px;
    border-radius: 3px;
    border: 1px solid #ccc;
    padding: 0 10px;
    font-size: 14px;
}

.catalog-search-hint {

    font-size: 12px;
    color: #777;
}

.catalog-search-b1 {
    display: grid;
    width: 100%;
}

/* ---------- сетка карточек (CSS Grid) ---------- */
/* 5 / 4 / 3 / 2 / 1 по брейкпоинтам */

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    /* >=1350 */
    gap: 12px;
}

.catalog-card {
    background: #ffffff;
    border-radius: 3px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    padding: 12px;
    /* min-height: 440px; */
    border: 1px solid #d5d5d5;
    position: relative;
}

.catalog-card--hit {
    /* Removed orange border/shadow per user request (Step 722/736) */
}

.korz-cart {}

.ofor-cart {
    display: grid;
    width: 60%;
    justify-content: center;
    align-content: center;
    align-items: center;
    /* border: 1px solid #f9c115; */
    /* border-radius: 3px; */
    /* max-height: 30px; */
    /* margin-top: 33px; */
}

.ofor-cart-text {
    font-size: 19px;
    font-weight: 550;
    margin-top: -5px;
    border: 1px solid #f9c115;
    border-radius: 3px;
    margin-top: 7px;
    display: grid;
    justify-content: center;
    align-content: center;
    align-items: center;
    padding-bottom: 5px;
}

.ofor-cart-text:hover {

    background: #f9c115;


}

.catalog-card__price {
    font-weight: 600;
    font-size: 16px;
    display: flex;
    justify-content: right;
    margin-right: 3px;
}

/* карточка – фиксированные пропорции */


.catalog-card:hover {
    border: 2px solid #f9c11596;
}

/* верх карточки */
/* Название: максимум 1 строка с троеточием */

/* верх карточки */
/* Название: максимум 1 строка с троеточием */

.catalog-card__header {
    margin-bottom: 10px;
    overflow: hidden;
    /* ничего не вылезает за пределы карточки */
}

.catalog-card__title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    color: #000;
    text-decoration: none;

    line-height: 1.3;
    max-height: 1.3em;
    /* фикс высота = 1 строка */

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    /* максимум 1 строка */
    overflow: hidden;
    /* обрезаем лишнее */
    text-overflow: ellipsis;
}


/* Короткое описание: максимум 2 строки, фиксированная высота */

.catalog-card__short {
    font-size: 13px;
    color: #555;

    line-height: 1.4;
    height: calc(1.4em * 2);
    /* ровно 2 строки по высоте */
    overflow: hidden;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}


/* картинка – фиксированный бокс */

.catalog-card__image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 8px;
    height: 180px;
    margin-bottom: 10px;
    position: relative !important;
    overflow: visible;
}

.catalog-card__image--hit {
    background: #fff3e0;
}

.catalog-card__image .catalog-hit-badge {
    /* Reset previous styles */
    display: inline-block !important;
    border-radius: 0 !important;
    background: none !important;

    /* Ribbon Position: Short & Lower */
    position: absolute;
    top: 11px;
    /* Was 9px (Lower) */
    left: -20px;
    /* Was -24px (Adjusted for width) */
    width: 70px;
    /* Was 80px (Shorter) */
    padding: 3px 0;

    /* Rotation */
    transform: rotate(-45deg);

    /* Ribbon Style (Orange Gradient) */
    background: linear-gradient(180deg, #ff9100 0%, #ef6c00 100%) !important;
    color: #fff !important;
    text-align: center;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);

    /* Typography */
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.05em;
    text-transform: uppercase;

    z-index: 10;
    pointer-events: none;
    line-height: normal;
}

/* Optional: Add "folds" for more realism (pseudo-elements) if needed, 
   but simplistic ribbon is usually cleaner/ safer for cross-browser. */

.catalog-card__image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

/* низ карточки */

.catalog-card__bottom {
    display: flex;
    flex-direction: column;
    /* gap: 1px; */
    /* margin-top: auto; */
}

.catalog-card__price {
    font-weight: 600;
    font-size: 16px;
    display: flex;
    justify-content: right;
    margin-right: 3px;
}

.catalog-card__buttons {
    display: flex;
    /* gap: 8px; */
    justify-content: center;
    align-content: center;
}

.catalog-card__btn {
    flex: 1 1 50%;
    font-size: 11px;
}

.catalog-empty {
    padding: 20px 0;
    grid-column: 1 / -1;
}

/* подсветка совпадений в поиске */

.catalog-highlight {
    background: #ffeb80;
    padding: 0 1px;
}

/* Показать ещё */

.catalog-load-more-wrap {
    margin-top: 24px;
    text-align: center;
}

.catalog-load-more {
    min-width: 220px;
}

/* ЖЁСТКИЙ ФИКС: заголовок товара максимум 1 строка */
.catalog-card__header a.catalog-card__title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    color: #000;
    text-decoration: none;

    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 1 !important;
    /* максимум 1 строка */

    line-height: 1.3 !important;
    max-height: 1.3em !important;

    white-space: normal !important;
    /* нужно для line-clamp */
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}


/* ============ ОФОРМЛЕНИЕ (checkout) ============ */

.checkout-main {
    /* padding: 40px 0 80px; */
}

.checkout-page {
    width: 100%;
}

.checkout-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}



.checkout-form-block {
    flex: 1 1 60%;
}

.checkout-cart-block {
    flex: 1 1 40%;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.08);
    padding: 16px;
}

.checkout-form {
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.08);
    padding: 16px;
}

.checkout-field {
    margin-bottom: 14px;
}

.checkout-field label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}

.checkout-field input,
.checkout-field textarea {
    width: 100%;
    border-radius: 4px;
    border: 1px solid #ccc;
    padding: 8px 10px;
    font-size: 14px;
    resize: vertical;
}

.checkout-dates {
    display: flex;
    gap: 16px;
}

.checkout-field--checkbox {
    margin-top: 4px;
}

.checkbox-label {
    font-size: 13px;
}

.checkbox-label a {
    color: #000;
}

.checkout-summary-inline {
    margin-top: 10px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
}

.checkout-actions {
    margin-top: 16px;
}

.checkout-cart-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
}

.checkout-cart-item {
    border-bottom: 1px solid #eee;
    padding: 6px 0;
    font-size: 14px;
}

.checkout-cart-item:last-child {
    border-bottom: none;
}

.checkout-cart-item__meta {
    font-size: 13px;
    color: #555;
}

.checkout-cart-base {
    font-size: 14px;
}

.checkout-errors {
    margin-bottom: 16px;
    padding: 10px 14px;
    border-radius: 4px;
    background: #ffe3e3;
    color: #a30000;
    font-size: 13px;
}

.checkout-errors ul {
    margin: 0;
    padding-left: 18px;
}

.checkout-success {
    border-radius: 6px;
    background: #e9ffe3;
    padding: 16px;
    font-size: 14px;
}

/* ============ АДАПТИВ ============ */

/* 1350–1200 → 4 карточки */
@media (max-width: 1425px) {
    .catalog-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* 1200–920 → 3 карточки */
@media (max-width: 1200px) {
    .catalog-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* 920–400 → 2 карточки */
@media (max-width: 1150px) {
    .catalog-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* 400–340 → 1 карточка */
@media (max-width: 870px) {
    .catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .catalog-card {
        padding: 6px;

    }

    .btn-yellow-1 img {
        width: 35px;

    }

    .catalog-card__btn {
        font-size: 9px;
        padding: 4px;
        gap: 1px;
        margin-top: 20px;
    }

    .ofor-cart-text {
        font-size: 15px;
    }

    .catalog-card__price {
        font-size: 12px;
    }

    .ofor-cart {
        margin-top: 22px;
    }

    .korz-cart img {
        width: 37px;
    }

    .korz-cart-text {
        font-size: 7px;
    }





}

/* 400–340 → 1 карточка */
@media (max-width: 350px) {
    .catalog-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}




@media (max-width: 768px) {

    .catalog-container,
    .checkout-container {
        padding: 0 12px;
    }

    .catalog-filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .catalog-filter-select-wrap,
    .catalog-search-wrap {
        flex: 1 1 auto;
    }
}












/* Скрываем нативный select, но он остаётся для JS */
.catalog-filter-select--native {
    display: none;
}

/* Весь кастомный фильтр изолирован в cf-* чтобы не трогать другие .catalog-* */
.cf-filter {
    position: relative;
    width: 100%;
}

/* Кнопка-триггер */
.cf-filter__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 12px;
    border-radius: 4px;
    border: 1px solid #d0d7e2;
    background: #ffffff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.3;
}

/* Иконка выбранной категории в триггере */
.cf-filter__toggle-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f6fb;
}

.cf-filter__toggle-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Текст выбранной категории */
.cf-filter__toggle-label {
    flex: 1;
    text-align: left;
    font-weight: 500;
}

/* Стрелка */
.cf-filter__toggle-arrow {
    width: 10px;
    height: 10px;
    border-right: 2px solid #f9c115;
    border-bottom: 2px solid #f9c115;
    transform: rotate(45deg);
    margin-left: 8px;
    transition: transform 0.15s ease;
}

.cf-filter.is-open .cf-filter__toggle-arrow {
    transform: rotate(-135deg);
    margin-top: 4px;
}

/* Выпадающее меню */
.cf-filter__dropdown {
    position: absolute;
    left: 0;
    top: calc(100% + 4px);
    width: 100%;
    max-height: 320px;
    overflow-y: auto;
    border-radius: 4px;
    border: 1px solid #d0d7e2;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(12, 31, 53, 0.16);
    padding: 6px 0;
    z-index: 50;
    display: none;
}

.cf-filter.is-open .cf-filter__dropdown {
    display: block;
}

/* Пункт списка */
.cf-filter__option {
    width: 100%;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
}

.cf-filter__option:hover {
    background: #f5f7fb;
}

.cf-filter__option.is-active {
    background: #e9f3fc;
}

/* Иконка категории в списке */
.cf-filter__option-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 8px;
    flex-shrink: 0;
    background: #f3f6fb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cf-filter__option-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Заглушка для "Все категории" */
.cf-filter__option-icon--all::before {
    content: "★";
    font-size: 14px;
    color: #fbc505;
}

/* Текст пункта */
.cf-filter__option-text {
    flex: 1;
}

/* Показываем иконку по умолчанию, когда нет картинки (в т.ч. "Все категории") */
.cf-filter__toggle-icon:empty::before {
    content: "★";
    font-size: 22px;
    color: #fac207;
}

/* Firefox */
.cf-filter__dropdown {
    scrollbar-width: thin;
    scrollbar-color: #fac207 #ffffff;
    /* ползунок / трек */
}

/* Chrome / Edge / Safari */
.cf-filter__dropdown::-webkit-scrollbar {
    width: 8px;
}

.cf-filter__dropdown::-webkit-scrollbar-track {
    background: #fffbe6;
    border-radius: 4px;
}

.cf-filter__dropdown::-webkit-scrollbar-thumb {
    background-color: #ffda3a;
    border-radius: 4px;
}

.cf-filter__dropdown::-webkit-scrollbar-thumb:hover {
    background-color: #ffcc00;
}