/* ===== PRODUCT DETAIL PAGE ===== */
.pd-wrap { background:#f0f0f0; padding:12px 0 24px; min-height:80vh; }
.pd-grid {
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    gap: 12px;
    align-items: start;
    margin-bottom: 12px;
}

/* Left: image */
.pd-img-panel {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.pd-main-img {
    background: #f5f5f5;
    border-radius: 8px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 12px;
}
.pd-main-img img { max-height: 100%; max-width: 100%; object-fit: contain; padding: 12px; }
.pd-main-img .emoji { font-size: 110px; }
.pd-promo-badges {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.pd-badge-item {
    background: #fff8f8;
    border: 1px solid #fde;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 11.5px;
    text-align: center;
    line-height: 1.4;
}
.pd-badge-item strong { display: block; font-size: 12px; color: #333; }
.pd-badge-item span { color: #888; font-size: 11px; }

/* Center: info */
.pd-info-panel {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.pd-brand-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pd-brand-icon { font-size: 18px; }
.pd-brand-name { font-size: 12px; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: .5px; }
.pd-title { font-size: 20px; font-weight: 800; color: #1a1a1a; line-height: 1.3; margin-bottom: 10px; }
.pd-rating-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #888;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f0f0;
}
.pd-stars { color: #f5a623; font-size: 15px; letter-spacing: 1px; }
.pd-price-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.pd-price { font-size: 28px; font-weight: 800; color: var(--price); }
.pd-old-price { font-size: 15px; color: #aaa; text-decoration: line-through; }
.pd-saving {
    background: var(--coral-tint);
    color: var(--coral-dark);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
}
.pd-stock { font-size: 13px; margin-bottom: 16px; }

/* Specs table */
.pd-specs-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pd-specs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pd-specs-table tr:nth-child(odd) td { background: #fafafa; }
.pd-specs-table td { padding: 7px 10px; border: 1px solid #eee; }
.pd-specs-table td:first-child { font-weight: 600; color: #555; width: 38%; }

/* Right: buy panel */
.pd-buy-panel {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    position: sticky;
    top: 80px;
}
.pd-buy-price { font-size: 24px; font-weight: 800; color: var(--price); margin-bottom: 4px; }
.pd-buy-old { font-size: 13px; color: #aaa; text-decoration: line-through; margin-bottom: 12px; }
/* Bo chon tuy chon: Phien ban (dung luong) / Mau sac - kieu the giong CellphoneS */
.pd-opt-label { font-size: 13px; font-weight: 700; color: #333; margin-bottom: 9px; }

/* Phien ban / dung luong */
.pd-ver-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.pd-ver-box {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 9px 6px; border: 1.5px solid #e0e0e0; border-radius: 8px; background: #fff;
    cursor: pointer; font-family: inherit; transition: all .15s; overflow: hidden;
}
.pd-ver-box:hover { border-color: #f5233a; }
.pd-ver-name { font-size: 13px; font-weight: 800; color: #1a1a1a; }

/* Mau sac */
.pd-color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.pd-color-box {
    position: relative; display: flex; align-items: center; gap: 9px; text-align: left;
    padding: 9px 11px; border: 1.5px solid #e0e0e0; border-radius: 8px; background: #fff;
    cursor: pointer; font-family: inherit; transition: all .15s; overflow: hidden;
}
.pd-color-box:hover { border-color: #f5233a; }
.pd-color-dot { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(0,0,0,.18); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.pd-color-name { font-size: 12.5px; font-weight: 700; color: #1a1a1a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Trang thai duoc chon: vien teal + goc check */
.pd-ver-box.active, .pd-color-box.active { border-color: #f5233a; background: #f0faf9; }
.pd-ver-box.active::after, .pd-color-box.active::after {
    content: ''; position: absolute; top: 0; right: 0;
    border-style: solid; border-width: 0 20px 20px 0;
    border-color: transparent #f5233a transparent transparent;
}
.pd-ver-box.active::before, .pd-color-box.active::before {
    content: '✓'; position: absolute; top: 0; right: 2px; z-index: 1;
    font-size: 9px; font-weight: 800; color: #fff; line-height: 13px;
}
.pd-qty-label { font-size: 12px; font-weight: 700; color: #555; margin-bottom: 6px; text-transform: uppercase; }
.pd-qty-row { display: flex; align-items: center; gap: 0; margin-bottom: 14px; border: 1.5px solid #e0e0e0; border-radius: 6px; overflow: hidden; width: fit-content; }
.pd-qty-btn { width: 34px; height: 34px; border: none; background: #f5f5f5; font-size: 18px; cursor: pointer; transition: background .15s; display: flex; align-items: center; justify-content: center; color: #333; }
.pd-qty-btn:hover { background: #e8e8e8; }
.pd-qty-num { width: 44px; height: 34px; text-align: center; border: none; border-left: 1.5px solid #e0e0e0; border-right: 1.5px solid #e0e0e0; font-size: 15px; font-weight: 700; outline: none; }
.btn-pd-cart {
    display: block; width: 100%;
    background: var(--cart-grad); color: white;
    border: none; border-radius: 50px; padding: 13px;
    font-size: 14px; font-weight: 700; cursor: pointer;
    margin-bottom: 8px; transition: filter .2s, transform .2s;
}
.btn-pd-cart:hover { filter: brightness(1.07); }
.btn-pd-buy {
    display: block; width: 100%;
    background: var(--coral-grad); color: white;
    border: none; border-radius: 50px; padding: 13px;
    font-size: 14px; font-weight: 700; cursor: pointer;
    transition: filter .2s, transform .2s;
}
.btn-pd-buy:hover { filter: brightness(1.06); }
.pd-guarantee {
    margin-top: 14px;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.pd-guar-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #555; }
.pd-guar-item .gi { font-size: 16px; }

/* Reviews */
.pd-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    margin-bottom: 12px;
}
.pd-section-title {
    font-size: 16px; font-weight: 800;
    color: #f5233a;
    border-bottom: 2px solid #f5233a;
    padding-bottom: 10px; margin-bottom: 16px;
}
.review-item {
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
}
.review-item:last-child { border-bottom: none; }
.review-avatar {
    width: 38px; height: 38px;
    background: #f5233a; color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700;
    flex-shrink: 0;
}
.review-author { font-size: 13px; font-weight: 700; color: #333; margin-bottom: 2px; }
.review-stars { color: #f5a623; font-size: 13px; margin-bottom: 4px; }
.review-text { font-size: 13px; color: #555; line-height: 1.6; }
.review-date { font-size: 11px; color: #aaa; margin-top: 4px; }
.review-form label { font-size: 13px; font-weight: 600; color: #555; display: block; margin-bottom: 5px; }
.review-form select,
.review-form textarea { width: 100%; padding: 10px 12px; border: 1.5px solid #e0e0e0; border-radius: 6px; font-family: inherit; font-size: 13px; outline: none; margin-bottom: 10px; }
.review-form select:focus,
.review-form textarea:focus { border-color: #f5233a; }
.review-form textarea { resize: vertical; min-height: 80px; }

/* Related */
.related-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; }

@media(max-width:900px){
    .pd-grid { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: repeat(3,1fr); }
}

/* ===== ZOOM ANH SAN PHAM (theo con tro, desktop) ===== */
.pd-main-img { overflow: hidden; }
.pd-main-img.zoomable { cursor: zoom-in; }
.pd-main-img img { transition: transform .3s ease; will-change: transform; }

/* ===== THANH MUA CO DINH TREN MOBILE ===== */
.pd-mobile-bar { display: none; }
@media(max-width:768px){
    .pd-mobile-bar {
        display: flex; align-items: center; gap: 8px;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 9000;
        background: #fff; border-top: 1px solid #eee;
        padding: 9px 12px; box-shadow: 0 -4px 16px rgba(0,0,0,.1);
    }
    .pmb-price { font-size: 17px; font-weight: 800; color: var(--price); white-space: nowrap; }
    .pmb-btn { border: none; border-radius: 50px; padding: 12px 14px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; white-space: nowrap; color: #fff; }
    .pmb-cart { background: var(--cart-grad); flex-shrink: 0; }
    .pmb-buy { background: var(--coral-grad); flex: 1; }
    body { padding-bottom: 66px; }   /* chua noi dung khong bi thanh che */
}
