/* =========================================
   STYLE GỐC (DESKTOP FIRST)
   ========================================= */
body.single-product {
    background-color: #ffffff !important;
}

/* --- BỐ CỤC TỔNG THỂ --- */
.onyx-single-product-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* 2 cột: Ảnh - Thông tin */
    gap: 40px;
    /* Tăng khoảng cách giữa 2 cột cho thoáng */
    font-family: 'Inter', sans-serif;
    padding: 40px 100px 0 100px;
    /* Padding chuẩn PC */
}

/* Thẻ bọc ngoài */
.onyx-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
}

/* --- THƯ VIỆN ẢNH --- */
.onyx-gallery-layout {
    display: flex;
    flex-direction: row;
    /* Thumbnails nằm bên trái/phải */
    gap: 20px;
}

.onyx-main-image {
    flex: 1;
    background-color: #f4f6f8;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 405px;
    /* Chiều cao cố định trên PC */
    padding: 20px;
    border: 1px solid #ebf0f5;
    position: relative;
    overflow: hidden;
}

.onyx-main-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform 0.3s ease;
}

.onyx-thumbnails {
    display: flex;
    flex-direction: column;
    /* Xếp dọc trên PC */
    gap: 15px;
    width: 90px;
    flex-shrink: 0;
    /* Không bị co lại */
}

.onyx-thumb-item {
    width: 100%;
    height: 90px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px;
    background: #fff;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.onyx-thumb-item.active,
.onyx-thumb-item:hover {
    border-color: #f97316;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
}

.onyx-thumb-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* --- THÔNG TIN SẢN PHẨM --- */
.onyx-product-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
    color: #111827;
}

/* Phần Giá */
.onyx-product-price {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 28px;
    font-weight: 800;
    color: #0b192c;
    margin-bottom: 24px;
}

.onyx-product-price del {
    order: 2;
    font-size: 18px;
    color: #9ca3af;
    font-weight: 500;
}

.onyx-product-price ins {
    text-decoration: none;
    order: 1;
}

/* Nút Learn More */
.onyx-btn-learn-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #f97316;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0 40px;
    font-weight: 600;
    font-size: 16px;
    height: 50px;
    width: 100%;
    /* Nút full chiều ngang */
    text-decoration: none;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.onyx-btn-learn-more:hover {
    background-color: #ea580c;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

/* --- RELATED PRODUCTS (PC: 5 CỘT) --- */
.onyx-related-wrapper {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin: 40px 100px !important;
    padding: 30px 40px !important;
    font-family: 'Inter', sans-serif;
}

.onyx-related-header {
    margin-bottom: 25px;
}

.onyx-related-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.onyx-related-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr) !important;
    /* Mặc định 5 cột */
    gap: 20px;
}

.onyx-related-item {
    display: flex;
    flex-direction: column;
    background: transparent;
    border: none !important;
}

.onyx-related-thumb {
display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f4f5f7;
    border-radius: 8px;
}

.onyx-related-thumb a {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    height: 100% !important;
    text-align: center !important; /* Đề phòng theme set text-align: left */
}

.onyx-related-thumb img {
margin: 0 auto !important;
    display: block !important;
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.onyx-related-item:hover .onyx-related-thumb img {
    transform: scale(1.08);
}

.onyx-related-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
    /* Giữ chiều cao đều nhau */
}

.onyx-related-name a {
    color: #111827;
    text-decoration: none;
    transition: 0.2s;
}

.onyx-related-item:hover .onyx-related-name a {
    color: #f97316;
}

.onyx-related-price {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.onyx-related-price ins {
    text-decoration: none;
}


/* =========================================
   RESPONSIVE (TABLET & MOBILE)
   ========================================= */

/* 1. TABLET (Màn hình từ 768px đến 1024px) */
@media (max-width: 1024px) {

    /* Thu hẹp lề hai bên */
    .onyx-single-product-top {
        padding: 30px 40px 0 40px;
        gap: 30px;
    }

    .onyx-related-wrapper {
        margin: 30px 40px !important;
        padding: 25px !important;
    }

    /* Giảm Related xuống 4 cột để không bị bé quá */
    .onyx-related-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .onyx-main-image {
        height: 350px;
    }
}

/* 2. MOBILE & TABLET NHỎ (Dưới 768px) */
@media (max-width: 768px) {

    /* --- Layout chính chuyển sang 1 cột --- */
    .onyx-single-product-top {
        grid-template-columns: 1fr;
        padding: 20px 15px 0 15px;
        gap: 20px;
    }

    .onyx-gallery-layout {
        flex-direction: column;
        /* Xếp dọc */
        gap: 15px;
    }

    .onyx-main-image {
        width: 100%;
        height: auto;
        aspect-ratio: 1/1;
        /* Ảnh vuông */
        padding: 20px;
    }

    /* Hàng Thumbnails nằm ngang và trượt được */
    .onyx-thumbnails {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
        height: auto !important;
        padding: 0 !important;
        overflow: visible !important;
        margin-top: 15px !important;
    }

    .onyx-thumb-item {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
        margin: 0 !important;
        flex-shrink: 1 !important;
    }

    .onyx-thumb-item img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .onyx-related-wrapper {
        margin: 30px 15px !important;
        /* Lề bằng với phần trên */
        padding: 20px 15px !important;
    }

    .onyx-related-title {
        font-size: 18px;
    }

    .onyx-related-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    .onyx-related-item {
        display: flex !important;
        flex-direction: column !important;
        /* Xếp dọc: Ảnh trên - Chữ dưới */
        align-items: flex-start !important;
        /* Căn trái toàn bộ nội dung */
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
    }

    .onyx-related-info {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .onyx-related-thumb {
        width: 100% !important;
        /* Rộng full màn hình */
        aspect-ratio: 1 / 1 !important;
        /* Hình vuông */
        background-color: #f4f6f8 !important;
        /* Nền xám nhạt giống mẫu */
        border-radius: 12px !important;
        /* Bo góc mềm mại */
        margin-bottom: 15px !important;
        /* Cách phần chữ ra */
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .onyx-related-thumb img {
        max-width: 80% !important;
        /* Ảnh sản phẩm nằm gọn bên trong */
        max-height: 80% !important;
        object-fit: contain !important;
        mix-blend-mode: multiply !important;
        /* Hòa trộn nền */
    }

    .onyx-related-name {
        font-size: 16px !important;
        font-weight: 700 !important;
        line-height: 1.4 !important;
        color: #111827 !important;
        margin-bottom: 8px !important;
        display: block !important;
        /* Hiển thị đầy đủ */
        text-align: left !important;
    }

    .onyx-related-name a {
        color: #111827 !important;
        text-decoration: none !important;
    }

    .onyx-related-price {
        font-size: 16px !important;
        font-weight: 700 !important;
        color: #111827 !important;
        /* Màu đen đậm giống mẫu */
        text-align: left !important;
    }

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

    .onyx-product-price {
        font-size: 24px;
    }

}