/* Стили для страницы товара */

/* Секция товара */
.item-section {
    position: relative;
}

/* Галерея изображений */
.item-gallery {
    position: relative;
}

.main-image-container {
    position: relative;
    overflow: hidden;
}

.main-image-container img {
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
}

.main-image-container img.fade-out {
    opacity: 0;
    transform: scale(0.95);
}

.main-image-container img.fade-in {
    animation: smoothFadeIn 0.6s ease-in-out forwards;
}

@keyframes smoothFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.main-image-container:hover img:not(.fade-out):not(.fade-in) {
    transform: scale(1.05);
}

/* Кнопки навигации галереи */
.gallery-nav-btn {
    transition: all 0.3s ease;
    opacity: 0;
}

.main-image-container:hover .gallery-nav-btn {
    opacity: 1;
}

.gallery-nav-btn:active {
    transform: translate(-50%, -50%) scale(0.9);
}

/* Индикаторы галереи */
.gallery-indicator {
    z-index: 10;
}

.indicator-dot {
    transition: all 0.3s ease;
}

.indicator-dot.active {
    width: 1rem;
    background: white;
}

/* Миниатюры */
.thumbnails-container {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.thumbnails-container::-webkit-scrollbar {
    height: 4px;
}

.thumbnails-container::-webkit-scrollbar-track {
    background: transparent;
}

.thumbnails-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.thumbnail {
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.thumbnail.active {
    border-color: #000000;
    opacity: 1;
}

.thumbnail:hover {
    transform: scale(1.05);
}

/* Информация о товаре */
.item-info {
    animation: fadeIn 0.6s ease-out;
}

.item-info h1 {
    background: linear-gradient(135deg, #1f2937, #4b5563);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Мета информация */
.item-meta {
    animation: fadeIn 0.6s ease-out 0.1s;
    animation-fill-mode: both;
}

.meta-item {
    transition: all 0.3s ease;
}

/* Цена товара */
.item-price {
    animation: fadeIn 0.6s ease-out 0.2s;
    animation-fill-mode: both;
}

.item-price > div:first-child {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Выбор размера */
.size-selection {
    animation: fadeIn 0.6s ease-out 0.3s;
    animation-fill-mode: both;
}

.size-selection h3 {
    position: relative;
    padding-bottom: 0.5rem;
}

.size-selection h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #000000, #4b5563);
    border-radius: 2px;
}

.size-option {
    transition: all 0.3s ease;
    position: relative;
}

.size-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.size-option.selected {
    border-color: #000000;
    background: linear-gradient(135deg, #000000, #374151);
    color: white !important;
    transform: scale(1.05);
    font-weight: 700;
}

.size-option:active {
    transform: scale(0.95);
}

/* Кнопка добавления в корзину */
.add-to-cart-main-btn {
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out 0.4s;
    animation-fill-mode: both;
}

.add-to-cart-main-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.add-to-cart-main-btn:hover::before {
    width: 400px;
    height: 400px;
}

.add-to-cart-main-btn:active {
    transform: scale(0.98);
}

.add-to-cart-main-btn.added {
    background: linear-gradient(135deg, #10b981, #059669);
}

.add-to-cart-main-btn.added i {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Описание товара */
.item-description {
    animation: fadeIn 0.6s ease-out 0.5s;
    animation-fill-mode: both;
}

.item-description h3 {
    position: relative;
    padding-bottom: 0.5rem;
}

.item-description h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #000000, #4b5563);
    border-radius: 2px;
}

.item-description ul li {
    animation: fadeIn 0.6s ease-out;
}

.item-description ul li:nth-child(1) { animation-delay: 0.6s; animation-fill-mode: both; }
.item-description ul li:nth-child(2) { animation-delay: 0.65s; animation-fill-mode: both; }
.item-description ul li:nth-child(3) { animation-delay: 0.7s; animation-fill-mode: both; }

/* Информация о доставке */
.delivery-info {
    animation: fadeIn 0.6s ease-out 0.7s;
    animation-fill-mode: both;
}

.delivery-info > h3 {
    position: relative;
    padding-bottom: 0.5rem;
}

.delivery-info > h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #000000, #4b5563);
    border-radius: 2px;
}

.delivery-option {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.delivery-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transition: left 0.6s ease;
}

.delivery-option:hover::before {
    left: 100%;
}

.delivery-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.delivery-details {
    animation: fadeIn 0.6s ease-out;
}

.detail-item {
    transition: all 0.3s ease;
}

/* Адаптивность */
@media (max-width: 768px) {
    .item-info h1 {
        font-size: 1.75rem;
    }

    .item-price .flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .item-price .text-4xl {
        font-size: 2rem;
    }

    .item-price .text-2xl {
        font-size: 1.25rem;
    }

    .item-price .flex.items-center {
        flex-wrap: nowrap;
    }

    .size-option {
        width: 3.5rem;
        height: 3.5rem;
    }

    .add-to-cart-main-btn {
        padding: 1rem;
        font-size: 1rem;
    }

    .delivery-details {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .main-image-container img {
        height: 24rem;
    }

    .gallery-nav-btn {
        opacity: 1;
        width: 2.5rem;
        height: 2.5rem;
    }

    .gallery-nav-btn i {
        font-size: 0.875rem;
    }
}

/* Анимация смены изображения - удалено, используем slideLeft/slideRight */

/* Индикация загрузки */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Эффект при добавлении в корзину */
@keyframes addToCartPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.7);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(0, 0, 0, 0);
    }
}

.add-to-cart-main-btn.pulse {
    animation: addToCartPulse 0.6s ease-out;
}

/* Скрытие ошибок */
#sizeError {
    animation: shake 0.5s ease-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* Улучшенная типографика */
.item-description p {
    line-height: 1.8;
}

/* Бейджи и метки */
.meta-item span:last-child {
    transition: all 0.3s ease;
}

.meta-item:hover span:last-child {
    transform: translateX(2px);
}

/* Плавное появление элементов */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

