body {
    font-family: 'Inter', sans-serif;
}

.product-detail-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(to bottom right, #ffffff, #f6f6f6);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.product-detail {
    display: flex;
    flex-direction: row;
    gap: 40px;
    width: 100%;
    box-sizing: border-box;
}

.product-photos {
    display: flex;
    flex-direction: row;
    gap: 20px;
    position: relative;
    box-sizing: border-box;
    flex: 1;
}

.main-photo-container { 
    flex: 3;
    position: relative;
    background: #f9f9f9;
    border-radius: 12px;
    overflow: hidden;
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #ddd;
    display: block !important; /* Убедитесь, что display не переопределяется медиа-запросами */
}

.main-photo-container:hover {
    transform: scale(1.01);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.main-photo-container img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.part-id {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(231, 76, 60, 0.9);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.dimension-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0,0,0,0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Thumbnails Container with Up and Down Buttons */
.thumbnails-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
    position: relative;
    height: 100%;
}


#photo-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    height: 500px; /* или 5 * 80 */
    overflow: hidden;
    position: relative;
}

.thumbnail-item {
    width: 100%;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid #ddd;
    flex-shrink: 0;
    box-sizing: border-box;
}

.thumbnail-item:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Up and Down Buttons */
.thumb-btn {
    background: #34495e;
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    margin: 5px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background-color 0.3s ease;
}

.thumb-btn:hover {
    background: #2c3e50;
}

/* Hide buttons if not needed */
.thumb-btn.hidden {
    display: none;
}

.product-info-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-sizing: border-box;
    background: #ffffffcc;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    flex: 1;
}

.product-info-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
}

.product-info-left h2 {
    font-size: 28px;
    margin: 0;
    color: #333;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.product-info-left p {
    margin: 0;
    font-size: 15px;
    color: #555;
    line-height: 1.5;
}

.product-info-left .producer,
.product-info-left .view-code,
.product-info-left .oem-code,
.product-info-left .dimensions,
.product-info-left .reserved {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.product-info-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
    box-sizing: border-box;
}

.product-info-right .quality {
    font-size: 14px;
    color: #666;
}

.product-info-right .price {
    font-size: 24px;
    font-weight: bold;
    color: rgba(231, 76, 60, 0.9);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.product-info-right .button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.product-info-right button {
    padding: 10px 16px;
    background-color: rgba(231, 76, 60, 0.9);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    transition: background-color 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.product-info-right button:hover {
    background-color: rgba(206, 68, 53, 0.9);
}

.vehicle-info-section {
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
    font-size: 14px;
    color: #333;
    letter-spacing: 0.5px;
}

#vehicle-info-row {
    flex-direction: column;
    gap: 20px;
    box-sizing: border-box;
    background: #ffffffcc;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    flex: 1;
}

.auto-photos {
    width: 100% !important;
    gap: 5px;
    box-sizing: border-box;
    background: none;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
    align-items: flex-start;
    justify-content: flex-start;
    scrollbar-width: none;
}

.auto-photo-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #eee;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #ddd;
    min-width: 100px;
    display: inline-block;
    vertical-align: middle;
}

.auto-photo-container:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.auto-photo-container img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

@media (max-width: 900px) {
    .product-detail {
        flex-direction: column;
    }
    .thumbnails-container {
        width: 100%; /* Ширина на 100% родительского контейнера */
    }
    .product-photos {
        flex-direction: column;
    }
    .main-photo-container { 
        flex: none;
        width: 100%;
        margin-bottom: 20px;
    }
    
    #photo-thumbnails {
        flex-direction: row; 
        width: 100%;
        max-height: 100px;
        overflow-x: auto; /* Изменено с hidden на auto */
        overflow-y: hidden; /* Отключаем вертикальную прокрутку */
    }

    .thumbnail-item {
        width: 80px;
        height: 80px;
    }

    .thumb-btn {
        width: 36px;
        height: 36px;
    }

    /* Скрытие скроллбаров для эстетики */
    #photo-thumbnails::-webkit-scrollbar {
        display: none;  /* Chrome, Safari, Opera */
    }
    #photo-thumbnails {
        -ms-overflow-style: none;  /* IE и Edge */
        scrollbar-width: none;     /* Firefox */
    }
}


/* Quality badges */
.quality-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    color: #ffffff;
    font-weight: bold;
    font-size: 10px;
    margin-right: 4px;
    letter-spacing: 0.5px;
}
.quality-a { background-color: #2ecc71; }
.quality-b { background-color: #f39c12; }
.quality-c { background-color: #e74c3c; }

/* Photo popup */
.photo-popup {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.photo-popup-content {
    position: relative;
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    max-width: 99%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease;
    cursor: auto;
}

.photo-popup-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
}

.photo-popup-close {
    position: absolute;
    top: 10px;  
    right: 10px;
    border: none;
    font-size: 24px;
    line-height: 1;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.photo-popup-close:hover {
    background-color: #c0392b;
}

/* Arrows on the sides of photo */
.popup-navigation {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.popup-navigation button {
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    font-size: 30px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-radius: 0;
    pointer-events: all;
}

.popup-navigation button:hover {
    background-color: rgba(0,0,0,0.7);
}

@keyframes fadeIn {
    from {opacity:0; transform: scale(0.95);}
    to {opacity:1; transform: scale(1);}
}

/* Back button */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #34495e;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.3s ease;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
}

.back-button:hover {
    background-color: #2c3e50;
    transform: translateX(-3px);
}

.back-icon {
    fill: #fff;
}

/* Animations for transitions */
.fade-enter {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.3s forwards;
}

.fade-exit {
    opacity: 1;
    transform: translateY(0);
    animation: fadeOutDown 0.3s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* Позиционирование кнопок */
.thumbnails-container .thumb-btn.up {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.thumbnails-container .thumb-btn.down {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}


.thumbnails-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-height: none;
    overflow-y: auto;
    position: relative;
}


.recommendations-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-top: 10px;
}

.recommendations-carousel .swiper-container {
    width: 100%;
    height: 100%;
}

.recommendations-carousel .swiper-wrapper {
    display: flex;
    gap: 10px;
}

.recommendations-carousel .swiper-slide {
    flex: 0 0 auto;
    width: 220px;
    /* Остальные стили карточек */
}

.recommendations-carousel .carousel-container {
    display: flex;
    gap: 10px;
    /* transition: transform 0.3s ease-in-out; */
    scroll-behavior: smooth;
    overflow-x: auto; 
    flex-wrap: nowrap;
}


/* Дополнительно можно скрыть скроллбар, если это необходимо */
.recommendations-carousel .carousel-container::-webkit-scrollbar {
    display: none; /* Для Chrome, Safari и Opera */
}

.recommendations-carousel .carousel-container {
    -ms-overflow-style: none;  /* Для IE и Edge */
    scrollbar-width: none;     /* Для Firefox */
}

.recommendations-carousel .card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 0 0 auto;
    width: 220px;
    min-height: 450px;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    box-sizing: border-box;
    background-color: #fff;
    cursor: pointer;
    transition: box-shadow 0.3s;
    font-weight: bold;
    position: relative;
    margin: 0px;
}

.recommendations-carousel .card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.recommendations-carousel img {
    width: 100%;
    height: auto;
    border-radius: 3px;
}

.recommendations-carousel .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 10px;
}

.recommendations-carousel .card-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.recommendations-carousel .details-right {
    display: flex;
    flex-direction: column;
    margin-top: auto; /* Отодвигает содержимое вверх */
    gap: 10px;
}


.recommendations-carousel .add-to-cart-btn {
    align-self: stretch;
    padding: 10px;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}


.recommendations-carousel .carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: background-color 0.3s;
}

.recommendations-carousel .carousel-arrow:hover {
    background-color: rgba(255, 255, 255, 1);
}

.recommendations-carousel .carousel-arrow.left {
    left: 10px;
}

.recommendations-carousel .carousel-arrow.right {
    right: 10px;
}

.recommendations-carousel .carousel-arrow.hidden {
    display: none;
}

.recommendations-header {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    color: #333;
}

/* Стили для стрелок карусели авто-фото на мобильных */
.auto-photos-left,
.auto-photos-right {
    display: none !important;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: background-color 0.3s;
}

@media (max-width: 900px) {
    .auto-photos {
        flex-direction: row;
        overflow-x: scroll;
        scroll-behavior: smooth;
        gap: 10px;
        position: relative;
    }

    .auto-photo-container {
        flex: 0 0 auto;
        width: 30%;
    }

    /* Скрытие стандартных скроллбаров */
    .auto-photos::-webkit-scrollbar {
        display: none;
    }
    .auto-photos {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

