.catalog-section,
.category-section {
    padding: 250px 0 0;
}

/* СТРАНИЦА ТОВАРА */
.product-single {
    padding: 30px 0;
}

/* Кнопка «Вернуться в каталог» — в начале контента для быстрой навигации */
.product-back-nav {
    margin-bottom: 20px;
}

.product-back-to-catalog {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9375rem;
    color: #03737F;
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.product-back-to-catalog:hover {
    color: #025a63;
    text-decoration: underline;
}

.product-back-to-catalog:focus {
    outline: 2px solid #03737F;
    outline-offset: 2px;
}

.product-back-to-catalog__icon {
    font-size: 1.1em;
    line-height: 1;
}

.product-content {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    position: absolute;
    top: 10px;
    right: 10px;
    max-width: calc(100% - 20px);
}

.product-tag {
    display: inline-block;
    color: #FFF;
    font-size: 11px;
    background-color: #4caf50;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.product-images {
    flex: 0 0 50%;
}

.product-info {
    flex: 1;
}

.main-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.gallery-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
}

.gallery-thumb:hover {
    border-color: #0073aa;
}

.product-title {
    margin-top: 0;
    color: #333;
}

.product-state-program {
    margin: 0 0 12px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #03737F;
}

.product-prices {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.current-price {
    font-size: 28px;
    font-weight: bold;
    color: #d32f2f;
}

.old-price {
    font-size: 18px;
    color: #999;
    text-decoration: line-through;
    margin-top: 5px;
}

.discount-badge {
    display: inline-block;
    background: #ff4444;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    margin-left: 15px;
}

.product-buttons {
    display: flex;
    gap: 15px;
    margin: 25px 0;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-question,
.btn-product {
    color: #fff;
    background: -webkit-gradient(linear, left top, left bottom, from(#008BD0), to(#44C9AD));
    background: linear-gradient(90deg, #06CFE5 0%, #66C924 100%);
    border: 1px solid #ddd;
    flex: 1;
}

.btn-product {
    width: 100%;
    margin-top: 7px;
}

.btn-question:hover {
    color: #fff;
    background: -webkit-gradient(linear, left top, left bottom, from(#008BD0), to(#44C9AD));
    background: linear-gradient(90deg, #06CFE5 100%, #66C924 0%);
}

.btn-cart {
    background: #0073aa;
    color: white;
    flex: 2;
}

.btn-cart:hover {
    background: #005a87;
}

/* ХАРАКТЕРИСТИКИ */
.product-specifications {
    margin: 40px 0;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr {
    border-bottom: 1px solid #e0e0e0;
}

.specs-table td {
    padding: 15px 10px;
}

.spec-name {
    font-weight: bold;
    color: #333;
    width: 40%;
}

/* ТАБЫ */
.product-tabs {
    margin: 40px 0;
}

.tabs-nav {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.tab-link {
    padding: 15px 30px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-link:hover {
    color: #333;
}

.tab-link.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
    font-weight: bold;
}

.tab-content {
    display: none;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.tab-content.active {
    display: block;
}

/* АДАПТИВ */
@media (max-width: 768px) {
    .product-content {
        flex-direction: column;
    }

    .product-buttons {
        flex-direction: column;
    }

    .tabs-nav {
        flex-direction: column;
    }

    .tab-link {
        border-bottom: 1px solid #e0e0e0;
        border-left: 3px solid transparent;
    }

    .tab-link.active {
        border-left-color: #0073aa;
        border-bottom-color: #e0e0e0;
    }
}

/* БЕЙДЖИ ТОВАРОВ (внизу фото) */
.product-card-image .product-badges {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    top: auto;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 5px;
    z-index: 2;
}

.badge {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
}

.badge-new {
    background: #4caf50;
    /* зеленый */
}

.badge-featured {
    background: #ff9800;
    /* оранжевый */
}

.badge-discount {
    background: #f44336;
    /* красный */
}

/* Карточка товара в каталоге */
.product-card {
    position: relative;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-card-image {
    position: relative;
    height: 240px;
    overflow: hidden;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

.product-card-content {
    padding: 15px;
}

.product-card-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    line-height: 1.3;
}

.product-card-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.4;
}

.product-card-price {
    font-size: 18px;
    font-weight: bold;
    color: #d32f2f;
}

/* КАТАЛОГ ТОВАРОВ */
.catalog-page {
    padding: 30px 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.product-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.product-card-image {
    height: 240px;
    overflow: hidden;
    position: relative;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #999;
}

.product-card-content {
    padding: 20px;
}

.product-card-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    line-height: 1.3;
    min-height: 42px;
}

.product-card-title a {
    color: #333;
    text-decoration: none;
}

.product-card-title a:hover {
    color: #0073aa;
}

.product-card-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.4;
    min-height: 42px;
}

.product-card-price {
    font-size: 20px;
    font-weight: bold;
    color: #d32f2f;
    margin: 15px 0;
}

.product-card-old-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
    margin-top: 5px;
}

.product-card-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.product-card-buttons .btn {
    padding: 10px 15px;
    font-size: 14px;
    flex: 1;
}

/* БЕЙДЖИ (внизу фото) */
.product-card-image .product-badges {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    top: auto;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 5px;
    z-index: 10;
}

.badge {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    display: inline-block;
}

.badge-new {
    background: #4caf50;
}

.badge-featured {
    background: #ff9800;
}

.badge-discount {
    background: #f44336;
}

/* ПАГИНАЦИЯ */
.catalog-pagination {
    margin-top: 40px;
    text-align: center;
}

/* АДАПТИВ */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .product-card-buttons {
        flex-direction: column;
    }
}

/* ФИЛЬТРЫ КАТАЛОГА — сайдбар слева */
.catalog-page {
    display: flex;
    gap: 30px;
    padding: 30px 0;
}

.catalog-sidebar {
    flex: 0 0 280px;
    min-width: 0;
}

.catalog-filters {
    flex: 0 0 100%;
}

.catalog-filters--sidebar {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.catalog-filters--sidebar .catalog-filters__panel {
    padding-bottom: 24px;
}

.catalog-filters__group {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.catalog-filters__group:last-of-type {
    border-bottom: none;
}

.catalog-filters__group .catalog-filters__title {
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.catalog-filters__group .catalog-filters__list {
    list-style: none;
    margin: 0;
    padding: 0;
    padding-left: 0;
}

.catalog-filters__group .catalog-filters__list li {
    margin-bottom: 6px;
    list-style: none;
}

/* Явно убираем маркеры у списков Назначение, Тип/зона, Материал, Новинки */
.catalog-filters__group ul.purpose-list,
.catalog-filters__group ul.zone-list,
.catalog-filters__group ul.material-list,
.catalog-filters__group ul.new-list {
    list-style: none !important;
    padding-left: 0 !important;
}

.catalog-filters__group ul.purpose-list li,
.catalog-filters__group ul.zone-list li,
.catalog-filters__group ul.material-list li,
.catalog-filters__group ul.new-list li {
    list-style: none !important;
}

.catalog-filters__group .catalog-filters__list li:last-child {
    margin-bottom: 0;
}

.catalog-filters__group .filter-btn {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: left;
    color: #333;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    margin: 0;
}

.catalog-filters__group .filter-btn:hover {
    background: #f5f5f5;
    border-color: #999;
}

.catalog-filters__group .category-item.active .filter-btn,
.catalog-filters__group .tag-item.active .filter-btn,
.catalog-filters__group .purpose-item.active .filter-btn,
.catalog-filters__group .zone-item.active .filter-btn,
.catalog-filters__group .material-item.active .filter-btn,
.catalog-filters__group .new-item.active .filter-btn {
    background: linear-gradient(180deg, #03737F 0%, #008bd0 100%);
    color: #fff;
    border-color: #008bd0;
}

.catalog-filters__group .filter-btn .tag-count {
    opacity: 0.9;
    font-size: 0.95em;
}

.catalog-sidebar .reset-filters {
    padding: 16px 20px;
    border-top: 1px solid #eee;
}

.category-filters {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.category-filters h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

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

.category-item {
    margin-bottom: 8px;
}

.category-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    color: #555;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.category-item a:hover {
    background: #f5f5f5;
    color: #0073aa;
}

.category-item.active a {
    background: #0073aa;
    color: white;
    font-weight: bold;
}

.category-count {
    font-size: 12px;
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    color: inherit;
}

.category-item.active .category-count {
    background: rgba(255, 255, 255, 0.3);
}

/* СОДЕРЖИМОЕ КАТАЛОГА */
.catalog-content {
    flex: 1;
}

.no-products {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.no-products p {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

/* АДАПТИВ ДЛЯ ФИЛЬТРОВ */
@media (max-width: 768px) {
    .catalog-page {
        flex-direction: column;
    }

    .catalog-sidebar {
        flex: 0 0 auto;
        width: 100%;
    }

    .catalog-filters__toggle {
        display: flex;
    }

    .catalog-filters--sidebar .catalog-filters__panel {
        display: none;
    }

    .catalog-filters--sidebar .catalog-filters__panel.is-open {
        display: block;
    }
}

/* Каталог: табы категорий, фильтр по тегам (из archive-product / taxonomy) */
.catalog-category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    align-items: center;
}

.catalog-category-tags .category-tag {
    display: inline-block;
    padding: 8px 14px;
    background: #f0f0f0;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background .2s, color .2s;
}

.catalog-category-tags .category-tag:hover {
    background: #e0e0e0;
    color: #000;
}

.catalog-category-tags .category-tag--all {
    background: #ddd;
}

.catalog-category-tags .category-tag--current,
.catalog-category-tags .category-tag--all.category-tag--current {
    background: #0073aa;
    color: #fff;
    border: 1px solid #0073aa;
}

.catalog-category-tags .category-tag-count {
    opacity: .85;
    font-size: .9em;
}

.catalog-filters .filter-btn {
    display: block;
    width: 100%;
    padding: 4px 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: left;
    color: #333;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    margin: 0;
}

.catalog-filters .filter-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

.catalog-filters .category-item.active .filter-btn,
.catalog-filters .tag-item.active .filter-btn,
.catalog-filters .purpose-item.active .filter-btn,
.catalog-filters .zone-item.active .filter-btn,
.catalog-filters .material-item.active .filter-btn,
.catalog-filters .new-item.active .filter-btn {
    background: linear-gradient(180deg, #03737F 0%, #008bd0 100%);
    color: #fff;
    border-color: #0073aa;
}

.catalog-filters .category-list,
.catalog-filters .tag-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.catalog-filters .category-item,
.catalog-filters .tag-item {
    margin: 0 0 8px 0;
}

.catalog-filters .category-item:last-child,
.catalog-filters .tag-item:last-child {
    margin-bottom: 0;
}

.catalog-filters .category-item button,
.catalog-filters .tag-item button {
    width: 100%;
}

.catalog-filters--tags {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.catalog-filters__toggle {
    display: none;
    width: 100%;
    padding: 14px 18px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    text-align: left;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.catalog-filters__toggle .catalog-filters__toggle-icon {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.catalog-filters__toggle[aria-expanded="true"] .catalog-filters__toggle-icon {
    transform: rotate(-135deg);
}

.catalog-filters__panel .tag-filters {
    padding: 20px;
}

.catalog-filters__panel .reset-filters {
    padding: 0 20px 20px;
}

.catalog-filters__title {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

@media (max-width: 768px) {
    .catalog-filters--tags {
        flex: 0 0 auto;
        width: 100%;
    }

    .catalog-filters__toggle {
        display: flex;
    }

    .catalog-filters__panel {
        display: none;
        padding: 0;
    }

    .catalog-filters__panel.is-open {
        display: block;
    }

    .catalog-filters__title {
        display: none;
    }
}

@media (min-width: 769px) {
    .catalog-filters__panel {
        display: block !important;
    }

    /* Сайдбар фильтров: position sticky, ограниченная высота панели — всегда можно доскроллить до кнопки сброса */
    .catalog-filters--sidebar {
        position: sticky;
        top: 180px;
        align-self: flex-start;
        max-height: calc(100vh - 40px);
        display: flex;
        flex-direction: column;
    }

    .catalog-filters--sidebar .catalog-filters__panel {
        display: block !important;
        overflow-y: auto;
        max-height: 60vh;
        flex: 1 1 auto;
        min-height: 0;
        padding-right: 4px;
        -webkit-overflow-scrolling: touch;
    }

    /* Кнопка «Сбросить» вне прокрутки — всегда видна внизу сайдбара */
    .catalog-filters--sidebar .reset-filters {
        flex-shrink: 0;
        border-top: 1px solid #eee;
        padding: 16px 20px;
    }

    .catalog-filters--sidebar .catalog-filters__panel::-webkit-scrollbar {
        width: 6px;
    }

    .catalog-filters--sidebar .catalog-filters__panel::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 3px;
    }

    .catalog-filters--sidebar .catalog-filters__panel::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 3px;
    }
}

/* Совместимость со старым классом тегов (если где-то остался) */
.catalog-filters--tags {
    flex: 0 0 auto;
}

.filter-status {
    margin-bottom: 20px;
}

.filter-status__show-all {
    background: none;
    border: none;
    color: #0073aa;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    margin-left: 0.25em;
    font-size: inherit;
}

.filter-status__show-all:hover {
    color: #005a87;
}

.filter-status.is-hidden,
.reset-filters.is-hidden,
.no-products-filtered.is-hidden {
    display: none !important;
}