/* CSS cho slider ngang productnb2 với hiệu ứng hover thay đổi kích thước */
.productnb2-main-box {
    position: relative;
    overflow: hidden;
    padding-bottom: 0px; /* Tạo không gian cho tiêu đề hiện khi hover */
}

.slider-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 18px;
}

.slider-controls:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.slider-prev {
    left: 10px;
}

.slider-next {
    right: 10px;
}

.content_flexproduct2 {
    display: flex;
    overflow-x: hidden; /* Ẩn scroll bar, dùng nút điều hướng */
    overflow-y: hidden;
    gap: 20px;
    padding: 20px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    transition: transform 0.3s ease;
    user-select: none; /* Ngăn selection khi kéo */
    cursor: grab;
}

.content_flexproduct2:active {
    cursor: grabbing;
}

.content_flexproduct2::-webkit-scrollbar {
    height: 8px;
}

.content_flexproduct2::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.content_flexproduct2::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.content_flexproduct2::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.product2-item {
    flex: 0 0 auto;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
    /* Không có width/height cố định - để ảnh tự quyết định kích thước */
}

.product2-item:hover {
    transform: translateY(-5px); /* Chỉ nâng lên một chút khi hover */
}

.items_photopec2 {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Không có width/height cố định - để ảnh gốc quyết định kích thước */
}

.items_photopec2:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.photo_spec1,
.photo_spec2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.photo_spec1 {
    opacity: 1;
    transform: scale(1);
    z-index: 2;
}

.photo_spec2 {
    opacity: 0;
    transform: scale(1.05);
    z-index: 1;
}

.product2-item:hover .photo_spec1 {
    opacity: 0;
    transform: scale(0.95);
}

.product2-item:hover .photo_spec2 {
    opacity: 1;
    transform: scale(1);
}

.photo_spec1 img,
.photo_spec2 img {
    display: block;
    max-width: 100%;
    height: auto; /* Giữ nguyên tỷ lệ ảnh gốc */
    /* Loại bỏ object-fit để ảnh hiển thị kích thước gốc */
}

.namespec2 {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 0 0 10px 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 3;
}

.product2-item:hover .namespec2 {
    opacity: 1;
    transform: translateY(0);
}

.namespec2 h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-align: center;
    line-height: 1.4;
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    .slider-controls {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}

@media screen and (max-width: 768px) {
    .productnb2-main-box {
        padding-bottom: 0px;
    }
    
    .content_flexproduct2 {
        gap: 15px;
        padding: 15px 10px;
    }
    
    .slider-controls {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .slider-prev {
        left: 5px;
    }
    
    .slider-next {
        right: 5px;
    }
    
    .namespec2 {
        bottom: -45px;
        padding: 10px;
    }
    
    .namespec2 h3 {
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .productnb2-main-box {
        padding-bottom: 50px;
    }
    
    .content_flexproduct2 {
        gap: 10px;
        padding: 10px 5px;
    }
    
    .slider-controls {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .namespec2 {
        bottom: -35px;
        padding: 8px;
    }
    
    .namespec2 h3 {
        font-size: 12px;
    }
}

@media screen and (max-width: 360px) {
    .content_flexproduct2 {
        gap: 8px;
    }
    
    .namespec2 {
        bottom: -30px;
        padding: 6px;
    }
    
    .namespec2 h3 {
        font-size: 11px;
    }
}
