/* ============================================================
   THỜI THANH BÌNH — 2026 redesign per docs/260522 spec
   ============================================================ */

/* ---------- Mega-menu icon grid (slide 2) ---------- */
.mainMenu .subSanPham {
    background: #fff;
    border-top: 3px solid #0171b7;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 24px 0;
}
.mainMenu .subSanPham .container { padding: 0 24px; }
.megaIconGrid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 16px;
}
.megaIconGrid .megaTile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 8px;
    border-radius: 8px;
    transition: background .15s, transform .15s;
    text-decoration: none;
    color: #333;
    min-height: 110px;
}
.megaIconGrid .megaTile:hover {
    background: #eaf6ff;
    transform: translateY(-2px);
    color: #0171b7;
}
.megaIconGrid .megaTile img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    margin-bottom: 8px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.06));
}
.megaIconGrid .megaTile .megaLbl {
    font-size: 12px;
    line-height: 1.3;
    font-weight: 500;
}
@media (max-width: 1199px) { .megaIconGrid { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 991px)  { .megaIconGrid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- 3-level accordion sidebar (slide 3) ---------- */
.mac_menu .mac_submenu li > .mac_sub_menu_item.has-children { position: relative; padding-right: 24px; }
.mac_menu .mac_sub_menu_item.has-children::after {
    content: '\f105';
    font-family: FontAwesome;
    position: absolute;
    right: 8px; top: 50%;
    transform: translateY(-50%);
    transition: transform .2s;
    color: #0171b7;
}
.mac_menu .mac_sub_menu_item.has-children.open::after { transform: translateY(-50%) rotate(90deg); }
.mac_menu .mac_sub_sub_menu {
    list-style: none;
    padding: 4px 0 4px 22px;
    margin: 0;
    display: none;
    border-left: 1px dashed #0171b7;
    margin-left: 38px;
}
.mac_menu .mac_sub_sub_menu.open { display: block; }
.mac_menu .mac_sub_sub_menu li a {
    font-size: 11.5px; font-weight: 400; color: #555;
    display: block; padding: 4px 0;
}
.mac_menu .mac_sub_sub_menu li a:hover { color: #0171b7; }
.mac_menu .mac_sub_menu_item { cursor: pointer; }

/* ---------- Product detail — video, gallery, buy popup (slides 4-6) ---------- */
.productMediaTabs {
    display: flex; gap: 8px;
    border-bottom: 2px solid #e6e6e6;
    margin-bottom: 16px;
}
.productMediaTabs .ptab {
    padding: 8px 16px;
    cursor: pointer;
    background: #f5f5f5;
    border-radius: 4px 4px 0 0;
    font-weight: 500;
    font-size: 13px;
}
.productMediaTabs .ptab.active { background: #0171b7; color: #fff; }
.productMediaContent .pmedia { display: none; }
.productMediaContent .pmedia.active { display: block; }
/* 16:9 responsive video frame */
.videoFrame {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}
.videoFrame iframe,
.videoFrame video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}
/* Multi-video sub-tabs (only rendered when 2+ videos exist) */
.videoSubTabs {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 10px;
}
.videoSubTabs .vSubTab {
    padding: 6px 14px;
    background: #f0f4f8;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.videoSubTabs .vSubTab:hover { background: #e2e8f0; }
.videoSubTabs .vSubTab.active {
    background: #0171b7;
    color: #fff;
    border-color: #0171b7;
}
/* Hide non-active video frames in multi-video mode */
.pmedia .videoSubTabs ~ .videoFrame { display: none; }
.pmedia .videoSubTabs ~ .videoFrame.active { display: block; }

.btnMuaNgay {
    display: inline-block;
    padding: 12px 32px;
    border-radius: 6px;
    background: linear-gradient(135deg, #ff6c6c 0%, #ff8a4d 100%);
    color: #fff !important;
    font-weight: 600;
    font-size: 15px;
    border: 0;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255,108,108,.3);
    transition: transform .15s;
    text-decoration: none;
}
.btnMuaNgay:hover { transform: translateY(-1px); color: #fff; }

/* Buy modal */
.buyModalBackdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
}
.buyModalBackdrop.open { display: flex; }
.buyModal {
    background: #fff;
    border-radius: 14px;
    width: min(640px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,.3);
}
.buyModalHead {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}
.buyModalHead h3 { margin: 0; font-size: 17px; color: #0171b7; }
.buyModalHead .closeBtn {
    background: transparent; border: 0; font-size: 22px;
    cursor: pointer; color: #999; line-height: 1;
}
.buyModalBody { padding: 20px; }
.buyModalBody p.helpText { margin: 0 0 14px; font-size: 13px; color: #666; }
/* === e-commerce platform section — illustration is decorative background === */
.platformSection {
    position: relative;
    margin: 4px 0 20px;
    padding: 18px 16px 14px;
    text-align: center;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}
/* Decorative bg illustration sits behind everything, faded */
.platformSection .pBags {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: auto;
    max-height: 130px;
    opacity: .22;
    pointer-events: none;
    z-index: 0;
    object-fit: contain;
}
.platformBanner {
    position: relative;
    z-index: 1;
    margin: 0 0 16px;
    text-align: center;
}
.platformBanner .pTitle {
    line-height: 1.25;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 1.2px;
}
.platformBanner .pTitle strong {
    display: block;
    color: #1a202c;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: 1.4px;
    margin-top: 4px;
}
/* Tile row — flex with center alignment, fixed tile size = clean regardless of 1-4 platforms */
.platformGrid {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin: 0;
}
.platformGrid a {
    flex: 0 0 auto;
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 14px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .04);
    border: 1px solid #f1f5f9;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    overflow: hidden;
    position: relative;
    padding: 10px;
    box-sizing: border-box;
}
.platformGrid a:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, .1), 0 14px 32px rgba(15, 23, 42, .08);
    border-color: #e2e8f0;
}
.platformGrid a img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
/* Fallback tile (rendered only if logo PNG missing) */
.platformGrid a .pFallback {
    position: absolute; inset: 0;
    border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -1px;
    text-transform: uppercase;
}
.platformGrid a.shopee .pFallback { background: linear-gradient(135deg,#ee4d2d 0%,#f76b1c 100%); }
.platformGrid a.tiki   .pFallback { background: linear-gradient(135deg,#1a94ff 0%,#0c63d4 100%); }
.platformGrid a.lazada .pFallback { background: linear-gradient(135deg,#1a0dab 0%,#5b21b6 100%); }
.platformGrid a.sendo  .pFallback { background: linear-gradient(135deg,#e63946 0%,#c11d2d 100%); }
@media (max-width: 480px) {
    .platformSection { padding: 14px 10px 10px; }
    .platformSection .pBags { width: 110px; max-height: 90px; opacity: .18; left: 6px; }
    .platformGrid { gap: 10px; }
    .platformGrid a { width: 68px; height: 68px; padding: 8px; border-radius: 12px; }
    .platformBanner .pTitle { font-size: 10.5px; }
    .platformBanner .pTitle strong { font-size: 14px; }
}

.buyForm .form-control {
    width: 100%; padding: 9px 12px; margin-bottom: 10px;
    border: 1px solid #d9d9d9; border-radius: 5px; font-size: 13px;
}
.buyForm textarea.form-control { min-height: 80px; resize: vertical; }
.buyForm .btnSubmitConsult {
    width: 100%; padding: 11px;
    background: #0171b7; color: #fff;
    border: 0; border-radius: 5px;
    font-weight: 600; cursor: pointer;
}
.buyForm .btnSubmitConsult:hover { background: #015a92; }

/* Reviews */
.reviewSection { margin-top: 24px; }
.reviewSummary {
    display: flex; gap: 24px; align-items: flex-start;
    padding: 16px; background: #f8fafc; border-radius: 8px; margin-bottom: 16px;
}
.reviewScore { font-size: 36px; font-weight: 700; color: #ff9900; line-height: 1; }
.reviewScore small { display: block; font-size: 12px; color: #888; font-weight: 400; margin-top: 4px; }
.reviewBars { flex: 1; }
.reviewBars .barRow { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 4px; }
.reviewBars .barRow .bar { flex: 1; height: 8px; background: #e6e6e6; border-radius: 4px; overflow: hidden; }
.reviewBars .barRow .bar > span { display: block; height: 100%; background: #ffb800; }
.reviewItem { padding: 12px 0; border-bottom: 1px solid #eee; }
.reviewItem .rvName { font-weight: 600; color: #0171b7; }
.reviewItem .rvStars { color: #ffb800; font-size: 13px; }
.reviewItem .rvBody { color: #333; font-size: 13px; margin-top: 4px; }
.reviewItem .rvDate { font-size: 11px; color: #999; }

.reviewForm { margin-top: 16px; padding: 16px; background: #fafafa; border-radius: 8px; }
.reviewForm h4 { margin: 0 0 10px; font-size: 14px; color: #0171b7; }
.reviewForm .starInput { font-size: 22px; color: #ddd; cursor: pointer; }
.reviewForm .starInput.on { color: #ffb800; }
.reviewForm .form-control { width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px; margin-top: 6px; font-size: 13px; }
.reviewForm .btn { background: #0171b7; color: #fff; border: 0; padding: 8px 22px; border-radius: 5px; cursor: pointer; }
