/* ==========================================
   CSS ДЛЯ СТРАНИЦЫ: КАТАЛОГ (catalog.css)
   Описание: Стили для каталога, карточек товаров и сайдбара
   ========================================== */

/* ========== ОТСТУПЫ ПОСЛЕ ХЛЕБНЫХ КРОШЕК ========== */
.breadcrumbs-section {
    margin-bottom: 0 !important;
    padding-bottom: 5px !important;
    background-color: #FFFFFF;
    border-bottom: 1px solid #E9ECEF;
}
.breadcrumbs {
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
}
.breadcrumbs a {
    color: #FFC857;
    text-decoration: none;
}
.breadcrumbs .separator {
    margin: 0 8px;
    color: #ADB5BD;
    font-weight: 700;
}
.breadcrumbs .current {
    color: #2C3E50;
    font-weight: 600;
}

/* ========== ОСНОВНЫЕ СТИЛИ ========== */
.catalog-main {
    background-color: #F5F7FA;
    padding-top: 5px !important;
    padding-bottom: 60px;
    flex: 1;
}
.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== ЗАГОЛОВОК H1 ========== */
.page-header {
    margin-bottom: 25px;
    padding-top: 10px;
}
.page-header h1 {
    font-size: 26px;
    color: #2C3E50;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
    position: relative;
    display: inline-block;
    margin: 0 0 10px 0;
    line-height: 1.3;
}
.page-header h1:after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 40px;
    height: 3px;
    background: #FFC857;
    border-radius: 2px;
}
.page-subtitle {
    font-size: 14px;
    color: #7F8C8D;
    margin-top: 10px;
    margin-bottom: 15px !important;
    text-align: left;
    padding-left: 0;
    margin-left: 0; 
}

/* ========== ДВУХКОЛОНОЧНАЯ СЕТКА ========== */
.catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

/* ========== САЙДБАР ========== */
.catalog-sidebar {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    height: fit-content;
}
.sidebar-widget {
    margin-bottom: 20px;
    border-bottom: 1px solid #E9ECEF;
    padding-bottom: 15px;
}
.sidebar-widget:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.widget-title {
    color: #2C3E50;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.widget-title i {
    color: #FFC857;
    font-size: 14px;
}

/* Категории */
.category-list {
    list-style: none;
}
.category-list li {
    margin-bottom: 4px;
}
.category-list li a {
    color: #4A627A;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s;
    display: block;
    padding: 4px 8px;
    border-radius: 4px;
}
.category-list li a:hover {
    color: #2C3E50;
    background: rgba(255, 200, 87, 0.1);
}
.category-list li a.active {
    color: #FFFFFF;
    background: #FFC857;
    font-weight: 600;
}
.category-list li a i {
    width: 18px;
    margin-right: 6px;
    color: #FFC857;
    font-size: 12px;
}

/* Подменю */
.has-submenu {
    position: relative;
}
.has-submenu > a {
    font-weight: 600;
}
.submenu {
    list-style: none;
    padding-left: 24px;
    margin-top: 2px;
    display: none;
}
.has-submenu:hover .submenu {
    display: block;
}
.submenu li {
    margin-bottom: 2px;
}
.submenu li a {
    font-size: 12px;
    padding: 3px 8px;
}

/* Фильтры */
.filter-group {
    margin-bottom: 15px;
}
.filter-group h4 {
    color: #2C3E50;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}
.filter-title {
    color: #2C3E50;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Чекбоксы */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4A627A;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 6px;
    position: relative;
    padding-left: 22px;
}
.checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}
.checkmark {
    position: absolute;
    left: 0;
    height: 14px;
    width: 14px;
    background: #FFFFFF;
    border: 1px solid #DEE2E6;
    border-radius: 3px;
}
.checkbox-label:hover input ~ .checkmark {
    background: #F5F7FA;
}
.checkbox-label input:checked ~ .checkmark {
    background: #FFC857;
    border-color: #FFC857;
}
.checkmark:after {
    content: " ";
    position: absolute;
    display: none;
}
.checkbox-label input:checked ~ .checkmark:after {
    display: block;
}
.checkbox-label .checkmark:after {
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Цветные кружки-фильтры */
.filter-colors-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.color-filter-item {
    position: relative;
    cursor: pointer;
    display: inline-block;
    width: 22px;
    height: 22px;
}
.color-filter-item input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.color-filter-circle {
    display: block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    box-shadow: 0 0 0 1px #ddd inset;
    transition: transform 0.15s, box-shadow 0.15s;
}
.color-filter-item:hover .color-filter-circle {
    transform: scale(1.12);
}
.color-filter-item input:checked ~ .color-filter-circle {
    box-shadow: 0 0 0 2px #FFC857;
    transform: scale(1.05);
}

/* Кнопка сброса */
.reset-filters-btn {
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 1px solid #FFC857;
    color: #2C3E50;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}
.reset-filters-btn:hover {
    background: rgba(255, 200, 87, 0.1);
}

/* Популярные товары */
.popular-products {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.popular-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    background: #F5F7FA;
    border-radius: 6px;
    transition: all 0.3s;
}
.popular-item:hover {
    background: #E9ECEF;
    transform: translateX(3px);
}
.popular-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: #FFFFFF;
    border-radius: 4px;
    padding: 4px;
}
.popular-info h4 {
    color: #2C3E50;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}
.popular-info .price {
    color: #FFC857;
    font-size: 12px;
    font-weight: 700;
}

/* ========== ОСНОВНОЙ КОНТЕНТ ========== */
.catalog-content {
    min-width: 0;
}

/* Панель инструментов */
.catalog-toolbar {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.toolbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.products-count {
    color: #2C3E50;
    font-size: 14px;
}
.view-toggle {
    display: flex;
    gap: 5px;
    background: #F5F7FA;
    padding: 3px;
    border-radius: 8px;
}
.view-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #7F8C8D;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}
.view-btn:hover {
    color: #2C3E50;
}
.view-btn.active {
    background: #FFC857;
    color: #1A1F2C;
}
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}
.sort-select {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sort-select label {
    color: #2C3E50;
    font-size: 14px;
    white-space: nowrap;
}
.sort-select select {
    padding: 8px 12px;
    background: #FFFFFF;
    border: 1px solid #DEE2E6;
    border-radius: 6px;
    color: #2C3E50;
    font-size: 14px;
    cursor: pointer;
    outline: none;
}
.sort-select select option {
    background: #FFFFFF;
    color: #2C3E50;
}

/* Кнопка «Фильтры» — видна только на мобильных */
.filters-toggle-btn {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #FFC857;
    color: #1A1F2C;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
    align-items: stretch;
}

/* ========== СЕО-ТЕКСТ ========== */
.seo-text-block {
    margin-top: 40px;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFE 100%);
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border: 1px solid #E9ECEF;
}
.seo-text-block h2 {
    font-size: 24px;
    font-weight: 700;
    color: #2C3E50;
    margin-bottom: 15px;
    letter-spacing: -0.3px;
}
.seo-text-block h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2C3E50;
    margin: 20px 0 10px;
}
.seo-text-block p {
    font-size: 15px;
    line-height: 1.6;
    color: #4A627A;
    margin-bottom: 15px;
}
.seo-text-block strong {
    color: #FFC857;
    font-weight: 700;
}
.seo-text-block a {
    color: #FFC857;
    text-decoration: underline;
    transition: all 0.3s ease;
}
.seo-text-block a:hover {
    color: #FFD966;
    text-decoration: none;
}
.seo-text-block .seo-cta {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #E9ECEF;
    font-weight: 500;
}

/* Карточка товара */
.product-card {
    background: #FFFFFF;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #FF5252;
    color: #FFFFFF;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    z-index: 15;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.product-badge:empty { display: none; }
.product-badge.Премиум { background: #FFC857; color: #1A1F2C; }
.product-badge.Новинка { background: #1A1F2C; color: #FFFFFF; }
.product-badge.Бизнес { background: #0F131F; color: #FFFFFF; }
.product-badge.Детская { background: #FF69B4; }
.product-badge.Аксессуар { background: #9370DB; }

.product-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #FFFFFF;
    z-index: 5;
    flex-shrink: 0;
}
.image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 5;
}
.image-container.white-bg { background: #FFFFFF; }
.image-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.5s ease;
    position: relative;
    z-index: 5;
    pointer-events: none;
}
.product-card:hover .image-container img { transform: scale(1.1); }

.zoom-15 .image-container img { transform: scale(1.15); }
.zoom-25 .image-container img { transform: scale(1.25); }

.product-actions {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    transition: bottom 0.3s ease;
    z-index: 20;
    pointer-events: none;
}
.product-card:hover .product-actions { bottom: 0; }
.action-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #FFFFFF;
    color: #2C3E50;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    pointer-events: auto;
    position: relative;
    z-index: 25;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.action-btn:hover {
    background: #FFC857;
    color: #1A1F2C;
    transform: translateY(-3px);
}

.product-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    position: relative;
    z-index: 10;
}

.product-info {
    padding: 12px 10px 10px;
    flex: 1; 
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    background: #FFFFFF;
}

.product-title {
    display: flex;
    flex-direction: column;
    margin-bottom: 6px;
    line-height: 1.2;
}
.product-title-link {
    color: #2C3E50 !important;
    text-decoration: none !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    transition: all 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.4em;
    line-height: 1.2;
    margin-bottom: 2px;
    position: relative;
    z-index: 15;
}
.product-title-link:hover {
    color: #FFC857 !important;
    text-decoration: none !important;
}
.product-sku {
    font-size: 10px;
    color: #7F8C8D;
    font-weight: 400;
    background: #F5F7FA;
    padding: 2px 5px;
    border-radius: 3px;
    display: inline-block;
    align-self: flex-start;
}

.product-variant-selector,
.product-color-selector {
    margin-bottom: 6px;
}
.product-variant-selector label,
.product-color-selector label {
    display: block;
    color: #7F8C8D;
    font-size: 10px;
    margin-bottom: 2px;
}
.variant-select {
    width: 100%;
    padding: 4px 6px;
    background: #FFFFFF;
    border: 1px solid #DEE2E6;
    border-radius: 4px;
    color: #2C3E50;
    font-size: 11px;
    cursor: pointer;
    outline: none;
}

.color-options {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    min-height: 46px;
    align-content: flex-start;
}
.color-option {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: inline-block;
}
.color-option:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px #FFFFFF;
}
.color-option.selected {
    border-color: #FFFFFF;
    box-shadow: 0 0 0 2px #FFC857;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    height: 18px;
}
.stars {
    color: #FFD700;
    font-size: 10px;
    letter-spacing: 1px;
}
.rating-count {
    color: #7F8C8D;
    font-size: 9px;
}

.product-stock {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #2ecc71;
    font-size: 10px;
    font-weight: 500;
    margin-bottom: 6px;
}
.product-stock i { font-size: 11px; }
.product-stock .fa-clock { color: #FFA500; }

.product-card-btn {
    width: 100%;
    padding: 6px;
    background: #FFC857;
    color: #1A1F2C;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: auto;
    position: relative;
    z-index: 15;
}
.product-card-btn:hover {
    background: #FFD966;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(255, 200, 87, 0.3);
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 40px;
}
.page-btn {
    min-width: 36px;
    height: 36px;
    border: 1px solid #DEE2E6;
    background: #FFFFFF;
    color: #2C3E50;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
    font-weight: 500;
}
.page-btn:hover { background: #F5F7FA; border-color: #FFC857; }
.page-btn.active { background: #FFC857; color: #1A1F2C; border-color: #FFC857; }
.page-btn.prev, .page-btn.next { background: #F5F7FA; border-color: #DEE2E6; }
.page-btn.prev:hover, .page-btn.next:hover { background: #FFC857; color: #1A1F2C; border-color: #FFC857; }
.page-btn.prev:disabled, .page-btn.next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #F5F7FA;
    border-color: #DEE2E6;
    color: #ADB5BD;
}

/* ========== МОДАЛКА БЫСТРОГО ПРОСМОТРА ========== */
.quick-view-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.quick-view-modal.is-open { display: flex; }
.quick-view-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
    z-index: 1;
}
.quick-view-dialog {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 960px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 2;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.quick-view-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #f2f2f2;
    color: #333;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
}
.quick-view-close:hover { background: #e0e0e0; }
.quick-view-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 40px;
}
.quick-view-gallery {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
    min-height: 300px;
    cursor: zoom-in;
}
.qv-main-image {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}
.qv-title { font-size: 24px; font-weight: 700; margin: 0 0 8px; color: #1A1F2C; }
.qv-sku { font-size: 13px; color: #999; margin: 0 0 12px; }
.qv-rating { margin-bottom: 12px; color: #FFC857; }
.qv-stock { margin-bottom: 16px; font-size: 14px; font-weight: 600; }
.qv-stock.in-stock { color: #27ae60; }
.qv-stock.on-order { color: #e74c3c; }
.qv-price-block { margin-bottom: 20px; }
.qv-price { font-size: 28px; font-weight: 700; color: #1A1F2C; }
.qv-variants, .qv-colors, .qv-printing { margin-bottom: 16px; }
.qv-variants label, .qv-colors label, .qv-printing label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}
.qv-variants select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}
.qv-colors-list { display: flex; flex-wrap: wrap; gap: 8px; }
.qv-color-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}
.qv-color-dot:hover { transform: scale(1.1); }
.qv-color-dot.selected {
    border-color: #1A1F2C;
    box-shadow: 0 0 0 2px #FFC857;
}
.qv-printing-list { display: flex; flex-wrap: wrap; gap: 8px; }
.qv-printing-tag {
    background: #f2f2f2;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #333;
}
.qv-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    position: relative;
    z-index: 10;
}
.qv-add-to-cart {
    background: #FFC857;
    color: #1A1F2C;
    border: none;
    border-radius: 10px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}
.qv-add-to-cart:hover { background: #ffb800; }
.qv-details-link {
    text-align: center;
    color: #1A1F2C;
    text-decoration: none;
    font-size: 14px;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    cursor: pointer;
}
.qv-details-link:hover { color: #FFC857; }
body.qv-open { overflow: hidden; }

/* Лайтбокс */
.qv-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.qv-lightbox.is-open { display: flex; }
.qv-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.9);
}
.qv-lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    z-index: 1;
    border-radius: 8px;
}
.qv-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    z-index: 2;
}
.qv-lightbox-close:hover { background: rgba(255,255,255,0.3); }
body.qv-lightbox-open { overflow: hidden; }

/* Мобильная модалка сайдбара */
.sidebar-mobile-header { display: none; }
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
}

/* ========== ФИКС ДЛЯ БРАСЛЕТОВ И РЕМУВОК ========== */
[data-category="bracelets"] .color-options,
[data-category="silicone_straps"] .color-options {
    height: 46px !important;
    max-height: 46px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    align-content: flex-start !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 3px !important;
    margin-bottom: 6px !important; 
}

/* ========== УНИВЕРСАЛЬНЫЙ ФИКС ДЛЯ ВСЕХ КАРТОЧЕК БЕЗ СЕЛЕКТОРА ========== */
.product-card:not(:has(.product-variant-selector)):not([data-category="usb"]) .product-color-selector::before {
    content: "";
    display: block;
    height: 40px; 
    margin-bottom: 6px;
}

[data-category="bracelets"] [data-product-id^="bracelet-usb"] .product-color-selector::before {
    height: 10px !important;
}

/* ========== ЦВЕТА КАРТОЧЕК ========== */
.color-option[data-color="serebro"],
.color-option[data-color="serebristaya"],
.color-option[data-color="silver"] {
    background: linear-gradient(135deg, #E0E0E0 0%, #C0C0C0 50%, #E0E0E0 100%) !important;
    border: 1px solid #A0A0A0;
}
.color-option[data-color="zoloto"],
.color-option[data-color="zolotaya"],
.color-option[data-color="gold"] {
    background: linear-gradient(135deg, #FFD700 0%, #E6B422 50%, #FFD700 100%) !important;
    border: 1px solid #B89000;
}
.color-option[data-color="latun"] {
    background: #B87333 !important;
}
.color-option[data-color="svetloe"],
.color-option[data-color="light"] {
    background: #DEB887 !important;
    border: 1px solid #B8905A;
}
.color-option[data-color="temnoe"],
.color-option[data-color="dark"] {
    background: #8B4513 !important;
}
.color-option[data-color="krasnaya"],
.color-option[data-color="red"] {
    background: #e74c3c !important;
}
.color-option[data-color="sinyaya"],
.color-option[data-color="blue"] {
    background: #3498db !important;
}
.color-option[data-color="zelenaya"],
.color-option[data-color="green"] {
    background: #2ecc71 !important;
}
.color-option[data-color="zheltaya"],
.color-option[data-color="yellow"] {
    background: #FFD700 !important;
}
.color-option[data-color="oranzhevaya"],
.color-option[data-color="orange"] {
    background: #e67e22 !important;
}
.color-option[data-color="rozovaya"],
.color-option[data-color="pink"] {
    background: #FFB6C1 !important;
}
.color-option[data-color="fioletovaya"],
.color-option[data-color="purple"] {
    background: #9370DB !important;
}
.color-option[data-color="biruzovaya"],
.color-option[data-color="turquoise"] {
    background: #40E0D0 !important;
}
.color-option[data-color="golubaya"],
.color-option[data-color="lightblue"] {
    background: #87CEEB !important;
}
.color-option[data-color="salatovaya"],
.color-option[data-color="lightgreen"] {
    background: #ADFF2F !important;
}
.color-option[data-color="seraya"],
.color-option[data-color="gray"] {
    background: #808080 !important;
}
.color-option[data-color="chernaya"],
.color-option[data-color="black"] {
    background: #2B2B2B !important;
}
.color-option[data-color="belaya"],
.color-option[data-color="white"] {
    background: #FFFFFF !important;
    border: 1px solid #dee2e6;
}
.color-option[data-color="tricolor"] {
    background: linear-gradient(90deg, #FFFFFF 0%, #1a3a8a 50%, #e74c3c 100%) !important;
}
.color-option[data-color="temno-sinyaya"],
.color-option[data-color="darkblue"] {
    background: #00008B !important;
}
.color-option[data-color="cherno-serebristaya"] {
    background: linear-gradient(135deg, #2B2B2B 50%, #C0C0C0 50%) !important;
}
.color-option[data-color="cherno-sinyaya"] {
    background: linear-gradient(135deg, #2B2B2B 50%, #3498db 50%) !important;
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 1200px) {
    .products-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 992px) {
    .catalog-layout { grid-template-columns: 1fr; }
    .catalog-sidebar { order: 2; }
    .catalog-content { order: 1; }
    .page-header h1 { font-size: 24px; }
    .page-subtitle { font-size: 16px; }
    .products-grid { grid-template-columns: repeat(3, 1fr); }

    .filters-toggle-btn { display: inline-flex; }

    .catalog-sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        max-height: 85vh;
        overflow-y: auto;
        z-index: 2000;
        border-radius: 20px 20px 0 0;
        padding: 20px;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
    }
    .catalog-sidebar.is-open { transform: translateY(0); }
    .sidebar-overlay.is-open { display: block; }
    .sidebar-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 1px solid #E9ECEF;
        font-size: 16px;
        font-weight: 700;
        color: #1A1F2C;
    }
    .sidebar-mobile-close {
        background: #F5F7FA;
        border: none;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        cursor: pointer;
        font-size: 14px;
        color: #2C3E50;
    }
}
@media (max-width: 768px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .catalog-toolbar { flex-direction: column; align-items: flex-start; }
    .toolbar-left { width: 100%; justify-content: space-between; }
    .toolbar-right { width: 100%; }
    .sort-select { width: 100%; }
    .sort-select select { flex: 1; }
    .container-fluid { padding: 0 15px; }
    .page-header h1 { font-size: 22px; }
    .quick-view-body { grid-template-columns: 1fr; padding: 20px; }
    .seo-text-block {
        padding: 20px;
        margin-top: 30px;
        margin-bottom: 20px;
    }
    .seo-text-block h2 { font-size: 20px; }
    .seo-text-block h3 { font-size: 16px; }
    .seo-text-block p { font-size: 14px; }
}
@media (max-width: 576px) {
    .products-grid { grid-template-columns: 1fr; }
    .page-header h1 { font-size: 22px; }
    .page-subtitle { font-size: 14px; margin-bottom: 30px; }
    .product-image { aspect-ratio: 1 / 1; }
    .product-info { padding: 12px 10px 10px; }
    .pagination { flex-wrap: wrap; }
}

/* Убираем мелькание при загрузке */
.products-grid .product-card {
    opacity: 0;
    visibility: hidden;
}
.products-grid.loaded .product-card {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease;
}

/* Флаг России */
.product-russia-flag {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;
    cursor: help;
    transition: transform 0.2s ease;
}
.product-russia-flag:hover { transform: scale(1.1); }
.product-russia-flag img { border-radius: 3px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
/* Country-of-origin badges must never inherit product photo dimensions. */
.catalog-main .product-russia-flag img{display:block;width:30px;height:20px;max-width:30px;object-fit:cover}

/* Filters are a frequent control: reveal immediately, without slide latency. */
@media(max-width:992px){.catalog-sidebar{transition:none;visibility:hidden;pointer-events:none;overscroll-behavior:contain}.catalog-sidebar.is-open{visibility:visible;pointer-events:auto}.filters-toggle-btn,.sidebar-mobile-close,.sidebar-overlay{touch-action:manipulation}.sidebar-mobile-header{position:sticky;top:-20px;z-index:2;background:inherit}.sidebar-mobile-close{min-width:44px;min-height:44px}}
