﻿/* --- PHẦN HÌNH ẢNH --- */
.main-image-viewport {
    width: 100%;
    height: 400px;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

#mainImg {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: 0.3s;
}

.thumb-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.thumb-item {
    width: 70px;
    height: 70px;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.2s;
}

    .thumb-item.active {
        border-color: #28a745;
        box-shadow: 0 0 5px rgba(40,167,69,0.5);
    }

.thumb-trigger {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- PHẦN NÚT BẤM --- */
.detail-actions-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 25px;
    width: 100%;
}

.btn-equal {
    flex: 1;
    min-width: 160px;
    height: 48px; /* Ép chiều cao cố định để bằng nhau */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
    text-decoration: none !important;
    color: #fff !important;
    transition: 0.3s;
    border: none;
    cursor: pointer;
}

    .btn-equal i {
        margin-right: 8px;
        font-size: 16px;
    }

.btn-buy {
    background-color: #28a745;
}

    .btn-buy:hover {
        background-color: #218838;
        transform: translateY(-2px);
    }

.btn-add {
    background-color: #f39c12;
}

    .btn-add:hover {
        background-color: #e67e22;
        transform: translateY(-2px);
    }

.btn-login {
    background-color: #388e3c;
}

    .btn-login:hover {
        background-color: #2e7d32;
    }

.btn-back {
    background-color: #f8f9fa;
    color: #333 !important;
    border: 1px solid #ddd !important;
}

    .btn-back:hover {
        background-color: #e2e6ea;
    }
/*LƯỚT SẢN PHẨM */
/* Khung chứa tổng */
.thumb-slider-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 15px;
}

/* Danh sách ảnh nhỏ có thể lướt */
.thumb-list-scrollable {
    display: flex;
    gap: 10px;
    overflow-x: auto; /* Cho phép cuộn ngang */
    scroll-behavior: smooth; /* Cuộn mượt */
    scroll-snap-type: x mandatory; /* Hỗ trợ lướt từng tấm một */
    -webkit-overflow-scrolling: touch;
    padding: 5px 0;
}

    /* Ẩn thanh cuộn (scrollbar) để nhìn cho đẹp */
    .thumb-list-scrollable::-webkit-scrollbar {
        display: none;
    }

.thumb-item {
    flex: 0 0 80px; /* Độ rộng cố định của mỗi ảnh nhỏ */
    height: 80px;
    scroll-snap-align: start; /* Khi dừng lướt sẽ hít vào lề */
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

    .thumb-item.active {
        border-color: #28a745;
    }

/* Nút bấm lướt (Nếu bạn thích lướt bằng chuột) */
.nav-btn {
    background: rgba(0,0,0,0.2);
    border: none;
    color: white;
    padding: 10px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
}

    .nav-btn:hover {
        background: #28a745;
    }