/* =========================================================
   BẢO HÂN KIDS - CHI TIẾT SẢN PHẨM (CHUẨN RESPONSIVE TOÀN DIỆN)
   ========================================================= */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    overflow-x: hidden !important;
    width: 100%;
}

.product-detail-layout {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 16px;
    box-sizing: border-box;
    overflow-x: hidden;
}

.breadcrumb {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 18px;
    padding: 0 4px;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}
.breadcrumb::-webkit-scrollbar {
    display: none;
}
.breadcrumb a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s ease;
}
.breadcrumb a:hover {
    color: #ff5277;
}
.breadcrumb span {
    color: #0c0a09;
    font-weight: 600;
}

/* ================= KHUNG TRÊN ================= */
.detail-container {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 32px;
    background: #ffffff;
    border-radius: 24px;
    padding: 28px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    margin-bottom: 28px;
    width: 100%;
}

/* GALLERY: Dãy 5 ô nằm dọc bên trái ảnh chính */
.product-gallery {
    display: flex;
    flex-direction: row-reverse;
    gap: 12px;
    align-items: flex-start;
    width: 100%;
}

.main-image-wrap {
    flex: 1;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    overflow: hidden;
    background: #f1f5f9; /* Màu nền xám nhẹ để không bị chớp trắng */
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.detail-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.25s ease-in-out;
}

.gallery-thumbs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 72px;
    flex-shrink: 0;
}
.thumb-item {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 2px;
}
.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}
.thumb-item:hover {
    border-color: #ffb3c1;
}
.thumb-item.active {
    border-color: #ff5277;
    box-shadow: 0 2px 6px rgba(255, 82, 119, 0.25);
}

/* THÔNG TIN SẢN PHẨM */
.product-summary {
    min-width: 0;
}

.detail-title {
    font-size: 22px;
    font-weight: 600;
    color: #0c0a09;
    line-height: 1.4;
    margin-bottom: 14px;
    word-break: break-word;
}

.detail-price-box {
    background: #fff0f3;
    border: 1.5px solid #fecdd3;
    padding: 12px 18px;
    border-radius: 14px;
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 18px;
}
.price-label {
    font-size: 13px;
    font-weight: 600;
    color: #881337;
}
.detail-current-price {
    font-size: 26px;
    font-weight: 600;
    color: #ff5277;
    letter-spacing: -0.5px;
}

.short-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
    margin-bottom: 18px;
}

.product-commitments {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 20px;
}
.commit-item {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}
.commit-item span {
    color: #059669;
    font-weight: 600;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}
.btn-buy-now, .btn-add-cart-outline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 48px;
    border-radius: 24px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-buy-now {
    background: linear-gradient(135deg, #ff5277 0%, #ff758c 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 12px rgba(255, 82, 119, 0.3);
}
.btn-buy-now:hover {
    transform: translateY(-2px);
}
.btn-add-cart-outline {
    background: #ffffff;
    color: #ff5277;
    border: 1.5px solid #ff5277;
}
.btn-add-cart-outline:hover {
    background: #fff0f3;
}

.hotline-consult {
    font-size: 13px;
    color: #64748b;
    text-align: center;
}
.hotline-consult a {
    color: #ff5277;
    font-weight: 600;
    text-decoration: none;
}

/* ================= BỐ CỤC 2 CỘT PHÍA DƯỚI ================= */
.product-content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 28px;
    align-items: start;
    width: 100%;
}

/* KHỐI TABS VỚI THANH CUỘN VUỐT TRƯỢT NGANG */
.tabs-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 24px 28px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

/* Thanh điều hướng Tab: Hỗ trợ vuốt trượt ngang trên Mobile */
.tabs-nav-header {
    display: flex;
    flex-wrap: nowrap; /* Không xuống dòng */
    gap: 10px;
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 22px;
    overflow-x: auto; /* Cho phép vuốt ngang */
    -webkit-overflow-scrolling: touch; /* Vuốt mượt trên iOS */
    padding-bottom: 8px;
    scrollbar-width: none; /* Ẩn scrollbar Firefox */
}
.tabs-nav-header::-webkit-scrollbar {
    display: none; /* Ẩn scrollbar Chrome/Safari */
}

.tab-btn {
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    white-space: nowrap; /* Giữ chữ trên 1 dòng */
    flex-shrink: 0;      /* Không bị bóp méo khi vuốt ngang */
    transition: all 0.2s ease;
}
.tab-btn:hover {
    color: #ff5277;
    background: #fff0f3;
}
.tab-btn.active {
    color: #ff5277;
    background: #fff0f3;
}
.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    background: #ff5277;
    border-radius: 3px;
}

.tab-pane {
    display: none;
    width: 100%;
}
.tab-pane.active {
    display: block;
}

.tab-desc-content {
    font-size: 15px;
    line-height: 1.8;
    color: #334155;
    word-break: break-word;
}
.tab-desc-content p {
    margin-bottom: 14px;
}
.tab-desc-content strong {
    color: #0c0a09;
    font-weight: 600;
}
.tab-desc-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 14px;
    margin: 12px 0;
    display: block;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
.specs-table tr:nth-child(even) {
    background: #f8fafc;
}
.specs-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid #e2e8f0;
}
.specs-table td:first-child {
    width: 35%;
    font-weight: 600;
    color: #475569;
}

.review-score-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 20px;
}
.score-big {
    font-size: 32px;
    font-weight: 600;
    color: #ea580c;
    line-height: 1;
}

.review-item-card {
    border-bottom: 1px solid #f1f5f9;
    padding: 14px 0;
}
.review-item-card:last-child {
    border-bottom: none;
}
.reviewer-name {
    font-weight: 600;
    color: #0c0a09;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.verified-buyer {
    font-size: 11px;
    color: #059669;
    background: #ecfdf5;
    padding: 2px 6px;
    border-radius: 8px;
}

.guide-step-card {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
    background: #f8fafc;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
}
.guide-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ff5277;
    color: #ffffff;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
}
.guide-step-text strong {
    display: block;
    font-size: 14px;
    color: #0c0a09;
    margin-bottom: 2px;
}
.guide-step-text p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

/* CỘT PHẢI */
.product-sidebar-wrap {
    min-width: 0;
    width: 100%;
}

.sidebar-widget {
    background: #ffffff;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}
.widget-title {
    font-size: 15px;
    font-weight: 600;
    color: #0c0a09;
    margin-bottom: 14px;
}
.policy-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.policy-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.policy-icon {
    width: 32px;
    height: 32px;
    background: #fff0f3;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.policy-text strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #0c0a09;
}
.policy-text span {
    font-size: 12px;
    color: #64748b;
}

.support-banner {
    background: linear-gradient(135deg, #fff0f3 0%, #fff7ed 100%);
    border: 1px dashed #ff758c;
    border-radius: 18px;
    padding: 18px;
    text-align: center;
    width: 100%;
}
.support-banner h4 {
    font-size: 14px;
    font-weight: 600;
    color: #9f1239;
    margin-bottom: 4px;
}
.support-banner p {
    font-size: 12px;
    color: #475569;
    margin-bottom: 10px;
}
.btn-zalo-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #ff5277;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    max-width: 100%;
}

/* ========================================================
   RESPONSIVE TOÀN DIỆN CHO IPAD & MOBILE (CHỐNG TRÀN MÉP 100%)
   ======================================================== */
@media (max-width: 1024px) {
    .detail-container {
        grid-template-columns: 1fr;
        gap: 22px;
        padding: 20px;
    }
    .product-content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .product-detail-layout {
        padding: 0 0 40px 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .breadcrumb {
        padding: 10px 14px;
        margin-bottom: 0;
        font-size: 13px;
    }
    .detail-container {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        padding: 14px !important;
        margin-bottom: 12px;
    }
    .product-gallery {
        flex-direction: column !important; /* Trên mobile xếp ảnh lớn trước, gallery sau */
        gap: 10px;
    }
    .gallery-thumbs-list {
        flex-direction: row !important; /* Dãy ô nhỏ vuốt ngang */
        width: 100% !important;
        overflow-x: auto;
        gap: 8px;
        scrollbar-width: none;
    }
    .gallery-thumbs-list::-webkit-scrollbar {
        display: none;
    }
    .thumb-item {
        width: 60px !important;
        flex-shrink: 0;
    }
    .detail-title {
        font-size: 18px;
        margin-top: 10px;
    }
    .action-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .tabs-card {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        padding: 16px 14px !important;
    }
    .sidebar-widget, .support-banner {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }
    .btn-zalo-contact {
        width: 100%; /* Tràn đều nút Zalo không bị lẹm */
    }
}
