/* Product Page Styles */

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

.container {
    overflow-x: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

* {
    box-sizing: border-box;
}

.product-page {
    padding: 20px 0;
    min-height: 100vh;
    background-color: #FFFFFF;
    overflow-x: hidden;
}

.breadcrumb {
    margin-bottom: 40px;
}

.breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #000000;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.22;
    letter-spacing: -0.015em;
    transition: opacity 0.3s ease;
}

.breadcrumb-link svg {
    flex-shrink: 0;
}

.breadcrumb-link:hover {
    opacity: 0.7;
}

.product-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: stretch; /* растягиваем колонки до одной высоты */
    max-width: 100%;
    overflow-x: hidden;
}

/* Product Image Section */
.product-image-section {
    display: flex;
    flex-direction: column;
    gap: 40px;
    justify-content: space-between;
}

.product-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background-color: #FFFFFF;
    min-height: 520px;
    max-width: 100%;
    overflow: hidden;
    position: relative;
}

.product-main-image {
    max-width: 100%;
    height: auto;
    max-height: 520px;
    width: auto;
    object-fit: contain;
    transform: scale(1);
    transition: opacity 0.3s ease;
    opacity: 1;
}

/* Gallery Navigation Arrows - используем стили slider-btn */
.product-image-container .slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
}

/* Чёрные стрелки для галереи продукта */
/* .product-image-container .slider-btn::before,
.product-image-container .slider-btn::after {
    background: #000000 !important;
} */

/* .product-image-container .slider-btn:hover::before,
.product-image-container .slider-btn:hover::after {
    background: #333333 !important;
} */

.product-image-container .slider-btn-prev {
    left: 20px;
}

.product-image-container .slider-btn-next {
    right: 20px;
}

.product-image-container .slider-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Product Gallery */
.product-gallery {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0 20px 5px 20px;
    margin-top: auto;
}

.gallery-thumbnail {
    width: 100px;
    height: 100px;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #FFFFFF;
    padding: 5px;
    box-sizing: border-box;
    margin-bottom: 5px;
}

.gallery-thumbnail:hover {
    border-color: #005CB9;
    transform: scale(1.05);
}

.gallery-thumbnail.active {
    border-color: #005CB9;
    border-width: 3px;
}

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

/* Related Products Full Width */
.related-products-full-width {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    background-color: #FFFFFF;
    padding: 60px 0;
    margin-top: 80px;
    overflow-x: hidden;
    position: relative;
}

.related-products-slider {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
}

/* .related-products-container {
    flex: 1;
    overflow: hidden;
    max-width: calc(100vw - 140px); 
} */

.related-products-container {
    /* Ширина будет установлена через JS для точного соответствия целому числу карточек */
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden; /* Скрываем лишние карточки */
    position: relative;
    box-sizing: border-box;
}

/* .related-products {
    display: flex;
    gap: 40px;
    width: max-content;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
} */

.related-products {
    display: flex;
    gap: 20px;
    width: max-content; /* Ширина по содержимому (все 7 карточек) */
    transition: transform 0.3s ease; /* Для анимации слайдера */
}

/* .related-product {
    flex-shrink: 0;
    width: 240px;
} */

.related-product {
    width: 235px;
    flex-shrink: 0;
}

/* Slider Arrows */
.slider-arrow {
    width: 50px;
    height: 50px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.slider-arrow svg {
    flex-shrink: 0;
}

.slider-arrow:hover {
    transform: scale(1.1);
    opacity: 0.7;
}

.slider-arrow:active {
    transform: scale(0.95);
}

.related-product {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: left;
    gap: 10px;
}

.related-product-image {
    width: 180px;
    height: 180px;
    object-fit: contain;
    margin: 0 auto 15px auto;
    transition: transform 0.3s ease;
    display: block;
    padding: 10px; /* внутренний отступ для выравнивания визуального размера */
}

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

.related-product-info {
    text-align: left;
    width: 100%;
}

.related-product-info h4 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.22;
    letter-spacing: -0.015em;
    text-transform: uppercase;
    color: #000000;
    margin: 0 0 8px 0;
    text-align: left;
}

.related-product-info p {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 1.22;
    letter-spacing: -0.015em;
    color: #000000;
    margin: 0 0 8px 0;
    text-align: left;
}

.related-product-info .weight {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 10px;
    line-height: 1.22;
    letter-spacing: -0.015em;
    color: #797979;
}

/* Product Info Section */
.product-info-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-self: flex-start; /* не растягиваем колонку, убираем пустое место снизу */
    height: 95%; /* растягиваем колонку до высоты строки */
    justify-content: space-between; /* тянем кнопку вниз, распределяя пространство */
}

.product-title h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 23px;
    line-height: 1.22;
    letter-spacing: -0.015em;
    text-transform: uppercase;
    color: #000000;
    margin: 0;
}

.product-description {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-description p {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.22;
    letter-spacing: -0.015em;
    color: #4C4A4A;
    margin: 0;
}

.product-weight {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 13px;
    line-height: 1.22;
    letter-spacing: -0.015em;
    color: #797979;
}

/* Product Sections */
.product-sections {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.section-button {
    padding: 12px 24px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.22;
    letter-spacing: -0.015em;
    text-align: center;
    border: 2px solid #005CB9;
    background-color: transparent;
    color: #005CB9;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 30px;
    flex: 1;
}

.section-button.active {
    background-color: #005CB9;
    color: #FFFFFF;
}

.section-button:hover:not(.active) {
    background-color: rgba(0, 92, 185, 0.1);
}

/* Section Content */
.section-content {
    display: none;
    margin-top: 20px;
    min-height: 200px;
}

.section-content.active {
    display: block;
}

/* Composition Tab */
.composition-text {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
}

.composition-text p {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.22;
    letter-spacing: -0.015em;
    color: #000000;
    margin: 0;
}

/* Custom scrollbar for composition text */
.composition-text::-webkit-scrollbar {
    width: 6px;
}

.composition-text::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.composition-text::-webkit-scrollbar-thumb {
    background: #888888;
    border-radius: 3px;
}

.composition-text::-webkit-scrollbar-thumb:hover {
    background: #666666;
}

/* Ingredients Tab */
.ingredients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* Важно: скрываем всё, что выходит */
    padding: 5px; /* Небольшой внутренний отступ */
}

.ingredient-card {
    display: flex;
    flex-direction: column;
    align-items: center; /* Центрируем все элементы */
    gap: 12px;
    padding: 0;
    text-align: center; /* Центрируем текст */
}

.ingredient-card .ingredient-image {
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto; /* Центрируем изображение */
    flex-shrink: 0; /* Предотвращаем сжатие */
}

.ingredient-card .ingredient-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.property-card {
    padding: 20px;
    background-color: #F8F9FA;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.property-card .property-icon {
    font-size: 32px;
    line-height: 1;
    margin-bottom: 4px;
}

.property-card h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.22;
    letter-spacing: -0.015em;
    color: #000000;
    margin: 0;
}

.property-card p {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.4;
    letter-spacing: -0.015em;
    color: #4C4A4A;
    margin: 0;
}

.ingredient-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    max-width: 100%;
    overflow: hidden; /* Гарантируем, что содержимое не выйдет */
    box-sizing: border-box;
    padding: 10px;
}

.ingredient-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 50%;
    max-width: 100%;
    display: block;
}

.ingredient-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 1.22;
    letter-spacing: -0.015em;
    color: #000000;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    margin: 0;
}

/* Properties Tab */
.properties-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.property-item {
    padding: 20px;
    background-color: #F8F9FA;
    border-radius: 8px;
}

.property-item h4 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.22;
    letter-spacing: -0.015em;
    color: #000000;
    margin: 0 0 8px 0;
}

.property-item p {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.22;
    letter-spacing: -0.015em;
    color: #4C4A4A;
    margin: 0;
}

/* Buy Section - Where to Buy */
.buy-section {
    margin-top: 40px;
    padding: 30px 40px;
    background: linear-gradient(135deg, #E8F0F5 0%, #D6E3EA 100%);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.buy-section .buy-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 23px;
    line-height: 1.22;
    letter-spacing: -0.015em;
    margin: 0 0 30px 0;
    text-align: center;
    color: #005CB9;
    text-transform: none;
}

.buy-section .buy-columns {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.buy-section .market-logo.market-card {
    background-color: #FFFFFF;
    border-radius: 12px;
    padding: 20px 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: auto;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 150px;
    max-width: 250px;
    box-sizing: border-box;
    overflow: hidden;
}

.buy-section .market-logo.market-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.buy-section .market-logo.market-card a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    height: 100%;
    width: 100%;
}

.buy-section .ozon-logo-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 28px;
    line-height: 1;
    color: #005CB9;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.buy-section .wb-logo-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 22px;
    color: #7F1FBF;
    text-transform: lowercase;
    letter-spacing: 0.01em;
    display: inline-block;
    vertical-align: middle;
}

.buy-section .gold-apple-logo-img {
    width: auto;
    height: 50px;
    object-fit: contain;
    max-width: 100%;
    display: block;
}

.buy-title {
    margin-bottom: 25px;
    text-transform: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .product-content {
        gap: 60px;
    }
    
    .related-products {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    /* Header styles for product page */
    .header-content {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 20px !important;
        min-height: auto !important;
        padding: 20px 0 !important;
    }
    
    .logo {
        order: 1 !important;
    }
    
    .logo-image {
        height: 80px !important;
        width: 120px !important;
    }
    
    .nav {
        gap: 20px !important;
        flex-direction: column !important;
        display: none !important; /* Hidden by default, shown only when mobile menu is open */
    }
    
    .nav.mobile-open {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: #005CB9 !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0 !important;
        margin: 0 !important;
        z-index: 9999 !important;
        animation: slideInFromTop 0.3s ease-out !important;
    }
    
    /* Ensure nav is visible during closing animation */
    .nav:not(.mobile-open) {
        display: none !important;
    }
    
    /* Special class for closing animation */
    .nav.closing {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: #005CB9 !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0 !important;
        margin: 0 !important;
        z-index: 9999 !important;
        animation: slideOutToTop 0.3s ease-in forwards !important;
    }
    
    @keyframes slideInFromTop {
        0% {
            transform: translateY(-100%);
            opacity: 0;
        }
        50% {
            transform: translateY(-50%);
            opacity: 0.5;
        }
        100% {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    @keyframes slideInWithBounce {
        0% {
            transform: translateY(-100%) scale(0.8);
            opacity: 0;
        }
        60% {
            transform: translateY(10px) scale(1.02);
            opacity: 0.9;
        }
        80% {
            transform: translateY(-5px) scale(0.99);
            opacity: 1;
        }
        100% {
            transform: translateY(0) scale(1);
            opacity: 1;
        }
    }
    
    @keyframes slideOutToTop {
        0% {
            transform: translateY(0);
            opacity: 1;
        }
        50% {
            transform: translateY(-50%);
            opacity: 0.5;
        }
        100% {
            transform: translateY(-100%);
            opacity: 0;
        }
    }
    
    @keyframes fadeOutScale {
        0% {
            transform: scale(1);
            opacity: 1;
        }
        50% {
            transform: scale(0.95);
            opacity: 0.7;
        }
        100% {
            transform: scale(0.8);
            opacity: 0;
        }
    }
    
    .nav.mobile-open .nav-link,
    .nav.closing .nav-link {
        color: #FFFFFF !important;
        font-size: 18px !important;
        font-weight: 500 !important;
        text-align: center !important;
        padding: 15px 20px !important;
        margin: 10px 0 !important;
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        text-decoration: none !important;
        transition: all 0.3s ease !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
    
    @keyframes fadeInUp {
        0% {
            opacity: 0;
            transform: translateY(20px);
        }
        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    @keyframes fadeOutDown {
        0% {
            opacity: 1;
            transform: translateY(0);
        }
        100% {
            opacity: 0;
            transform: translateY(-20px);
        }
    }
    
    .nav.mobile-open .nav-link:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        transform: scale(1.05) !important;
    }
    
    /* Burger menu button styles */
    .mobile-menu-btn {
        transition: all 0.3s ease !important;
        position: relative !important;
    }
    
    .mobile-menu-btn.is-open {
        color: #FFFFFF !important;
        transform: rotate(0deg) !important;
        transition: all 0.3s ease !important;
    }
    
    /* Menu close button styles */
    .menu-close-btn {
        position: absolute !important;
        top: 20px !important;
        right: 20px !important;
        background: none !important;
        border: none !important;
        color: #FFFFFF !important;
        font-size: 24px !important;
        cursor: pointer !important;
        padding: 10px !important;
        z-index: 10000 !important;
        transition: all 0.3s ease !important;
    }
    
    .menu-close-btn:hover {
        transform: scale(1.1) !important;
        opacity: 0.8 !important;
    }
    
    .product-content {
        grid-template-columns: 1fr;
        gap: 0;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .related-products-container {
        /* Ширина устанавливается через JS */
        max-width: 100%;
    }
    
    .product-image-section {
        gap: 0;
        order: 1;
        justify-content: flex-start;
    }
    
    .product-image-container {
        padding: 20px;
        min-height: 300px;
        background-color: #FFFFFF;
    }
    
    .product-main-image {
        max-height: 350px;
        transform: scale(1);
        width: 100%;
        object-fit: contain;
    }
    
    .product-image-container .slider-btn {
        width: 50px;
        height: 50px;
    }
    
    /* .product-image-container .slider-btn::before,
    .product-image-container .slider-btn::after {
        width: 40px;
        height: 2px;
    } */
    
    .product-image-container .slider-btn-prev {
        left: 10px;
    }
    
    .product-image-container .slider-btn-next {
        right: 10px;
    }
    
    .product-gallery {
        gap: 10px;
        padding: 0 10px;
        margin-top: 20px;
    }
    
    .product-content {
        align-items: start;
    }
    
    .gallery-thumbnail {
        width: 70px;
        height: 70px;
    }
    
    .product-info-section {
        order: 2;
        padding: 20px;
        gap: 20px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .related-products-full-width {
        margin-top: 30px;
        padding: 30px 0;
    }
    
    .related-products-slider {
        gap: 10px;
    }
    
    .slider-arrow {
        width: 30px;
        height: 30px;
    }
    
    .slider-arrow svg {
        width: 20px;
        height: 11px;
    }
    
    .related-products {
        gap: 15px;
    }
    
    .related-product {
        width: 150px; /* Фиксированная ширина для мобильных */
        flex-shrink: 0;
        flex-direction: column;
        align-items: center;
    }
    
    .related-products-container h2 {
        text-align: center;
        width: 100%;
    }
    
    .related-product-image {
        width: 120px;
        height: 120px;
        padding: 6px;
    }
    
    .related-product-info {
        text-align: center;
    }
    
    .related-product-info h4 {
        font-size: 11px;
        margin-bottom: 5px;
        text-align: center;
    }
    
    .related-product-info p {
        font-size: 10px;
        line-height: 1.3;
        margin-bottom: 5px;
        text-align: center;
    }
    
    .related-product-info .weight {
        font-size: 9px;
        text-align: center;
        display: block;
    }
    
    .product-title h1 {
        font-size: 18px;
        line-height: 1.2;
        margin-bottom: 10px;
    }
    
    .product-description {
        gap: 5px;
    }
    
    .product-description p {
        font-size: 12px;
    }
    
    .product-weight {
        font-size: 20px;
    }
    
    .product-sections {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 5px;
        margin: 15px 0;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        overflow: visible;
        position: relative;
        z-index: 2;
    }
    
    .section-button {
        padding: 10px 12px;
        font-size: 10px;
        border-radius: 30px;
        border: 1px solid #005CB9;
        flex: 1;
        min-width: 0;
        min-height: 40px;
        white-space: normal; /* Разрешаем перенос слов */
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .section-content {
        margin-top: 20px;
        min-height: 150px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        position: relative;
        z-index: 1;
    }
    
    .composition-text {
        max-height: 160px;
        font-size: 10px;
    }
    
    .ingredients-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .ingredient-card {
        gap: 8px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .ingredient-card .ingredient-image {
        width: 100px;
        height: 100px;
    }
    
    .ingredient-card .ingredient-info {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .ingredient-card .ingredient-info h3 {
        font-size: 11px !important;
        word-break: normal;
        overflow-wrap: normal;
        white-space: normal;
    }
    
    .ingredient-card .ingredient-info p {
        font-size: 10px !important;
        word-break: normal;
        overflow-wrap: normal;
        white-space: normal;
    }
    
    .ingredient-image {
        width: 50px;
        height: 50px;
    }
    
    .ingredient-name {
        font-size: 10px;
    }
    
    .properties-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .property-card {
        padding: 15px;
        gap: 10px;
    }
    
    .property-card .property-icon {
        font-size: 24px;
    }
    
    .property-card h3 {
        font-size: 14px;
    }
    
    .property-card p {
        font-size: 12px;
    }
    
    .buy-section {
        margin-top: 30px;
        padding: 20px 15px;
    }
    
    .buy-section .buy-title {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .buy-section .buy-columns {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .buy-section .market-logo.market-card {
        min-width: 100%;
        max-width: 100%;
        padding: 15px 20px;
        min-height: 70px;
    }
    
    .buy-section .ozon-logo-text {
        font-size: 24px;
    }
    
    .buy-section .wb-logo-text {
        font-size: 20px;
    }
    
    .buy-section .gold-apple-logo-img {
        height: 40px;
    }
}

@media (max-width: 480px) {
    /* Header styles for very small screens */
    .header-content {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 15px !important;
        min-height: auto !important;
        padding: 15px 0 !important;
    }

    .product-info-section {
        height: auto;
    }
    
    .logo {
        order: 1 !important;
    }
    
    .logo-image {
        height: 60px !important;
        width: 100px !important;
    }
    
    .nav {
        gap: 15px !important;
        flex-direction: column !important;
        display: none !important; /* Hidden by default, shown only when mobile menu is open */
    }
    
    .nav.mobile-open {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: #005CB9 !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0 !important;
        margin: 0 !important;
        z-index: 9999 !important;
        animation: slideInFromTop 0.3s ease-out !important;
    }
    
    .nav.mobile-open .nav-link {
        color: #FFFFFF !important;
        font-size: 16px !important;
        font-weight: 500 !important;
        text-align: center !important;
        padding: 12px 20px !important;
        margin: 8px 0 !important;
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        text-decoration: none !important;
        transition: all 0.3s ease !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
    
    .nav.mobile-open .nav-link:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        transform: scale(1.05) !important;
    }
    
    .nav-link {
        font-size: 14px !important;
    }
    
    .product-page {
        padding: 10px 0;
        overflow-x: hidden;
    }
    
    .related-products-container {
        /* Ширина устанавливается через JS */
        max-width: 100%;
    }
    
    .breadcrumb {
        margin-bottom: 20px;
    }
    
    .product-content {
        gap: 30px;
    }
    
    .product-image-container {
        padding: 20px;
        min-height: 300px;
    }
    
    .product-main-image {
        max-height: 400px;
        transform: scale(1.05);
    }
    
    .product-image-container .slider-btn {
        width: 40px;
        height: 40px;
    }
    
    /* .product-image-container .slider-btn::before,
    .product-image-container .slider-btn::after {
        width: 30px;
        height: 2px;
    } */
    
    .product-image-container .slider-btn-prev {
        left: 5px;
    }
    
    .product-image-container .slider-btn-next {
        right: 5px;
    }
    
    .product-gallery {
        gap: 8px;
        padding: 0 10px;
        margin-top: 15px;
    }
    
    .gallery-thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .related-products-full-width {
        margin-top: 30px;
        padding: 30px 0;
    }
    
    .related-products-slider {
        gap: 10px;
    }
    
    .slider-arrow {
        width: 35px;
        height: 35px;
    }
    
    .slider-arrow svg {
        width: 20px;
        height: 11px;
    }
    
    .related-products {
        gap: 20px;
    }
    
    .related-product {
        width: 150px; /* Фиксированная ширина для маленьких экранов */
        flex-shrink: 0;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .related-products-container h2 {
        text-align: center;
        width: 100%;
    }
    
    .related-product-image {
        width: 120px;
        height: 120px;
        flex-shrink: 0;
        padding: 6px;
    }
    
    .related-product-info {
        text-align: center;
    }
    
    .related-product-info h4 {
        text-align: center;
        font-size: 11px;
    }
    
    .related-product-info p {
        text-align: center;
        font-size: 10px;
    }
    
    .related-product-info .weight {
        text-align: center;
        display: block;
    }
    
    .product-title h1 {
        font-size: 18px;
    }
    
    .buy-section {
        margin-top: 20px;
        padding: 15px 12px;
    }
    
    .buy-section .buy-title {
        font-size: 16px;
        margin-bottom: 18px;
    }
    
    .buy-section .buy-columns {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .buy-section .market-logo.market-card {
        min-width: 100%;
        max-width: 100%;
        padding: 12px 15px;
        min-height: 60px;
    }
    
    .buy-section .ozon-logo-text {
        font-size: 18px;
    }
    
    .buy-section .wb-logo-text {
        font-size: 18px;
    }
    
    .buy-section .gold-apple-logo-img {
        height: 35px;
    }
    
    .composition-text {
        max-height: 170px;
    }
    
    .ingredients-grid {
        grid-template-columns: 1fr;
        align-items: center;
        gap: 15px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .ingredient-card {
        gap: 10px;
        align-items: center;
        text-align: center;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .ingredient-card .ingredient-image {
        width: 120px;
        height: 120px;
    }
    
    .ingredient-card .ingredient-info {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .ingredient-card .ingredient-info h3 {
        font-size: 14px !important;
        word-break: normal;
        overflow-wrap: normal;
        white-space: normal;
    }
    
    .ingredient-card .ingredient-info p {
        font-size: 12px !important;
        word-break: normal;
        overflow-wrap: normal;
        white-space: normal;
    }
    
    .properties-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .property-card {
        padding: 12px;
        gap: 8px;
    }
    
    .property-card .property-icon {
        font-size: 20px;
    }
    
    .property-card h3 {
        font-size: 12px;
    }
    
    .property-card p {
        font-size: 11px;
    }
}

/* Animation for tab switching */
.tab-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover effects for related products */
.related-product {
    transition: transform 0.3s ease;
    cursor: pointer;
}

.related-product:hover {
    transform: translateY(-5px);
}

.related-product:hover .related-product-image {
    filter: brightness(1.1);
}

/* Logo link styles */
.logo a {
    display: block;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.logo a:hover {
    opacity: 0.8;
}

/* Loading state for images */
.product-main-image,
.related-product-image,
.ingredient-image {
    transition: opacity 0.3s ease;
}

.product-main-image.loading,
.related-product-image.loading,
.ingredient-image.loading {
    opacity: 0.5;
}


/* Доп стили */

/* Гарантируем, что родительский контейнер тоже ограничивает содержимое */
.section-content {
    display: none;
    margin-top: 20px;
    min-height: 200px;
    max-width: 100%;
    width: 100%;
    overflow: hidden; /* Добавляем это */
    box-sizing: border-box;
}

.section-content.active {
    display: block;
    max-width: 100%;
    overflow: hidden;
}

.section-content#ingredients {
    overflow: hidden; /* Скрываем выходящий контент */
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.section-content#properties {
    overflow: visible; /* Для свойств тоже делаем видимым, чтобы контент не обрезался */
    max-width: 100%;
}

/* Обновлённые стили для .ingredient-info в product-styles.css */
.ingredient-info {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: visible !important; /* Меняем с hidden на visible */
    padding: 5px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Центрируем содержимое */
    text-align: center;
}

.ingredient-info h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 16px !important; /* Увеличиваем размер шрифта */
    line-height: 1.3;
    letter-spacing: -0.015em;
    color: #005CB9;
    margin: 0 0 8px 0;
    /* word-wrap: break-word;
    overflow-wrap: break-word; */
    max-width: 100%;
    text-align: center;
}

.ingredient-info p {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 14px !important; /* Увеличиваем размер шрифта */
    line-height: 1.4; /* Увеличиваем межстрочный интервал */
    letter-spacing: -0.015em;
    color: #797979;
    margin: 0;
    /* word-wrap: break-word;
    overflow-wrap: break-word; */
    max-width: 100%;
    text-align: center;
}

/* Очень маленькие экраны (< 290px) */
@media (max-width: 290px) {
    .container {
        padding: 0 5px;
    }
    
    .product-page {
        padding: 10px 0;
    }
    
    .breadcrumb {
        margin-bottom: 15px;
    }
    
    .breadcrumb-link {
        font-size: 11px;
        gap: 5px;
    }
    
    .breadcrumb-link svg {
        width: 20px;
        height: 11px;
    }
    
    .product-image-container {
        padding: 10px;
        min-height: 200px;
    }
    
    .product-main-image {
        max-height: 200px;
    }
    
    .product-image-container .slider-btn {
        width: 30px;
        height: 30px;
    }
    
    .product-image-container .slider-btn img {
        width: 15px;
        height: auto;
    }
    
    .product-image-container .slider-btn-prev {
        left: 2px;
    }
    
    .product-image-container .slider-btn-next {
        right: 2px;
    }
    
    .product-gallery {
        gap: 5px;
        padding: 0 5px;
    }
    
    .gallery-thumbnail {
        width: 45px;
        height: 45px;
        padding: 2px;
    }
    
    .product-info-section {
        padding: 10px 5px;
        gap: 15px;
    }
    
    .product-title h1 {
        font-size: 14px;
        line-height: 1.2;
    }
    
    .product-description p {
        font-size: 10px;
    }
    
    .product-sections {
        gap: 3px;
        margin: 10px 0;
    }
    
    .section-button {
        font-size: 9px;
        padding: 6px 8px;
    }
    
    .composition-text {
        max-height: 150px;
    }
    
    .composition-text p {
        font-size: 10px;
    }
    
    .ingredient-card .ingredient-image {
        width: 100px;
        height: 100px;
    }
    
    .ingredient-card .ingredient-info h3 {
        font-size: 12px !important;
    }
    
    .ingredient-card .ingredient-info p {
        font-size: 10px !important;
    }
    
    .property-card {
        padding: 8px;
    }
    
    .property-card p {
        font-size: 10px;
    }
    
    .buy-section {
        padding: 10px 8px;
        margin-top: 15px;
    }
    
    .buy-section .buy-title {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .buy-section .market-logo.market-card {
        padding: 8px 10px;
        min-height: 45px;
    }
    
    .buy-section .ozon-logo-text {
        font-size: 14px;
    }
    
    .buy-section .wb-logo-text {
        font-size: 14px;
    }
    
    .buy-section .gold-apple-logo-img {
        height: 25px;
    }
    
    /* Карусель "Другие товары" */
    .related-products-full-width {
        padding: 20px 0;
        margin-top: 20px;
    }
    
    .related-products-container h2 {
        font-size: 14px;
        text-align: center;
        width: 100%;
    }
    
    .related-products-slider {
        gap: 5px;
    }
    
    .slider-arrow {
        width: 25px;
        height: 25px;
    }
    
    .slider-arrow svg {
        width: 15px;
        height: 8px;
    }
    
    .related-products {
        gap: 10px;
    }
    
    .related-product-image {
        width: 100px;
        height: 100px;
        padding: 5px;
    }
    
    .related-product-info {
        text-align: center;
    }
    
    .related-product-info h4 {
        font-size: 10px;
        text-align: center;
    }
    
    .related-product-info p {
        font-size: 9px;
        text-align: center;
    }
    
    .related-product-info .weight {
        font-size: 8px;
        text-align: center;
        display: block;
    }
}