/* Base styles for body */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #1a0033, #000033);
    position: relative;
    overflow-x: hidden;
    font-family: 'Nexa', sans-serif;
    transition: opacity 0.3s ease;
}

/* Main content styles */
main {
    position: relative;
    z-index: 2;
    padding: 40px 0 0 40px;
    max-width: 1200px;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Product section styles */
.product-section {
    position: relative;
    z-index: 2;
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 200px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.product-wrapper {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 900px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-title {
    color: #FFF;
    font-size: 48px;
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: 0 5px 20px rgba(255, 255, 255, 0.3);
    margin: 0;
    text-align: center;
}

.product-labels {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.label {
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

.label-hit {
    background: #ff4444;
    color: #FFF;
}

.label-new {
    background: #9F7FF3;
    color: #FFF;
}

.product-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.product-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 10px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-image:hover {
    transform: scale(1.05);
}

.product-details {
    color: #FFF;
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
}

.product-description {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.5;
    margin: 0;
}

.product-features {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
}

.product-features li {
    margin-bottom: 10px;
}

.product-price {
    font-size: 24px;
    font-weight: 900;
    color: #9F7FF3;
    text-shadow: 0 5px 20px rgba(159, 127, 243, 0.8);
}

.add-to-cart-btn {
    display: inline-block;
    background: #FFF;
    color: #000;
    padding: 15px 30px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s;
    position: relative;
    overflow: hidden;
}

.add-to-cart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(159, 127, 243, 0.8);
    opacity: 1;
}

.add-to-cart-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(159, 127, 243, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: 0;
}

.add-to-cart-btn:hover::after {
    width: 300px;
    height: 300px;
}

.add-to-cart-btn span {
    position: relative;
    z-index: 1;
}

.return-btn {
    display: inline-block;
    background: none;
    color: #FFF;
    padding: 15px 30px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    border-radius: 5px;
    border: 2px solid #9F7FF3;
    transition: background 0.3s ease, color 0.3s ease;
    text-align: center;
}

.return-btn a {
    color: #FFF;
    text-decoration: none;
}

.return-btn:hover {
    background: #9F7FF3;
    color: #FFF;
}

/* Specifications styles */
.product-specifications {
    color: #FFF;
}

.product-specifications h2 {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 15px;
}

.spec-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

.spec-list li {
    margin-bottom: 10px;
}

.spec-list strong {
    color: #9F7FF3;
}

/* Reviews styles */
.product-reviews {
    color: #FFF;
}

.product-reviews h2 {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 15px;
}

.review {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.review-text {
    font-size: 16px;
    margin: 0 0 5px;
}

.review-author {
    font-size: 14px;
    color: #9F7FF3;
    margin: 0;
}

/* Related products styles */
.related-products {
    color: #FFF;
}

.related-products h2 {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 15px;
}

.related-items {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.related-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    width: 200px;
}

.related-image {
    width: 100%;
    height: auto;
    border-radius: 5px;
}

.related-title {
    font-size: 16px;
    font-weight: 700;
    margin: 10px 0 5px;
}

.related-price {
    font-size: 14px;
    color: #9F7FF3;
    margin: 0;
}

/* Footer styles */
footer {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 40px 40px;
    background: rgba(0, 0, 33, 0.8);
    color: #FFF;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content p {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 20px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links li {
    display: inline;
}

.footer-links a {
    color: #FFF;
    text-decoration: none;
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 0.8;
}

/* Cart icon styles */
.cart-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: #FFF;
    font-size: 40px;
    cursor: pointer;
    padding: 5px 10px;
    background: rgba(159, 127, 243, 0.8);
    border-radius: 10px;
    transition: all 0.3s ease;
    z-index: 1000;
}

.cart-icon:hover {
    opacity: 0.8;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: #FFF;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

/* Loading overlay styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 33, 0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #9F7FF3;
    border-top: 5px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    main {
        padding: 20px;
    }

    .product-section {
        padding: 20px;
    }

    .product-wrapper {
        padding: 20px;
    }

    .product-title {
        font-size: 36px;
    }

    .product-image {
        max-width: 200px;
    }

    .product-description {
        font-size: 16px;
    }

    .product-features {
        font-size: 14px;
    }

    .product-price {
        font-size: 20px;
    }

    .add-to-cart-btn {
        padding: 12px 25px;
        font-size: 14px;
    }

    .return-btn {
        padding: 12px 25px;
        font-size: 14px;
    }

    .product-specifications h2,
    .product-reviews h2,
    .related-products h2 {
        font-size: 20px;
    }

    .spec-list,
    .review-text {
        font-size: 14px;
    }

    .related-item {
        width: 150px;
    }

    .cart-icon {
        font-size: 30px;
    }

    footer {
        padding: 20px;
    }

    .footer-content p {
        font-size: 14px;
    }

    .footer-links {
        flex-direction: column;
        gap: 10px;
    }

    .footer-links a {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .product-title {
        font-size: 28px;
    }

    .product-image {
        max-width: 150px;
    }

    .product-description {
        font-size: 14px;
    }

    .product-features {
        font-size: 12px;
    }

    .product-price {
        font-size: 18px;
    }

    .add-to-cart-btn {
        padding: 10px 20px;
        font-size: 12px;
    }

    .return-btn {
        padding: 10px 20px;
        font-size: 12px;
    }

    .related-item {
        width: 120px;
    }
}

/* Медиа-запросы для мобильных устройств */
@media (max-width: 768px) {

    /* Основной контейнер */
    body {
        overflow-x: hidden;
        /* Предотвращаем горизонтальную прокрутку */
    }

    main {
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
        /* Учитываем padding в ширине */
    }

    .product-section {
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
        align-items: flex-start;
    }

    .product-wrapper {
        padding: 15px;
        border-radius: 12px;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        /* Не выходит за пределы экрана */
        box-sizing: border-box;
    }

    /* Заголовок продукта */
    .product-title {
        font-size: 26px;
        line-height: 1.2;
        text-align: center;
        margin: 0 auto;
        max-width: 100%;
        word-wrap: break-word;
        /* Перенос длинных слов */
    }

    /* Лейблы */
    .product-labels {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: center;
        max-width: 100%;
    }

    .label {
        font-size: 11px;
        padding: 4px 8px;
    }

    /* Галерея продукта */
    .product-gallery {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        overflow-x: hidden;
        /* Предотвращаем горизонтальное переполнение */
    }

    .product-image,
    .product-video {
        max-width: 100%;
        /* Не больше ширины контейнера */
        width: 160px;
        height: auto;
        border-radius: 8px;
        object-fit: contain;
        /* Сохраняем пропорции */
    }

    /* Детали продукта */
    .product-details {
        gap: 10px;
        text-align: center;
        width: 100%;
    }

    .product-description {
        font-size: 13px;
        line-height: 1.4;
        word-wrap: break-word;
    }

    .product-features {
        font-size: 12px;
        text-align: left;
        padding: 0;
        margin: 0;
        width: 100%;
    }

    .product-features li {
        margin-bottom: 8px;
    }

    .product-price {
        font-size: 16px;
    }

    /* Кнопки */
    .add-to-cart-btn,
    .return-btn {
        padding: 8px 12px;
        font-size: 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        text-align: center;
    }

    .return-btn a {
        display: block;
        width: 100%;
    }

    /* Спецификации */
    .product-specifications h2,
    .product-reviews h2,
    .related-products h2 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .spec-list {
        font-size: 12px;
        line-height: 1.4;
        padding: 0;
        width: 100%;
    }

    .spec-list li {
        word-wrap: break-word;
    }

    /* Отзывы */
    .review {
        padding: 8px;
        border-radius: 8px;
        width: 100%;
        box-sizing: border-box;
    }

    .review-text {
        font-size: 12px;
        line-height: 1.4;
        word-wrap: break-word;
    }

    .review-author {
        font-size: 11px;
    }

    #review-form {
        width: 100%;
    }

    #review-form textarea {
        width: 100%;
        max-width: 100%;
        height: 50px;
        font-size: 12px;
        padding: 6px;
        border-radius: 6px;
        box-sizing: border-box;
    }

    .submit-review-btn {
        padding: 6px 10px;
        font-size: 12px;
        width: 100%;
        box-sizing: border-box;
    }

    /* Связанные товары */
    .related-items {
        gap: 12px;
        overflow-x: auto;
        justify-content: flex-start;
        width: 100%;
        padding: 0;
        box-sizing: border-box;
        -webkit-overflow-scrolling: touch;
        /* Плавная прокрутка на iOS */
    }

    .related-item {
        width: 120px;
        padding: 8px;
        border-radius: 8px;
        flex: 0 0 auto;
        box-sizing: border-box;
    }

    .related-image {
        width: 100%;
        height: auto;
        border-radius: 5px;
    }

    .related-title {
        font-size: 12px;
        margin: 6px 0 4px;
        word-wrap: break-word;
    }

    .related-price {
        font-size: 11px;
    }

    /* Иконка корзины */
    .cart-icon {
        font-size: 24px;
        padding: 5px;
        bottom: 10px;
        right: 10px;
        box-sizing: border-box;
    }

    .cart-count {
        width: 14px;
        height: 14px;
        font-size: 8px;
        top: -6px;
        right: -6px;
    }

    /* Попап */
    .crypto-popup-content {
        padding: 10px;
        max-width: 90%;
        box-sizing: border-box;
    }

    .crypto-popup-content p {
        font-size: 12px;
        word-wrap: break-word;
    }

    .crypto-popup-actions a,
    .crypto-close-btn {
        font-size: 11px;
        padding: 5px 10px;
    }

    /* Футер */
    footer {
        padding: 15px;
        width: 100%;
        box-sizing: border-box;
    }

    .footer-content {
        width: 100%;
        max-width: 100%;
    }

    .footer-content p {
        font-size: 12px;
        word-wrap: break-word;
    }

    .footer-links {
        flex-direction: column;
        gap: 8px;
        width: 100%;
        padding: 0;
    }

    .footer-links a {
        font-size: 11px;
    }

    /* Спиннер */
    .loading-overlay .spinner {
        width: 36px;
        height: 36px;
        border: 3px solid #9F7FF3;
        border-top: 3px solid transparent;
    }
}

@media (max-width: 480px) {
    main {
        padding: 8px;
    }

    .product-section {
        padding: 8px;
    }

    .product-wrapper {
        padding: 12px;
        border-radius: 10px;
        gap: 10px;
    }

    .product-title {
        font-size: 22px;
    }

    .label {
        font-size: 10px;
        padding: 3px 6px;
    }

    .product-image,
    .product-video {
        width: 140px;
    }

    .product-description {
        font-size: 12px;
    }

    .product-features {
        font-size: 11px;
    }

    .product-price {
        font-size: 14px;
    }

    .add-to-cart-btn,
    .return-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .product-specifications h2,
    .product-reviews h2,
    .related-products h2 {
        font-size: 14px;
    }

    .spec-list,
    .review-text {
        font-size: 11px;
    }

    .review-author {
        font-size: 10px;
    }

    #review-form textarea {
        height: 45px;
        font-size: 11px;
        padding: 5px;
    }

    .submit-review-btn {
        padding: 5px 8px;
        font-size: 11px;
    }

    .related-item {
        width: 110px;
        padding: 6px;
    }

    .related-title {
        font-size: 11px;
    }

    .related-price {
        font-size: 10px;
    }

    .cart-icon {
        font-size: 22px;
        padding: 4px;
    }

    .cart-count {
        width: 12px;
        height: 12px;
        font-size: 7px;
    }

    .crypto-popup-content {
        padding: 8px;
    }

    .crypto-popup-content p {
        font-size: 11px;
    }

    .crypto-popup-actions a,
    .crypto-close-btn {
        font-size: 10px;
        padding: 4px 8px;
    }

    .footer-content p {
        font-size: 11px;
    }

    .footer-links a {
        font-size: 10px;
    }

    .loading-overlay .spinner {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 360px) {
    .product-title {
        font-size: 20px;
    }

    .product-image,
    .product-video {
        width: 120px;
    }

    .product-description {
        font-size: 11px;
    }

    .product-features {
        font-size: 10px;
    }

    .product-price {
        font-size: 13px;
    }

    .add-to-cart-btn,
    .return-btn {
        padding: 5px 8px;
        font-size: 10px;
    }

    .related-item {
        width: 100px;
    }

    .related-title {
        font-size: 10px;
    }

    .related-price {
        font-size: 9px;
    }

    .cart-icon {
        font-size: 20px;
        padding: 3px;
    }

    .cart-count {
        width: 10px;
        height: 10px;
        font-size: 6px;
    }
}