/* product.css — стили для страницы товара */

.product-container {
    display: flex;
    gap: 60px;
    padding: 40px 0;
    flex: 1;
}
.footer-credit {
    flex-basis: 100%;
    grid-column: 1 / -1;  /* если футер на grid — растянет на все колонки */
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: #888;
}
/* Левая колонка — фото */
.product-image {
    flex: 1;
    background: #f8f8f8;
    position: relative;
}

.product-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Правая колонка — информация */
.product-info {
    flex: 1;
}

.product-title {
    font-size: 32px;
    font-weight: 500;
    letter-spacing: -1px;
    margin-bottom: 25px;
}

.product-features {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
}

.product-features li {
    font-size: 14px;
    color: #333;
    padding: 6px 0;
    position: relative;
    padding-left: 15px;
}

.product-features li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: #999;
}

.product-price {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 25px;
}

/* Цена со скидкой на странице товара: зачёркнутая старая + новая.
   На главной те же классы стилизует style.css (.price-old/.price-new). */
.product-price .price-old {
    text-decoration: line-through;
    color: #999;
    font-size: 0.7em;
    font-weight: 400;
    margin-right: 10px;
}

.product-price .price-new {
    color: inherit;
    font-weight: 700;
}

.size-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.size-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 10px 18px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    color: #111;
}

.size-btn:hover {
    border-color: #111;
    background: #f5f5f5;
}

.size-btn.active {
    border-color: #111;
    background: #111;
    color: white;
}

/* Стиль для размера, которого нет в наличии */
.size-btn.out-of-stock {
    background: #e0e0e0;
    border-color: #ccc;
    color: #999;
    cursor: not-allowed;
}

.size-btn.out-of-stock:hover {
    background: #e0e0e0;
    border-color: #ccc;
    color: #999;
}

.add-to-cart-btn {
    background: #111;
    color: white;
    border: none;
    padding: 14px 30px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    transition: 0.2s;
    letter-spacing: -0.6px;
}

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

/* Адаптив */
@media (max-width: 800px) {
    .product-container {
        flex-direction: column;
        gap: 30px;
    }
    
    .product-title {
        font-size: 26px;
    }
    
    .product-price {
        font-size: 24px;
    }
}

@media (max-width: 500px) {
    .size-selector {
        gap: 8px;
    }
    
    .size-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
}


/* ===== Кнопка SOLD OUT ===== */
.add-to-cart-btn.sold-out-btn {
    background: #b3b3b3;
    color: #ffffff;
    font-family: 'Helvetica', Arial, sans-serif;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.6px;
    text-transform: uppercase;
    cursor: not-allowed;
    opacity: 1;
    border: none;
}

.add-to-cart-btn.sold-out-btn:hover {
    background: #ffffff;
    color: #ffffff;
}


/* ===== Галерея товара ===== */
.product-image {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* Миниатюры */
.product-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 90px;
    flex-shrink: 0;
}

.product-thumbnail {
    width: 90px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.2s;
    background: #f5f5f5;
}

.product-thumbnail.active {
    border-color: #111;
}

.product-main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Основное изображение */
.product-main-image {
    width: 100%;
    background: #f8f8f8;
    overflow: hidden;
    touch-action: pan-y;
}

.product-main-image img {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.zoom-hint {
    text-align: center;
    font-size: 11px;
    color: #888888;
    margin-top: 8px;
    margin-bottom: 0;
}


/* =====================================================
   ГАЛЕРЕЯ ТОВАРА + АДАПТИВ + БЕЛЫЙ ФОН
===================================================== */

/* Основной блок галереи */
.product-image {
    display: flex;
    gap: clamp(10px, 2vw, 20px);
    align-items: flex-start;
    width: 100%;
    background: #ffffff !important;
}

/* Блок миниатюр */
.product-thumbnails {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1vw, 16px);
    width: clamp(50px, 8vw, 90px);
    flex-shrink: 0;
    background: #ffffff !important;
}

/* Миниатюры */
.product-thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    background: #ffffff !important;
    transition: 0.2s;
}

.product-thumbnail.active {
    border-color: #111;
}

/* Основное изображение */
.product-main-image {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    background: #ffffff !important;
    overflow: hidden;
    touch-action: pan-y;
}

/* Само изображение */
.product-main-image img,
#productImg {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    background: #ffffff !important;
}

/* =====================================================
   МОБИЛЬНАЯ ВЕРСТКА (как на планшете)
===================================================== */
@media (max-width: 1024px) {
    /* Контейнер товара */
    .product-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 24px;
        padding: 20px;
    }

    /* Галерея */
    .product-image {
        display: block;
        width: 100%;
        margin: 0;
        background: #ffffff !important;
    }

    /* Миниатюры скрываем */
    .product-thumbnails {
        display: none !important;
    }

    /* Основное изображение */
    .product-main-image,
    .product-main-image img,
    #productImg {
        width: 100%;
        max-width: 100%;
        height: auto;
        background: #ffffff !important;
    }

    /* Информация о товаре */
    .product-info {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    /* Заголовок */
    .product-title {
        font-size: 36px;
        line-height: 1.1;
        margin-bottom: 20px;
    }

    /* Описание */
    .product-features {
        margin-bottom: 24px;
    }

    /* Цена */
    .product-price {
        font-size: 42px;
        margin-bottom: 24px;
    }

    /* Размеры */
    .size-selector {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 24px;
    }

    .size-btn {
        flex: 1 1 calc(20% - 10px);
        min-width: 60px;
    }

    /* Кнопка */
    .add-to-cart-btn {
        width: 100%;
    }

    /* Хедер */
    header {
        padding: 16px 20px;
    }

    /* Логотип */
    .logo-img {
        max-width: 220px;
        height: auto;
    }
    
}

/* ===== ЛОГОТИП — АДАПТИВ КАК В STYLE.CSS ===== */
@media (max-width: 700px) {
    .logo-img {
        height: 32px !important;
        width: auto !important;
    }
}

@media (max-width: 480px) {
    .logo-img {
        height: 28px !important;
        width: auto !important;
    }
}

/* Дополнительно для очень маленьких экранов */
@media (max-width: 400px) {
    .logo-img {
        height: 24px !important;
        width: auto !important;
    }
}

/* ===== HEADER МОБИЛЬНАЯ ВЕРСИЯ ===== */
@media (max-width: 700px) {
    header {
        padding: 12px 0;
        margin-bottom: 24px;
    }
    
    .burger-btn {
        font-size: 22px;
        width: 36px;
        height: 36px;
    }
    
    .logo-img {
        height: 32px;
    }
    
    .cart-btn {
        font-size: 14px;
        gap: 6px;
    }
    
    .cart-btn span {
        font-size: 11px;
        padding: 2px 6px;
    }
}

@media (max-width: 480px) {
    .burger-btn {
        font-size: 20px;
        width: 32px;
        height: 32px;
    }
    
    .logo-img {
        height: 28px;
    }
    
    .cart-btn {
        font-size: 12px;
    }
}



/* ===== МОБИЛЬНАЯ НАВИГАЦИЯ ПОД ФОТО (КАК НА СТРАНИЦЕ "О НАС") ===== */

.mobile-gallery-controls {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 20px 0 0 0;
    padding: 10px 0;
}

.mobile-gallery-prev,
.mobile-gallery-next {
    background: rgba(255, 255, 255, 0.5);
    color: white;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 20px;
    transition: 0.2s;
    opacity: 0.6;
    border-radius: 0;
}

.mobile-gallery-prev:hover,
.mobile-gallery-next:hover {
    background: rgba(228, 228, 228, 0.8);
    color: white;
    opacity: 1;
}

.mobile-gallery-prev:active,
.mobile-gallery-next:active {
    transform: scale(0.95);
}

.mobile-gallery-dots {
    display: flex;
    gap: 12px;
    align-items: center;
}

.mobile-gallery-dot {
    width: 10px;
    height: 10px;
    background: #ccc;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
}

.mobile-gallery-dot.active {
    background: #000000;
    width: 20px;
    border-radius: 4px;
}

.mobile-gallery-dot:hover {
    background: #888;
}

/* Показываем навигацию только на мобильных (1024px и ниже) */
@media (max-width: 1024px) {
    .mobile-gallery-controls {
        display: flex;
    }
    
    /* Скрываем миниатюры на мобильных */
    .product-thumbnails {
        display: none !important;
    }
    
    /* Делаем основное изображение на всю ширину */
    .product-main-image {
        width: 100%;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .mobile-gallery-prev,
    .mobile-gallery-next {
        padding: 6px 12px;
        font-size: 16px;
    }
    
    .mobile-gallery-dot {
        width: 8px;
        height: 8px;
    }
    
    .mobile-gallery-dot.active {
        width: 16px;
    }
    
    .mobile-gallery-dots {
        gap: 8px;
    }
}

/* ===== КНОПКА "НАЗАД" НАД ФОТО ===== */
.back-button-container {
    width: 100%;
    margin-bottom: 20px;
}

.back-to-catalog {
    background: none;
    border: none;
    font-size: 14px;
    color: #888;
    cursor: pointer;
    padding: 8px 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
    font-family: inherit;
    letter-spacing: -0.4px;
}

.back-to-catalog:hover {
    color: #111;
}

.back-to-catalog:active {
    transform: translateX(-3px);
}

/* На мобильных кнопка чуть крупнее для удобства */
@media (max-width: 768px) {
    .back-to-catalog {
        font-size: 15px;
        padding: 10px 0;
    }
}

/* ===== ФИКСИРОВАННЫЙ КВАДРАТ ДЛЯ ОСНОВНОГО ФОТО ===== */
.product-main-image,
#productImg {
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
}

/* ===== LIGHTBOX (ФОТО НА ВЕСЬ ЭКРАН) ===== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    cursor: default;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    font-family: 'Helvetica', sans-serif;
    transition: 0.2s;
    z-index: 10001;
}

.lightbox-close:hover {
    color: #ccc;
    transform: scale(1.1);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    color: #666666;
    cursor: pointer;
    padding: 20px;
    transition: 0.2s;
    z-index: 10001;
    user-select: none;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    color: #999999;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 14px;
    font-family: 'Helvetica', sans-serif;
    z-index: 10001;
}

@media (max-width: 768px) {
    .lightbox-prev,
    .lightbox-next {
        font-size: 35px;
        padding: 15px;
        color: #666666;
    }
    
    .lightbox-close {
        font-size: 35px;
        top: 15px;
        right: 20px;
    }
    
    .lightbox-counter {
        font-size: 12px;
        bottom: 15px;
    }
}
