/* =======================================================
   ГЛОБАЛЬНАЯ БАЗА И СБРОС СДВИГОВ
   ======================================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    margin: 0;
    padding: 0;
}

.main-content {
    width: 100%;
    box-sizing: border-box;
}

/* =======================================================
   КАТАЛОГ: ДЕСКТОП В 3 КОЛОНКИ (СТИЛЬ MODUL SYSTEME)
   ======================================================= */
.page-catalog .catalog-products-area {
    width: 100%;
}

.page-catalog .products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
    padding: 0;
}

.page-catalog .product-card {
    background: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    height: 100%;
    box-sizing: border-box;
}

/* Фирменный красный акцент MODUL SYSTEME при наведении */
.page-catalog .product-card:hover {
    border-color: #DD0000;
    box-shadow: 0 10px 28px rgba(221, 0, 0, 0.09);
    transform: translateY(-4px);
}

.page-catalog .product-card-image-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #FAFAFA;
    border: 1px solid #F1F3F5;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    margin-bottom: 14px;
    cursor: pointer;
    overflow: hidden;
}

.page-catalog .product-card-img {
    width: 100%;
    height: 100%;
    max-width: 96%;
    max-height: 96%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

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

.page-catalog .product-card-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: left;
}

.page-catalog .product-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    margin-bottom: 8px;
    min-height: 40px;
    cursor: pointer;
}

.page-catalog .product-stock-tag {
    font-size: 13px;
    font-weight: 600;
    color: #15803d;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.stock-dot-green {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #15803d;
}

.page-catalog .product-specs-sub {
    font-size: 13px;
    color: #6B7280;
    margin-bottom: 12px;
    min-height: 20px;
}

.page-catalog .product-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 16px;
}

.product-current-price,
.product-new-price {
    font-size: 20px;
    font-weight: 800;
    color: #111827;
}

.product-old-price {
    font-size: 14px;
    color: #9CA3AF;
    text-decoration: line-through;
}

.page-catalog .product-buttons-group {
    width: 100%;
    margin-top: auto;
}

.page-catalog .product-action-box {
    width: 100%;
}

.page-catalog .btn-more-details {
    display: none;
}

.page-catalog .btn-add-to-cart {
    width: 100%;
    height: 44px;
    background: #ffffff;
    color: #111827;
    border: 1.5px solid #111827;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-catalog .btn-add-to-cart:hover {
    background: #DD0000;
    border-color: #DD0000;
    color: #ffffff;
}

.page-catalog .quantity-selector-block {
    width: 100%;
    height: 44px;
    border: 1.5px solid #DD0000;
    border-radius: 4px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-catalog .btn-qty-control {
    width: 44px;
    height: 100%;
    font-size: 20px;
    font-weight: 700;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #111827;
}

.page-catalog .qty-count-input {
    flex: 1;
    height: 100%;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    border: none;
    background: transparent;
    color: #111827;
}

/* =======================================================
   ФИЛЬТРЫ КАТАЛОГА (ИЗОЛЯЦИЯ КАТЕГОРИЙ)
   ======================================================= */
.catalog-top-controls {
    width: 100%;
    position: relative;
    z-index: 50;
    margin-bottom: 20px;
}

.horizontal-filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    width: 100%;
}

/* Скрываем наборы фильтров по умолчанию */
.category-filter-set {
    display: none;
    gap: 10px;
    align-items: center;
}

/* Показываем строго активный набор */
.category-filter-set.is-active {
    display: flex;
}

.filter-dropdown {
    position: relative;
    display: inline-block;
}

.filter-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    background: #F4F4F5;
    border: 1.5px solid #E5E7EB;
    color: #111827;
    cursor: pointer;
    white-space: nowrap;
}

.filter-dropdown.open .filter-dropdown-btn {
    border-color: #DD0000;
    color: #DD0000;
    background: #ffffff;
}

.filter-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 220px;
    background: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    padding: 14px;
    z-index: 9999;
}

.filter-dropdown.open .filter-dropdown-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

.btn-reset-all-filters {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    background: #ffffff;
    border: 1.5px solid #E5E7EB;
    color: #6B7280;
    cursor: pointer;
    white-space: nowrap;
}

/* =======================================================
   КАРТОЧКА ТОВАРА (PDP) — ДЕСКТОП (ПК / НОУТБУКИ)
   ======================================================= */
.pdp-container-wrapper {
    max-width: 1380px;
    margin: 0 auto;
    padding: 30px 24px 60px 24px;
}

.pdp-breadcrumbs {
    margin-bottom: 25px;
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pdp-breadcrumbs a {
    color: #111827;
    text-decoration: none;
}

.pdp-loading-message {
    padding: 80px 0;
    text-align: center;
    font-size: 15px;
    color: #6b7280;
}

.pdp-main-box {
    display: grid;
    grid-template-columns: 52fr 48fr;
    gap: 50px;
    align-items: start;
    margin-bottom: 40px;
}

.pdp-media-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.zoom-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: hidden;
    position: relative;
    cursor: zoom-in;
}

.zoom-image {
    width: 100%;
    height: 100%;
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    transition: transform 0.15s ease-out;
    pointer-events: none;
}

.zoom-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 5px;
    pointer-events: none;
}

.pdp-gallery-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
}

.thumb-card {
    width: 72px;
    height: 72px;
    border-radius: 6px;
    border: 1.5px solid #e5e7eb;
    padding: 2px;
    background: #ffffff;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s ease;
}

.thumb-card.active,
.thumb-card:hover {
    border-color: #DD0000;
}

.pdp-details-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pdp-sku-tag {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.pdp-product-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
    color: #111827;
    margin: 0 0 10px 0;
}

.pdp-stock-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #dcfce7;
    color: #15803d;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
}

.stock-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #15803d;
}

.pdp-price-section {
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 0;
}

.btn-add-to-cart-pdp {
    width: 100%;
    height: 50px;
    background: #111113;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-add-to-cart-pdp:hover {
    background: #DD0000;
}

.pdp-qty-selector {
    width: 100%;
    height: 50px;
    border: 1.5px solid #DD0000;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #F4F4F5;
    padding: 0 8px;
}

.pdp-quick-highlights {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: #F9FAFB;
    border-radius: 6px;
    border: 1px solid #F3F4F6;
    margin-top: 4px;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: #374151;
    font-weight: 500;
}

.highlight-icon {
    color: #15803d;
    font-weight: 800;
}

/* Секция вкладок карточки товара */
.pdp-tabs-section {
    width: 100%;
    border-top: 1px solid #E5E7EB;
    padding-top: 24px;
    margin-bottom: 60px;
}

.pdp-tab-headers {
    display: flex;
    gap: 32px;
    border-bottom: 1px solid #E5E7EB;
    margin-bottom: 24px;
}

.pdp-tab-nav-btn {
    background: none;
    border: none;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #6B7280;
    cursor: pointer;
    position: relative;
}

.pdp-tab-nav-btn.active {
    color: #111827;
    font-weight: 700;
}

.pdp-tab-nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #DD0000;
}

.pdp-text-content {
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
    max-width: 960px;
}

.pdp-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 50px;
    row-gap: 2px;
    max-width: 1100px;
}

.pdp-spec-line {
    display: flex;
    justify-content: space-between;
    padding: 11px 0;
    border-bottom: 1px dashed #E5E7EB;
    font-size: 14px;
}

.pdp-spec-key {
    color: #6B7280;
}

.pdp-spec-val {
    color: #111827;
    font-weight: 700;
}

/* =======================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ (ДО 768px)
   ======================================================= */
@media (max-width: 768px) {
    /* 1. Карточка PDP: строгая 1 колонка */
    .pdp-container-wrapper {
        padding: 16px 14px 40px 14px;
    }

    .pdp-main-box {
        display: flex;
        flex-direction: column;
        gap: 16px;
        width: 100%;
    }

    .pdp-media-col {
        width: 100%;
    }

    .pdp-details-col {
        width: 100%;
        position: static;
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .pdp-product-title {
        font-size: 20px;
        line-height: 1.3;
        margin: 0 0 8px 0;
    }

    .zoom-container {
        width: 100%;
        height: 320px;
        aspect-ratio: auto;
        padding: 8px;
        background: #FAFAFA;
        border: 1px solid #E5E7EB;
        border-radius: 8px;
        cursor: default;
    }

    .zoom-image {
        width: 100%;
        height: 100%;
        max-width: 96%;
        max-height: 96%;
        object-fit: contain;
        transform: none;
    }

    .zoom-badge {
        display: none;
    }

    .btn-add-to-cart-pdp {
        width: 100%;
        height: 48px;
        background: #DD0000;
        color: #ffffff;
        border: none;
        border-radius: 4px;
        font-size: 14px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.8px;
    }

    .pdp-qty-selector {
        width: 100%;
        height: 48px;
        border: 1.5px solid #DD0000;
        border-radius: 4px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #ffffff;
        padding: 0 8px;
    }

    .pdp-specs-grid {
        grid-template-columns: 1fr;
        column-gap: 0;
    }

    /* 2. Каталог: категории с анимацией и шевроном */
    .page-catalog .catalog-layout-wrapper {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .page-catalog .catalog-sidebar {
        width: 100%;
        margin-bottom: 4px;
    }

    .page-catalog .filter-group-header {
        cursor: pointer;
        padding: 12px 16px;
        background: #F8F9FA;
        border: 1px solid #E5E7EB;
        border-radius: 8px;
    }

    .page-catalog .filter-group-title {
        font-size: 14px;
        font-weight: 700;
        text-transform: uppercase;
        margin: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .page-catalog .category-chevron {
        font-size: 11px;
        color: #6B7280;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease;
    }

    .page-catalog .catalog-sidebar.is-open .category-chevron {
        transform: rotate(180deg);
        color: #DD0000;
    }

    .page-catalog .catalog-sidebar .category-menu {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, margin-top 0.3s ease;
        margin-top: 0;
        border-top: none;
    }

    .page-catalog .catalog-sidebar.is-open .category-menu {
        max-height: 800px;
        opacity: 1;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #E5E7EB;
    }

    /* 3. Каталог: панель фильтров со свайпом */
    .catalog-top-controls {
        width: 100%;
        margin-bottom: 16px;
        overflow: hidden;
    }

    .horizontal-filters-bar {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding: 4px 2px 12px 2px;
        width: 100%;
        scrollbar-width: none;
    }

    .horizontal-filters-bar::-webkit-scrollbar {
        display: none;
    }

    .category-filter-set {
        display: none;
    }

    .category-filter-set.is-active {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .filter-dropdown-btn,
    .btn-reset-all-filters {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 8px 14px;
        font-size: 13px;
        height: 38px;
        border-radius: 20px;
    }

    .filter-dropdown.open .filter-dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 60vh;
        overflow-y: auto;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
        padding: 24px 20px 32px 20px;
        z-index: 99999;
        background: #ffffff;
        border: none;
    }

    /* 4. Каталог: карточка в 1 строгую колонку */
    .page-catalog .products-grid {
        display: flex;
        flex-direction: column;
        gap: 24px;
        width: 100%;
    }

    .page-catalog .product-card {
        padding: 0 0 24px 0;
        border: none;
        border-bottom: 1px solid #E5E7EB;
        border-radius: 0;
        height: auto;
    }

    .page-catalog .product-card:hover {
        transform: none;
        box-shadow: none;
        border-color: #E5E7EB;
    }

    .page-catalog .product-card-image-box {
        height: 260px;
        aspect-ratio: auto;
        padding: 6px;
        margin-bottom: 12px;
    }

    .page-catalog .product-card-img {
        max-width: 96%;
        max-height: 96%;
    }

    .page-catalog .product-buttons-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
        margin-top: 12px;
    }

    .page-catalog .btn-more-details {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 44px;
        background: #DD0000;
        color: #ffffff;
        border-radius: 4px;
        font-size: 13px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        text-decoration: none;
    }
}