/* Модальное окно быстрого просмотра */
.quickview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(0.5rem);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.quickview-modal.show {
    opacity: 1;
    visibility: visible;
}

.quickview-modal.show .quickview-content {
    transform: scale(1);
}

.quickview-content {
    background: white;
    border-radius: 1.25rem;
    max-width: 75rem;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 1.5625rem 3.125rem rgba(0, 0, 0, 0.25);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.quickview-header {
    position: relative;
    background: linear-gradient(135deg, #6976DF 0%, #5a67d8 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quickview-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quickview-title i {
    font-size: 0.9rem;
    opacity: 0.9;
}

.quickview-close {
    background: none;
    border: none;
    color: white;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    font-weight: 300;
    padding: 0;
}

.quickview-close:hover {
    color: #f1f5f9;
    transform: scale(1.1);
}

.quickview-body {
    height: calc(90vh - 3.75rem);
    overflow-y: auto;
}

.quickview-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 18.75rem;
    flex-direction: column;
    gap: 1rem;
    color: #64748b;
}

.quickview-spinner {
    width: 3rem;
    height: 3rem;
    border: 0.25rem solid #e2e8f0;
    border-top: 0.25rem solid #6976DF;
    border-radius: 50%;
    animation: quickview-spin 1s linear infinite;
}

@keyframes quickview-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.quickview-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 18.75rem;
    flex-direction: column;
    gap: 1rem;
    color: #ef4444;
    padding: 2rem;
    text-align: center;
}

.quickview-error i {
    font-size: 3rem;
    opacity: 0.6;
}

.quickview-error h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.quickview-error p {
    margin: 0;
    color: #64748b;
}

.quickview-retry {
    background: #6976DF;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.quickview-retry:hover {
    background: #5a67d8;
    transform: translateY(-0.0625rem);
}

/* Кнопка быстрого просмотра в карточке товара */
.quick-view-btn {
    background: linear-gradient(135deg, #6976DF 0%, #5a67d8 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.5rem;
}

.quick-view-btn:hover {
    transform: translateY(-0.0625rem);
    box-shadow: 0 0.25rem 0.75rem rgba(105, 118, 223, 0.4);
}

.quick-view-btn i {
    font-size: 0.8rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .quickview-modal {
        padding: 1rem;
    }
    
    .quickview-content {
        max-width: 100%;
        border-radius: 1rem;
    }
    
    .quickview-header {
        padding: 1rem 1.5rem;
    }
    
    .quickview-title {
        font-size: 1.1rem;
    }
    
    .quickview-body {
        height: calc(90vh - 4.375rem);
    }
}

@media (max-width: 480px) {
    .quickview-header {
        padding: 0.75rem 1rem;
    }
    
    .quickview-title {
        font-size: 1rem;
    }
    
    .quickview-close {
        width: 1.25rem;
        height: 1.25rem;
        font-size: 1rem;
    }
}

/* Новые стили для правильного компонента быстрого просмотра */

/* Контейнер быстрого просмотра */
.quickview-container {
    max-width: 75rem;
    margin: 0 auto;
    padding: 2rem;
}

.quickview-product {
    display: grid;
    grid-template-columns: minmax(18.75rem, 31.25rem) minmax(18.75rem, 1fr);
    gap: 3rem;
    align-items: start;
    overflow: hidden;
}

.quickview-images {
    position: relative;
    width: 100%;
    max-width: 31.25rem;
    margin: 0 auto;
    overflow: hidden;
}

/* Слайдер изображений - исправленные размеры */
.quickview-image-slider {
    width: 100%;
    max-width: 31.25rem;
    height: 25rem;
    border-radius: 0.75rem;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
}

.quickview-main-slider {
    width: 100%;
    height: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
}

.quickview-main-slider .swiper-slide {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quickview-main-slider .swiper-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.5rem;
}

/* Навигация слайдера - как в основной карточке */
.quickview-slider-navigation {
    position: absolute;
    display: flex;
    gap: 1rem;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    z-index: 10;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.quickview-button-prev,
.quickview-button-next {
    width: 2.5rem;
    height: 2.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    border: none;
    background: none;
}

.quickview-button-prev:after,
.quickview-button-next:after {
    font-family: swiper-icons;
    font-size: 1.25rem;
    font-weight: bold;
    color: #000;
}

.quickview-button-prev:after {
    content: 'prev';
}

.quickview-button-next:after {
    content: 'next';
}

.quickview-button-prev.swiper-button-disabled,
.quickview-button-next.swiper-button-disabled {
    opacity: 0.5;
    cursor: default;
}

/* Миниатюры слайдера */
.quickview-thumbnails {
    margin-top: 1rem;
    max-width: 100%;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0.5rem 0;
    overflow: hidden;
    box-sizing: border-box;
}

.quickview-thumb-slider {
    width: 100%;
    max-width: 100%;
    height: 4.375rem;
    overflow: hidden;
    padding: 0.5rem 0;
    box-sizing: border-box;
}

.quickview-thumb-slider .swiper-slide {
    width: 4.375rem !important;
    height: 4.375rem;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 0.125rem solid transparent;
    flex-shrink: 0;
    margin-right: 0.5rem;
    position: relative;
}

.quickview-thumb-slider .swiper-slide:hover {
    opacity: 0.9;
    border-color: #cbd5e1;
    z-index: 10;
}

.quickview-thumb-slider .swiper-slide-thumb-active {
    opacity: 1;
    border-color: #6976DF;
    transform: scale(1.05);
    box-shadow: 0 0 0 0.1875rem rgba(105, 118, 223, 0.2);
    z-index: 10;
}

.quickview-thumb-slider .swiper-slide img {
    max-width: calc(100% - 0.25rem);
    max-height: calc(100% - 0.25rem);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.375rem;
}

/* Когда изображений мало, выровнять по центру */
.quickview-thumb-slider .swiper-wrapper {
    align-items: center;
    overflow: visible;
}

/* Убираем лишние отступы если изображений меньше, чем помещается на экране */
.quickview-thumb-slider[data-slides-count="1"] .swiper-slide:last-child,
.quickview-thumb-slider[data-slides-count="2"] .swiper-slide:last-child,
.quickview-thumb-slider[data-slides-count="3"] .swiper-slide:last-child,
.quickview-thumb-slider[data-slides-count="4"] .swiper-slide:last-child,
.quickview-thumb-slider[data-slides-count="5"] .swiper-slide:last-child {
    margin-right: 0;
}

/* Информационный блок */
.quickview-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.quickview-product-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
}

.quickview-product-price {
    font-size: 2rem;
    font-weight: 700;
    color: #6976DF;
    margin: 0;
}

.quickview-product-article {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
}

.quickview-stock-info {
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: 0.75rem;
    border: 0.0625rem solid #e2e8f0;
}

.quickview-stock-title {
    font-weight: 600;
    color: #374151;
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
}

.quickview-stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.quickview-stock-item:last-child {
    margin-bottom: 0;
}

.quickview-stock-label {
    color: #64748b;
}

.quickview-stock-value {
    font-weight: 600;
    color: #374151;
}

.quickview-attributes {
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: 0.75rem;
    border: 0.0625rem solid #e2e8f0;
}

.quickview-attributes-title {
    font-weight: 600;
    color: #374151;
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
}

.quickview-attribute {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.quickview-attribute:last-child {
    margin-bottom: 0;
}

.quickview-attribute-name {
    color: #64748b;
    font-weight: 500;
}

.quickview-attribute-value {
    color: #374151;
    font-weight: 600;
}

.quickview-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.quickview-view-full {
    background: linear-gradient(135deg, #6976DF 0%, #5a67d8 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    box-shadow: 0 0.125rem 0.5rem rgba(105, 118, 223, 0.3);
}

.quickview-view-full:hover {
    transform: translateY(-0.0625rem);
    box-shadow: 0 0.25rem 0.9375rem rgba(105, 118, 223, 0.4);
    color: white;
    text-decoration: none;
}

/* Блок брендирования */
.quickview-branding {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 0.0625rem solid #bbf7d0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 0.5rem;
}

.quickview-branding-text {
    color: #15803d;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quickview-branding-text i {
    color: #16a34a;
    font-size: 1rem;
}

.quickview-branding-btn {
    background: transparent;
    color: #16a34a;
    border: 0.0625rem solid #16a34a;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.quickview-branding-btn:hover {
    background: #16a34a;
    color: white;
    text-decoration: none;
    transform: translateY(-0.0625rem);
}

/* Вариации товара - теперь сверху */
.quickview-variations {
    margin-bottom: 1rem;
    max-width: 31.25rem;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.quickview-variation {
    width: 2.5rem;
    height: 2.5rem;
    /* border-radius: 0.375rem; */
    cursor: pointer;
    border-bottom: 0.0625rem solid transparent;
    padding-bottom: 0.1875rem;
    transition: all 0.2s ease;
    object-fit: cover;
    position: relative;
}

.quickview-variation:hover {
    border-color: #6976DF;
    transform: scale(1.1);
}

.quickview-variation.active {
    border-color: #6976DF;
    /* box-shadow: 0 0 0 0.125rem rgba(105, 118, 223, 0.2); */
}

.quickview-variation.active::after {
    content: '✓';
    position: absolute;
    top: -0.3125rem;
    right: -0.3125rem;
    background: #6976DF;
    color: white;
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 50%;
    font-size: 0.5625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Адаптивность для контента */
@media (max-width: 768px) {
    .quickview-container {
        padding: 1rem;
    }
    
    .quickview-product {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .quickview-product-name {
        font-size: 1.5rem;
    }
    
    .quickview-product-price {
        font-size: 1.75rem;
    }
    
    .quickview-image-slider {
        height: 18.75rem;
        max-width: 100%;
    }
    
    .quickview-thumbnails,
    .quickview-variations {
        max-width: 100%;
    }
    
    .quickview-thumb-slider .swiper-slide {
        width: 3.75rem !important;
        height: 3.75rem;
        margin-right: 0.375rem;
    }
    
    .quickview-thumb-slider .swiper-slide:hover {
        transform: scale(1.06);
    }
    
    .quickview-thumb-slider {
        height: 3.75rem;
        padding: 0 0.1875rem;
    }
    
    .quickview-thumbnails {
        padding: 0.375rem 0;
    }
}

@media (max-width: 480px) {
    .quickview-container {
        padding: 0.75rem;
    }
    
    .quickview-image-slider {
        height: 15.625rem;
    }
    
    .quickview-thumb-slider .swiper-slide {
        width: 3.125rem !important;
        height: 3.125rem;
        margin-right: 0.25rem;
    }
    
    .quickview-thumb-slider .swiper-slide:hover {
        transform: scale(1.05);
    }
    
    .quickview-thumb-slider {
        height: 3.125rem;
        padding: 0 0.125rem;
    }
    
    .quickview-thumbnails {
        padding: 0.25rem 0;
    }
    
    .quickview-variations {
        gap: 0.25rem;
    }
    
    .quickview-variation {
        width: 2.1875rem;
        height: 2.1875rem;
    }
}

/* Стили для карточек товаров и tooltip корзины */

/* Карточка товара должна быть относительно позиционированной */
.product-card {
    position: relative;
}

/* Обновленные кнопки действий */
.product-actions {
    display: flex;
    flex-direction: column;
    gap: 0!important;
    margin-top: 1rem;
    position: relative;
}

.add-to-cart-btn,
.quick-view-btn {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.add-to-cart-btn {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: white;
    position: relative;
}

.add-to-cart-btn:hover {
    transform: translateY(-0.0625rem);
    box-shadow: 0 0.25rem 0.75rem rgba(22, 163, 74, 0.4);
}

.quick-view-btn {
    background: linear-gradient(135deg, #6976DF 0%, #5a67d8 100%);
    color: white;
}

.quick-view-btn:hover {
    transform: translateY(-0.0625rem);
    box-shadow: 0 0.25rem 0.75rem rgba(105, 118, 223, 0.4);
}

/* Tooltip корзины */
.cart-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    margin-bottom: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.cart-tooltip.show {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.cart-tooltip-content {
    background: white;
    border: 0.0625rem solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.5625rem rgba(0, 0, 0, 0.15);
    min-width: 12.5rem;
    overflow: hidden;
}

.cart-tooltip-header {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    border-bottom: 0.0625rem solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: #374151;
}

.cart-tooltip-close {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.cart-tooltip-close:hover {
    color: #374151;
}

.cart-tooltip-body {
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.cart-tooltip .product-quantity {
    width: 4.375rem;
    padding: 0.5rem;
    border: 0.0625rem solid #d1d5db;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    text-align: center;
}

.cart-tooltip .product-quantity:focus {
    outline: none;
    border-color: #6976DF;
    box-shadow: 0 0 0 0.125rem rgba(105, 118, 223, 0.1);
}

.add-to-cart-confirm {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.add-to-cart-confirm:hover {
    transform: translateY(-0.0625rem);
    box-shadow: 0 0.25rem 0.75rem rgba(22, 163, 74, 0.4);
}

/* Треугольная стрелка tooltip */
.cart-tooltip::before {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 0.5rem solid transparent;
    border-right: 0.5rem solid transparent;
    border-top: 0.5rem solid #e2e8f0;
}

.cart-tooltip::after {
    content: '';
    position: absolute;
    bottom: -0.4375rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 0.4375rem solid transparent;
    border-right: 0.4375rem solid transparent;
    border-top: 0.4375rem solid white;
} 

@media (max-width: 767.98px) {
    .quick-view-btn,
    .add-to-cart-btn {
        font-size: 1.25rem;
    }
}