/* pages/catalog/css/product-cart.css */

/* ========== ОСНОВНЫЕ СТИЛИ КАРТОЧКИ ТОВАРА ========== */
.product-card {
    background: var(--color-white);
    border-radius: var(--border-radius-form);
    padding: var(--spacing-sm);
    box-shadow: var(--shadow-base);
    transition: all var(--transition-base);
    position: relative;
    display: flex;
    height: auto;
    cursor: pointer;
    font-family: var(--font-family-primary);
    border: 1px solid var(--color-grey);
    min-height: 380px;
    gap: var(--spacing-sm);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-yellow);
}

/* Левая колонка - выбор цвета */
.color-sidebar {
    flex: 0 0 60px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding-right: var(--spacing-xs);
    border-right: 1px solid var(--color-grey-light);
}

.color-sidebar-label {
    font-size: 10px;
    font-weight: var(--font-weight-semibold);
    color: var(--color-black);
    text-align: center;
    margin-bottom: var(--spacing-xs);
    font-family: var(--font-family-primary);
    text-transform: uppercase;
}

.color-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    max-height: 280px;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-yellow) transparent;
}

.color-options::-webkit-scrollbar {
    width: 3px;
}

.color-options::-webkit-scrollbar-track {
    background: transparent;
}

.color-options::-webkit-scrollbar-thumb {
    background: var(--color-yellow);
    border-radius: 2px;
}

.color-option {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-image);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-base);
    position: relative;
    flex-shrink: 0;
}

.color-option:hover {
    transform: translateX(2px);
    border-color: var(--color-grey);
}

.color-option.active {
    border-color: var(--color-yellow);
}

.color-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.color-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: var(--color-white);
    font-size: 9px;
    padding: 2px 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-family-primary);
}

/* Основной контент карточки */
.product-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Для правильного обрезания текста */
}

/* Слайдер изображений */
.product-image-slider {
    position: relative;
    width: 100%;
    height: 180px;
    margin-bottom: var(--spacing-sm);
    overflow: hidden;
    border-radius: var(--border-radius-image);
    background: var(--color-white);
}

.slider-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.slider-track {
    display: flex;
    height: 100%;
    transition: transform 0.3s ease;
}

.slide {
    flex: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Навигация слайдера */
.slider-nav {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 4px;
    z-index: 2;
}

.slider-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all var(--transition-base);
}

.slider-dot.active {
    background: var(--color-yellow);
    transform: scale(1.2);
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.5);
    color: var(--color-white);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    opacity: 0;
    transition: all var(--transition-base);
    font-size: 12px;
    font-weight: bold;
}

.product-image-slider:hover .slider-arrow {
    opacity: 1;
}

.slider-arrow.prev {
    left: 8px;
}

.slider-arrow.next {
    right: 8px;
}

.slider-arrow:hover {
    background: var(--color-yellow);
    color: var(--color-black);
}

/* Бейдж вариантов */
.variations-badge {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    background: var(--color-yellow);
    color: var(--color-black);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-button);
    font-size: var(--font-size-p-mobile);
    font-weight: var(--font-weight-bold);
    font-family: var(--font-family-primary);
    z-index: 3;
    box-shadow: var(--shadow-base);
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: 0 var(--spacing-xs);
}

.product-title {
    font-size: var(--font-size-p-mobile);
    font-weight: var(--font-weight-semibold);
    color: var(--color-black);
    margin: 0;
    line-height: var(--line-height-tight);
    font-family: var(--font-family-primary);
    height: 36px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-article {
    font-size: var(--font-size-p-mobile);
    color: var(--color-black);
    margin: 0 0 var(--spacing-xs) 0;
    font-family: var(--font-family-primary);
}

/* Варианты товара */
.product-variants {
    margin: var(--spacing-xs) 0;
    font-family: var(--font-family-primary);
}

.variant-group {
    margin-bottom: var(--spacing-xs);
    font-family: var(--font-family-primary);
}

.variant-label {
    font-size: var(--font-size-p-mobile);
    font-weight: var(--font-weight-semibold);
    color: var(--color-black);
    margin-bottom: var(--spacing-xs);
    font-family: var(--font-family-primary);
}

.variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    font-family: var(--font-family-primary);
}

.variant-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--color-grey);
    border-radius: var(--border-radius-button);
    background: var(--color-white);
    color: var(--color-black);
    font-size: var(--font-size-p-mobile);
    font-weight: var(--font-weight-normal);
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: var(--font-family-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
}

.variant-btn:hover {
    border-color: var(--color-yellow);
    transform: translateY(-1px);
}

.variant-btn.active {
    background: var(--color-yellow);
    border-color: var(--color-yellow);
    color: var(--color-black);
    font-weight: var(--font-weight-semibold);
}

.size-variant {
    min-width: 32px;
}

/* Цена */
.product-price {
    margin-top: auto;
    margin-bottom: var(--spacing-sm);
    font-family: var(--font-family-primary);
}

.current-price {
    font-size: var(--font-size-p);
    font-weight: var(--font-weight-bold);
    color: var(--color-black);
    font-family: var(--font-family-primary);
}

.original-price {
    font-size: var(--font-size-base);
    color: var(--color-grey-dark);
    text-decoration: line-through;
    margin-left: var(--spacing-xs);
    font-weight: var(--font-weight-normal);
    font-family: var(--font-family-primary);
}

/* Кнопки действий */
.product-actions {
    display: flex;
    gap: var(--spacing-xs);
    margin-top: auto;
    font-family: var(--font-family-primary);
}

.btn-details, .btn-cart {
    flex: 1;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: none;
    border-radius: var(--border-radius-button);
    font-size: var(--font-size-p-mobile);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: var(--font-family-primary);
    text-transform: uppercase;
    height: var(--btn-height-sm);
}

.btn-details {
    background: var(--color-white);
    color: var(--color-black);
    border: 1px solid var(--color-black);
}

.btn-details:hover {
    background: var(--color-black);
    color: var(--color-white);
    border-color: var(--color-black);
}

.btn-cart {
    background: var(--color-yellow);
    color: var(--color-black);
    border: 1px solid var(--color-yellow);
}

.btn-cart:hover {
    background: var(--color-black);
    color: var(--color-white);
    border-color: var(--color-black);
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 1200px) {
    .product-card {
        min-height: 360px;
    }
    
    .color-sidebar {
        flex: 0 0 50px;
    }
    
    .color-option {
        width: 46px;
        height: 46px;
    }
    
    .product-image-slider {
        height: 160px;
    }
}

@media (max-width: 992px) {
    .product-image-slider {
        height: 150px;
    }
}

@media (max-width: 768px) {
    .product-card {
        padding: var(--spacing-xs);
        min-height: 340px;
        gap: var(--spacing-xs);
    }
    
    .color-sidebar {
        flex: 0 0 44px;
    }
    
    .color-option {
        width: 40px;
        height: 40px;
    }
    
    .color-name {
        font-size: 8px;
        padding: 1px 2px;
    }
    
    .product-image-slider {
        height: 140px;
    }
    
    .slider-arrow {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
    
    .product-title {
        font-size: var(--font-size-p-mobile);
        height: 32px;
    }
    
    .current-price {
        font-size: var(--font-size-p-mobile);
    }
    
    .btn-details, .btn-cart {
        font-size: var(--font-size-p-mobile);
        padding: var(--spacing-xs);
        height: var(--btn-height-sm);
    }
    
    .variant-options {
        gap: calc(var(--spacing-xs) / 2);
    }
    
    .variant-btn {
        padding: calc(var(--spacing-xs) / 2) var(--spacing-xs);
        min-width: 24px;
        min-height: 24px;
        font-size: var(--font-size-p-mobile);
    }
    
    .product-article {
        font-size: var(--font-size-p-mobile);
    }
}

@media (max-width: 576px) {
    .product-card {
        min-height: 320px;
    }
    
    .color-sidebar {
        flex: 0 0 40px;
    }
    
    .color-option {
        width: 36px;
        height: 36px;
    }
    
    .color-name {
        display: none; /* Скрываем названия на мобильных */
    }
    
    .product-image-slider {
        height: 140px;
    }
    
    .product-title {
        font-size: var(--font-size-p-mobile);
        height: 30px;
    }
    
    .current-price {
        font-size: var(--font-size-p-mobile);
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .btn-details, .btn-cart {
        width: 100%;
        font-size: var(--font-size-p-mobile);
        height: var(--btn-height-sm);
    }
    
    .product-variants {
        margin: var(--spacing-xs) 0;
    }
    
    .variant-group {
        margin-bottom: var(--spacing-xs);
    }
    
    .variant-label {
        font-size: var(--font-size-p-mobile);
    }
}