/* ========== BEST OFFERS ========== */
.best-offers {
    padding: var(--space-xxl) 0;
    background-color: var(--color-bg-primary);
    position: relative;
    overflow: hidden;
}

.section-header {
    margin-bottom: var(--space-xl);
    text-align: left;
    position: relative;
    z-index: 1;
    width: 100%;
}

.section-title {
    font-size: var(--fs-h2);
    font-weight: var(--fw-semibold);
    color: var(--color-text-primary);
    margin: 0;
    position: relative;
}

/* Горизонтальный скролл */
.offers-scroll {
    display: flex;
    gap: var(--space-lg);
    overflow-x: auto;
    padding: var(--space-xs) 0 var(--space-lg);
    scroll-behavior: smooth;
    cursor: grab;
    scrollbar-width: none;
    -ms-overflow-style: none;
    user-select: none;
}

.offers-scroll.grabbing {
    cursor: grabbing;
}

.offers-scroll::-webkit-scrollbar {
    display: none;
}

/* Карточка товара */
.product-card {
    flex: 0 0 calc(25% - var(--space-lg) * 3 / 4);
    min-width: 300px;
    background: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-bg-tertiary);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Галерея товара */
.product-card__gallery {
    position: relative;
    height: 280px;
    overflow: hidden;
    background-color: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-bg-tertiary);
}

.gallery-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-track {
    display: flex;
    height: 100%;
    transition: transform var(--transition-normal);
    will-change: transform;
    background: #fff;
}

.gallery-slide {
    flex: 0 0 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Индикаторы (точки) */
.gallery-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-bg-tertiary);
    box-shadow: var(--shadow-sm);
}

.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-text-secondary);
    opacity: 0.4;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all var(--transition-fast);
}

.gallery-dot:hover {
    opacity: 0.8;
    transform: scale(1.2);
}

.gallery-dot.active {
    background: var(--color-accent);
    opacity: 1;
    transform: scale(1.2);
    width: 20px;
    border-radius: var(--radius-full);
}

/* Кнопка избранного */
.product-card__favorite {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-bg-tertiary);
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.product-card__favorite:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    transform: scale(1.05);
}

.product-card__favorite.active {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background-color: rgba(0, 179, 27, 0.05);
}

.product-card__favorite svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: transparent;
}

.product-card__favorite.active svg {
    fill: var(--color-accent);
}

/* Контент карточки */
.product-card__content {
    padding: var(--space-lg);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card__title {
    font-size: var(--fs-h4);
    font-weight: var(--fw-semibold);
    color: var(--color-text-primary);
    margin: 0 0 var(--space-md) 0;
    line-height: var(--lh-heading);
}

/* Блок описания материалов */
.product-card__description {
    margin-bottom: var(--space-lg);
    padding: var(--space-sm) var(--space-md);
    background-color: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    font-size: var(--fs-small);
    color: var(--color-text-primary);
    line-height: var(--lh-body);
}

/* Комментарий внутри описания */
.product-card__comment {
    font-size: 12px;
    color: var(--color-text-secondary);
    opacity: 0.7;
    margin-top: 4px;
    font-style: italic;
}

/* Цветовые опции */
.product-card__colors {
    margin-bottom: var(--space-lg);
}

.color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-option {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--color-bg-tertiary);
    cursor: pointer;
    padding: 0;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
    border-color: var(--color-accent);
}

.color-option.active {
    border: 2px solid var(--color-accent);
    transform: scale(1.05);
}

.color-option.more-colors {
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-body);
    font-weight: var(--fw-semibold);
    border: 1px solid var(--color-bg-tertiary);
}

.color-option.more-colors:hover {
    background: var(--color-accent);
    color: var(--color-text-light);
    border-color: var(--color-accent);
}

/* Подсказка при наведении */
.color-option[title] {
    position: relative;
}

.color-option[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-text-primary);
    color: var(--color-text-light);
    font-size: var(--fs-tiny);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    pointer-events: none;
    margin-bottom: 10px;
    z-index: 20;
    box-shadow: var(--shadow-md);
    font-weight: var(--fw-regular);
}

/* Таблица модификаций */
.product-card__modifications {
    margin-top: 0;
    margin-bottom: 0;
    border-top: 1px dashed var(--color-bg-tertiary);
    padding-top: var(--space-md);
}

.modification-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dotted var(--color-bg-tertiary);
    font-size: var(--fs-small);
}

.modification-row:last-child {
    border-bottom: none;
}

.modification-sku {
    font-weight: var(--fw-medium);
    color: var(--color-text-primary);
    min-width: 60px;
}

.modification-size {
    color: var(--color-text-secondary);
    flex: 1;
    padding: 0 var(--space-xs);
    text-align: center;
    font-family: monospace;
    font-size: 13px;
}

.modification-price {
    font-weight: var(--fw-semibold);
    color: var(--color-text-primary);
    min-width: 80px;
    text-align: right;
    margin-right: 8px;
}

.modification-cart {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: var(--color-text-light);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    padding: 0;
    flex-shrink: 0;
}

.modification-cart:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.modification-cart svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Футер карточки с ценой и кнопкой */
.product-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-bg-tertiary);
}

.product-card__prices {
    display: flex;
    flex-direction: column;
}

.product-card__price {
    font-size: var(--fs-h4);
    font-weight: var(--fw-semibold);
    color: var(--color-text-primary);
    line-height: 1.2;
}

.product-card__old-price {
    font-size: var(--fs-small);
    color: var(--color-text-secondary);
    opacity: 0.5;
    text-decoration: line-through;
    margin-top: 2px;
}

.product-card__cart {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: var(--color-text-light);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    padding: 0;
}

.product-card__cart:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow-lg);
}

.product-card__cart.in-cart {
    background: var(--color-accent);
    box-shadow: 0 0 0 2px var(--color-text-light), 0 0 0 4px var(--color-accent);
}

.product-card__cart svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

/* Специальный класс для карточек с таблицей (без общей кнопки) */
.product-card--with-table .product-card__footer {
    display: none;
}

/* ========== ПЛАНШЕТЫ (до 1024px) ========== */
@media (max-width: 1024px) {
    .product-card {
        flex: 0 0 calc(33.333% - var(--space-lg) * 2 / 3);
        min-width: 340px;
    }
    
    .product-card__gallery {
        height: 260px;
    }
    
    .offers-scroll {
        padding: var(--space-xs) 0 var(--space-lg);
    }
}

/* ========== МОБИЛЬНАЯ АДАПТАЦИЯ (до 768px) ========== */
@media (max-width: 768px) {
    .best-offers {
        padding: var(--space-xl) 0;
    }

    .section-header {
        margin-bottom: var(--space-lg);
    }

    .section-title {
        font-size: calc(var(--fs-h2-rem) - 0.25rem);
    }

    .product-card {
        flex: 0 0 calc(50% - var(--space-md) / 2);
        min-width: 300px;
    }

    .product-card__gallery {
        height: 240px;
    }

    .product-card__content {
        padding: var(--space-md);
    }

    .product-card__title {
        font-size: calc(var(--fs-h4-rem) - 0.0625rem);
        margin-bottom: var(--space-sm);
    }

    .color-option {
        width: 40px;
        height: 40px;
    }
    
    .product-card__cart {
        width: 48px;
        height: 48px;
    }
    
    .product-card__cart svg {
        width: 24px;
        height: 24px;
    }

    .offers-scroll {
        padding: var(--space-xs) 0 var(--space-md);
    }
    
    .modification-size {
        font-size: 12px;
    }
    
    .modification-price {
        min-width: 70px;
        font-size: 12px;
    }
    
    .modification-cart {
        width: 28px;
        height: 28px;
    }
    
    .modification-cart svg {
        width: 16px;
        height: 16px;
    }
}

/* ========== МАЛЕНЬКИЕ МОБИЛЬНЫЕ (до 480px) ========== */
@media (max-width: 480px) {
    .product-card {
        flex: 0 0 85%;
        min-width: 300px;
    }

    .product-card__gallery {
        height: 220px;
    }

    .product-card__content {
        padding: var(--space-sm) var(--space-md) var(--space-md);
    }

    .product-card__title {
        font-size: var(--fs-body);
        margin-bottom: var(--space-xs);
    }

    .product-card__description {
        padding: var(--space-xs) var(--space-sm);
        font-size: 13px;
    }

    .product-card__comment {
        font-size: 11px;
    }

    .color-options {
        gap: 8px;
    }

    .color-option {
        width: 38px;
        height: 38px;
    }

    .product-card__cart {
        width: 44px;
        height: 44px;
    }
    
    .product-card__cart svg {
        width: 22px;
        height: 22px;
    }

    .offers-scroll {
        padding: var(--space-xs) 0 var(--space-md);
    }
    
    .modification-row {
        font-size: 12px;
        padding: 6px 0;
    }
    
    .modification-sku {
        min-width: 50px;
    }
    
    .modification-size {
        font-size: 11px;
    }
    
    .modification-price {
        min-width: 65px;
        font-size: 11px;
    }
    
    .modification-cart {
        width: 28px;
        height: 28px;
    }
    
    .modification-cart svg {
        width: 15px;
        height: 15px;
    }
}

/* ========== ЭКРАНЫ 360px И МЕНЬШЕ ========== */
@media (max-width: 360px) {
    .product-card {
        flex: 0 0 90%;
        min-width: 280px;
    }

    .product-card__gallery {
        height: 200px;
    }

    .product-card__title {
        font-size: calc(var(--fs-body-rem) - 0.0625rem);
    }

    .product-card__description {
        font-size: 12px;
    }

    .product-card__comment {
        font-size: 10px;
    }

    .color-option {
        width: 36px;
        height: 36px;
    }

    .product-card__price {
        font-size: calc(var(--fs-h4-rem) - 0.125rem);
    }

    .product-card__cart {
        width: 40px;
        height: 40px;
    }
    
    .product-card__cart svg {
        width: 20px;
        height: 20px;
    }
    
    .modification-row {
        font-size: 11px;
    }
    
    .modification-sku {
        min-width: 45px;
    }
    
    .modification-size {
        font-size: 10px;
    }
    
    .modification-price {
        min-width: 60px;
        font-size: 10px;
    }
    
    .modification-cart {
        width: 26px;
        height: 26px;
    }
    
    .modification-cart svg {
        width: 14px;
        height: 14px;
    }
    
    .gallery-dots {
        padding: 4px 10px;
    }
    
    .gallery-dot {
        width: 6px;
        height: 6px;
    }
    
    .gallery-dot.active {
        width: 16px;
    }
}