/* ==========================================================================
   1. RESET TOÀN CỤC & NỀN TẢNG (TRIỆT TIÊU LỖI PHÔNG HỆ THỐNG)
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: #f5f5f5;
    font-family: 'Lato', sans-serif;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

.container {
    width: 1200px;
    max-width: 95%;
    margin: auto;
}

.py-details {
    padding: 20px 0 50px;
}

/* BREADCRUMB */
.breadcrumb {
    font-size: 13px;
    color: #666;
    margin-bottom: 20px;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #ff4d00;
}

.breadcrumb span {
    color: #999;
}

/* CÁC KHỐI HỘP BAO ĐÓNG */
.sub-card-box {
    background: #fff;
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.sub-card-box-clean {
    background: #fff;
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.text-green {
    color: #26a541;
}

.text-red {
    color: #ff424e;
}

/* ==========================================================================
   2. KHỐI CHÍNH (MAIN PRODUCT BOX) - KHUNG ẢNH & THÔNG TIN MUA HÀNG
   ========================================================================== */
.main-product-box {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 35px;
    background: #fff;
    border-radius: 4px;
    padding: 30px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    align-items: stretch;
    /* Cột trái và cột phải luôn bằng chiều cao nhau */
}

/* KHỐI ẢNH BÊN TRÁI */
.product-image-co {
    position: relative;
    width: 450px;
    display: flex;
    flex-direction: column;
}

.product-image-co .img-wrapper {
    width: 100%;
    flex: 1;
    min-height: 450px;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    overflow: hidden;
}

.product-image-co img {
    max-width: 92%;
    max-height: 92%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* NÚT ĐIỀU HƯỚNG SLIDE */
.slide-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: #888;
    border: 1px solid #ddd;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}

.slide-nav-btn:hover {
    background: #ff4d00;
    color: #fff;
    border-color: #ff4d00;
}

.slide-nav-btn.prev {
    left: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.slide-nav-btn.next {
    right: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* THÔNG TIN TEXT BÊN PHẢI */
.product-info-co {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Đẩy cụm nút mua bám chặt đáy hộp */
}

.product-info-co .p-title {
    font-size: 22px;
    font-weight: bold;
    line-height: 1.4;
    color: #222;
    margin-bottom: 10px;
}

.product-info-co .p-rating {
    color: #ff9900;
    font-size: 13px;
    margin-bottom: 15px;
}

.product-info-co .review-count {
    color: #777;
    margin-left: 4px;
}

/* BẢNG GIÁ SẠCH SẼ */
.p-price-card {
    background: #fafafa;
    border-radius: 4px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.p-price-card .sale-price {
    font-size: 30px;
    color: #ff4d00;
    font-weight: bold;
}

.p-price-card .old-price {
    color: #999;
    text-decoration: line-through;
    font-size: 14px;
}

.p-price-card .discount-badge {
    background: #ff4d00;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 2px;
}

/* THÔNG SỐ SẢN PHẨM */
.p-specs-list {
    margin-bottom: 18px;
}

.p-specs-list .spec-item {
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
}

.p-specs-list .spec-item .label {
    color: #757575;
    width: 110px;
    font-weight: bold;
}

.p-short-desc {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 25px;
    border-top: 1px dashed #eee;
    padding-top: 15px;
}

/* KHỐI CHỌN SỐ LƯỢNG */
.p-action-box {
    background: #fff;
    border-top: 1px solid #f0f0f0;
    padding-top: 20px;
}

.qty-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.qty-selector .qty-lbl {
    color: #757575;
}

.qty-counter {
    display: flex;
    border: 1px solid #bdd1d4;
    border-radius: 2px;
    overflow: hidden;
}

.qty-counter .qty-btn {
    width: 32px;
    height: 32px;
    background: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #555;
}

.qty-counter .qty-btn:hover {
    background: #f5f5f5;
}

.qty-counter input {
    width: 50px;
    height: 32px;
    border: none;
    border-left: 1px solid #bdd1d4;
    border-right: 1px solid #bdd1d4;
    text-align: center;
    font-size: 14px;
    outline: none;
}

.qty-selector .stock-hint {
    color: #999;
    font-size: 13px;
}

/* ==========================================================================
   3. GIẢI PHÁP ĐÓNG BĂNG CHIỀU CAO & CANH TÂM NÚT (KHẮC PHỤC TRIỆT ĐỂ LỆCH CHỮ)
   ========================================================================== */
.btn-group {
    display: flex;
    gap: 15px;
}

.btn-add-cart,
.btn-buy-now,
.btn-disabled {
    flex: 1;
    height: 48px !important;
    /* Ép chết chiều cao cố định */
    padding: 0 !important;
    /* Triệt tiêu mọi padding sai lệch của trình duyệt */
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;

    /* Hệ thống canh tâm đa tầng - chống lệch chữ tuyệt đối */
    display: flex !important;
    align-items: center !important;
    /* Căn giữa dọc */
    justify-content: center !important;
    /* Căn giữa ngang */

    line-height: 1 !important;
    /* Khóa chết khoảng cách dòng text */
    vertical-align: middle !important;
    /* Triệt tiêu lỗi baseline cũ */
    text-align: center;
}

.btn-add-cart {
    border: 1px solid #ff4d00 !important;
    background: #fff0ea !important;
    color: #ff4d00 !important;
}

.btn-add-cart:hover {
    background: #ff4d00 !important;
    color: #fff !important;
}

.btn-buy-now {
    border: 1px solid #ff4d00 !important;
    background: #ff4d00 !important;
    color: #fff !important;
}

.btn-buy-now:hover {
    background: #e04400 !important;
    border-color: #e04400 !important;
}

.btn-disabled {
    background: #ccc !important;
    color: #fff !important;
    border: none !important;
    cursor: not-allowed !important;
}

/* ==========================================================================
   4. KHỐI THƯỜNG ĐƯỢC MUA KÈM (COMBO SECTION)
   ========================================================================== */
.combo-section .sub-box-title {
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: #222;
    letter-spacing: 0.3px;
}

.combo-flex-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.combo-node {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 240px;
}

.combo-node .combo-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #ff4d00;
}

.combo-node .node-clickable {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    width: 100%;
    min-width: 0;
}

.combo-node .node-thumb img {
    width: 55px;
    height: 55px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
    background: #fff;
}

.combo-node .node-meta {
    flex: 1;
    min-width: 0;
}

.combo-node .node-name {
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.combo-node .node-price {
    font-size: 13px;
    color: #ff4d00;
    font-weight: bold;
    margin-top: 3px;
}

.combo-sign {
    font-size: 20px;
    color: #bbb;
}

.combo-summary-panel {
    margin-left: auto;
    background: #fff8f5;
    border: 1px dashed #ff4d00;
    border-radius: 4px;
    padding: 16px;
    width: 240px;
    text-align: center;
}

.combo-summary-panel .sum-lbl {
    font-size: 13px;
    color: #666;
}

.combo-summary-panel .sum-price {
    font-size: 22px;
    color: #ff4d00;
    font-weight: bold;
    margin: 4px 0 12px;
}

.combo-summary-panel .btn-combo-submit {
    width: 100%;
    height: 38px;
    background: #ff4d00;
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
}

/* ==========================================================================
   5. BỐ CỤC 2 CỘT PHÍA DƯỚI (NỘI DUNG & PHỄU SIDEBAR)
   ========================================================================== */
.two-columns-layout {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 20px;
    align-items: flex-start;
}

/* CỘT TRÁI - KHỐI TABS */
.tabs-wrapper {
    padding: 0;
    overflow: hidden;
}

.tabs-header {
    display: flex;
    background: #fafafa;
    border-bottom: 1px solid #e0e0e0;
}

.tabs-header .tab-trigger {
    border: none;
    background: none;
    padding: 16px 28px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    outline: none;
    position: relative;
}

.tabs-header .tab-trigger.active {
    color: #ff4d00;
    background: #fff;
    font-weight: bold;
}

.tabs-header .tab-trigger.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #ff4d00;
}

.tabs-body {
    padding: 25px;
}

.tab-pane {
    display: none;
    line-height: 1.7;
    color: #444;
    font-size: 14px;
}

.tab-pane.active {
    display: block;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.specs-table tr td:first-child {
    color: #757575;
    width: 140px;
}

/* SẢN PHẨM TƯƠNG TỰ */
.inner-section-title {
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 18px;
    color: #222;
    border-left: 4px solid #ff4d00;
    padding-left: 10px;
}

.product-horizontal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.p-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}

.p-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.p-card .p-card-thumb img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.p-card .p-card-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.p-card .p-card-name {
    font-size: 13px;
    font-weight: normal;
    line-height: 1.4;
    height: 36px;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #333;
}

.p-card .p-card-price {
    color: #ff4d00;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 12px;
}

.p-card .p-card-btn {
    text-align: center;
    background: #fff;
    border: 1px solid #ff4d00;
    color: #ff4d00;
    text-decoration: none;
    padding: 6px 0;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    display: block;
    margin-top: auto;
    transition: 0.2s;
}

.p-card .p-card-btn:hover {
    background: #ff4d00;
    color: #fff;
}

/* CỘT PHẢI - SIDEBAR GỢI Ý */
.sidebar-sticky-box {
    position: sticky;
    top: 20px;
    padding: 20px;
}

.sidebar-box-title {
    font-size: 15px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #222;
}

.sidebar-product-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.side-p-item {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    align-items: center;
}

.side-p-item .side-p-thumb img {
    width: 65px;
    height: 65px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
}

.side-p-item .side-p-info {
    flex: 1;
    min-width: 0;
}

.side-p-item .side-p-name {
    font-size: 13px;
    font-weight: normal;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

.side-p-item:hover .side-p-name {
    color: #ff4d00;
}

.side-p-item .side-p-price {
    color: #ff4d00;
    font-weight: bold;
    font-size: 14px;
}

/* ==========================================================================
   6. RESPONSIVE CO GIÃN ĐA THIẾT BỊ
   ========================================================================== */
@media(max-width: 991px) {
    .main-product-box {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 20px;
    }

    .product-image-co {
        width: 100%;
        max-width: 100%;
    }

    .product-image-co .img-wrapper {
        min-height: 350px;
    }

    .combo-flex-container {
        flex-direction: column;
        align-items: stretch;
    }

    .combo-node {
        width: 100%;
    }

    .combo-sign {
        text-align: center;
    }

    .combo-summary-panel {
        margin-left: 0;
        width: 100%;
    }

    .two-columns-layout {
        grid-template-columns: 1fr;
    }

    .product-horizontal-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
