/* =====================================================================
   Trang chi tiết sản phẩm — phong cách tối giản (Apple-like)
   Mọi rule đều nằm dưới .pd để không ảnh hưởng trang khác.
   ===================================================================== */
.pd {
    --pd-text: #1d1d1f;
    --pd-muted: #6e6e73;
    --pd-line: #d2d2d7;
    --pd-soft: #f5f5f7;
    --pd-accent: #008001;
    --pd-accent-hover: #006b01;
    --pd-accent-soft: #e8f3e8;
    --pd-sale: #bf4800;
    --pd-radius: 18px;
    color: var(--pd-text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}
.pd [x-cloak] { display: none !important; }

/* ---------------- Hero ---------------- */
.pd-hero {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px 22px 72px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 64px;
    align-items: start;
}
.pd-gallery { position: sticky; top: 96px; }
.pd-gallery, .pd-buy { min-width: 0; }
/* Ảnh tràn hết khung, bo góc; dải ảnh nhỏ nằm ngoài khung */
.pd .fotorama__stage {
    background: var(--pd-soft);
    border-radius: 24px;
    overflow: hidden;
    -webkit-mask-image: -webkit-radial-gradient(white, black); /* giữ bo góc khi fotorama dùng transform */
}
.pd .fotorama__nav-wrap { margin-top: 14px; }
.pd .fotorama__nav--thumbs { text-align: center; }
.pd .fotorama__thumb { background: var(--pd-soft); border-radius: 12px; }
.pd .fotorama__nav__frame--thumb { opacity: .55; transition: opacity .2s; }
.pd .fotorama__nav__frame--thumb.fotorama__active,
.pd .fotorama__nav__frame--thumb:hover { opacity: 1; }
.pd .fotorama__thumb-border {
    border: 2px solid var(--pd-text);
    border-radius: 12px;
    background: none;
}
.pd .fotorama__arr {
    width: 40px; height: 40px; margin-top: -20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .85) none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    opacity: 0; transition: opacity .2s;
}
.pd .fotorama__arr::after {
    content: ""; position: absolute; top: 50%; left: 50%;
    width: 9px; height: 9px;
    border-top: 2px solid var(--pd-text); border-right: 2px solid var(--pd-text);
}
.pd .fotorama__arr--prev { left: 12px; }
.pd .fotorama__arr--next { right: 12px; }
.pd .fotorama__arr--prev::after { transform: translate(-30%, -50%) rotate(-135deg); }
.pd .fotorama__arr--next::after { transform: translate(-70%, -50%) rotate(45deg); }
.pd .fotorama:hover .fotorama__arr { opacity: 1; }
.pd .fotorama__fullscreen-icon {
    top: 10px; right: 10px; border-radius: 50%;
    background-color: rgba(255, 255, 255, .85);
}

/* ---------------- Buy box ---------------- */
.pd-buy { padding-top: 8px; }
.pd-eyebrow {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--pd-sale);
    letter-spacing: 0;
}
.pd-title {
    margin: 0 0 14px;
    font-size: 40px;
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--pd-text);
}
.pd-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    font-size: 14px; color: var(--pd-muted);
    margin-bottom: 24px;
}
.pd-rating { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.pd-rating:hover { color: var(--pd-text); }
.pd-rating .comment-star { font-size: 12px; margin: 0; }
.pd-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--pd-line); }

.pd-price {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px;
    padding-bottom: 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--pd-line);
}
.pd .pd-price .price-new-pro-detail {
    font-size: 28px; font-weight: 600; color: var(--pd-text);
    letter-spacing: -0.02em;
}
.pd .pd-price .price-old-pro-detail {
    font-size: 17px; font-weight: 400; color: var(--pd-muted);
    text-decoration: line-through; padding: 0;
}
.pd .pd-price .price-old-pro-detail:empty { display: none; }

.pd-promo {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 16px 18px; margin-bottom: 28px;
    border-radius: 14px;
    background: #fff7ed;
    color: #7a3e00;
    font-size: 14px; line-height: 1.5;
}
.pd-promo > i { font-size: 18px; margin-top: 2px; color: var(--pd-sale); }
.pd-promo strong { display: block; color: var(--pd-text); font-weight: 600; margin-bottom: 2px; }
.pd-promo img { border-radius: 6px; vertical-align: middle; margin: 0 4px; background: #fff; }

/* ---------------- Mã giảm giá ---------------- */
.pd-coupons {
    margin: -8px 0 28px;
    padding: 14px 0 14px 14px;
    border-radius: 16px;
    background: #eaf6ea;
}
.pd-coupons-head {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px;
    padding-right: 14px; margin-bottom: 10px;
}
.pd-coupons-head span { font-size: 15px; font-weight: 600; color: var(--pd-accent); }
.pd-coupons-head span i { margin-right: 4px; }
.pd-coupons-head small { font-size: 12px; color: var(--pd-muted); }
/* Hàng vé cuộn ngang: bao nhiêu mã cũng gọn, vuốt được trên điện thoại */
.pd-coupon-list {
    display: flex; gap: 10px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    padding: 2px 14px 4px 0;
    scrollbar-width: none;
}
.pd-coupon-list::-webkit-scrollbar { display: none; }
.pd-coupon {
    --notch: #eaf6ea;
    position: relative;
    flex: 0 0 auto; width: 270px; max-width: 82%;
    display: flex; align-items: stretch;
    scroll-snap-align: start;
    background: #fff; border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
    cursor: pointer; outline: none;
    transition: transform .15s, box-shadow .15s;
}
.pd-coupon:hover, .pd-coupon:focus-visible { box-shadow: 0 4px 14px rgba(0, 128, 1, .16); }
.pd-coupon:active { transform: scale(.98); }
.pd-coupon-badge {
    position: relative;
    flex: 0 0 76px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    margin: 8px 0 8px 8px; border-radius: 8px;
    background: linear-gradient(140deg, #ffe3ec, #ffc2d4);
    color: #e0245e; text-align: center; line-height: 1;
}
.pd-coupon-badge small { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; opacity: .85; }
.pd-coupon-badge strong { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.pd-coupon-badge.is-long strong { font-size: 13px; letter-spacing: 0; }
/* Đường răng cưa + 2 khuyết tròn như vé */
.pd-coupon-body {
    position: relative; flex: 1; min-width: 0;
    padding: 10px 12px 10px 14px; margin-left: 8px;
    border-left: 1px dashed #d8e8d8;
}
.pd-coupon-body::before, .pd-coupon-body::after {
    content: ""; position: absolute; left: -6px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--notch);
}
.pd-coupon-body::before { top: -6px; }
.pd-coupon-body::after { bottom: -6px; }
.pd-coupon-offer {
    margin: 0 0 2px; font-size: 15px; font-weight: 600; color: var(--pd-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pd-coupon-cond {
    margin: 0 0 6px; font-size: 12px; color: var(--pd-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pd-coupon-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pd-coupon-code {
    font-size: 14px; font-weight: 700; letter-spacing: .02em; color: #0a84ff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pd .pd-coupon-save {
    flex: none; border: 0; border-radius: 980px;
    padding: 4px 12px; background: var(--pd-accent); color: #fff;
    font-size: 12px; font-weight: 600; cursor: pointer;
}
.pd .pd-coupon-save:hover { background: var(--pd-accent-hover); }
.pd .pd-coupon-save.saved { background: transparent; color: var(--pd-accent); box-shadow: inset 0 0 0 1px var(--pd-accent); }
.pd-coupon-copied {
    position: absolute; inset: 0; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 128, 1, .92); color: #fff; font-size: 14px; font-weight: 600;
    opacity: 0; pointer-events: none; transition: opacity .2s;
}
.pd-coupon.copied .pd-coupon-copied { opacity: 1; }

/* ---------------- Tùy chọn (thuộc tính) ---------------- */
.pd-option { margin-bottom: 28px; }
.pd-option-title {
    margin: 0 0 12px;
    font-size: 17px; font-weight: 600; color: var(--pd-text);
}
.pd-option-title span { font-weight: 400; color: var(--pd-muted); }
.pd .grid-properties {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}
.pd .grid-properties span {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    min-height: 54px; padding: 10px 14px;
    border: 1px solid var(--pd-line);
    border-radius: 12px;
    background: #fff;
    font-size: 15px; font-weight: 400; color: var(--pd-text);
    text-align: center; line-height: 1.3;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.pd .grid-properties span::after { display: none; }
.pd .grid-properties span:hover { border-color: #86868b; font-weight: 400; }
.pd .grid-properties span.active {
    border-color: var(--pd-accent);
    box-shadow: inset 0 0 0 1px var(--pd-accent);
    font-weight: 600;
}
.pd .grid-properties span.outstock {
    color: #b0b0b5; background: var(--pd-soft); border-style: dashed;
    text-decoration: line-through; pointer-events: none;
}

/* ---------------- Số lượng + nút ---------------- */
.pd-actions { margin-bottom: 28px; }
.pd-qty { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.pd-qty label { margin: 0; font-size: 17px; font-weight: 600; }
.pd .quantity-pro-detail {
    display: inline-flex; align-items: center;
    max-width: none; width: auto; margin: 0;
    border: 1px solid var(--pd-line); border-radius: 980px;
    overflow: hidden; background: #fff;
}
.pd .quantity-pro-detail span {
    width: 44px; height: 44px; line-height: 42px;
    border: 0; background: transparent;
    font-size: 20px; color: var(--pd-text);
    user-select: none; transition: background .15s;
}
.pd .quantity-pro-detail span:hover { background: var(--pd-soft); }
.pd .quantity-pro-detail input {
    width: 44px; height: 44px; padding: 0;
    border: 0; outline: none; box-shadow: none;
    font-size: 17px; font-weight: 600; text-align: center;
    background: transparent;
}
.pd-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pd .pd-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 52px; padding: 0 22px; margin: 0;
    border-radius: 980px; border: 0;
    font-size: 17px; font-weight: 500; letter-spacing: -0.01em;
    cursor: pointer; text-decoration: none;
    transition: background-color .2s, transform .1s;
}
.pd .pd-btn:active { transform: scale(.98); }
.pd .pd-btn-primary { background: var(--pd-accent); color: #fff; }
.pd .pd-btn-primary:hover { background: var(--pd-accent-hover); color: #fff; }
.pd .pd-btn-secondary { background: var(--pd-accent-soft); color: var(--pd-accent); }
.pd .pd-btn-secondary:hover { background: #d9ebd9; color: var(--pd-accent-hover); }
.pd .pd-btn i { font-size: 15px; margin: 0; }
.pd-soldout {
    margin-bottom: 28px; padding: 16px; text-align: center;
    border-radius: 14px; background: var(--pd-soft);
    font-size: 17px; font-weight: 600; color: var(--pd-muted);
}

/* ---------------- Cam kết + chia sẻ ---------------- */
.pd-perks {
    list-style: none; margin: 0 0 24px; padding: 6px 20px;
    border-radius: 14px; background: var(--pd-soft);
}
.pd-perks li {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 0; font-size: 14px; color: var(--pd-text);
}
.pd-perks li + li { border-top: 1px solid #e5e5ea; }
.pd-perks img { flex: none; object-fit: contain; }
.pd-share { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 14px; color: var(--pd-muted); }
.pd-share .a2a_kit { display: inline-flex; gap: 4px; }

/* ---------------- Sections bên dưới ---------------- */
.pd-section { padding: 80px 22px; }
.pd-section-alt { background: var(--pd-soft); }
.pd-container { max-width: 820px; margin: 0 auto; }
.pd-container-wide { max-width: 1240px; }
.pd-section-title {
    margin: 0 0 36px;
    font-size: 40px; line-height: 1.1; font-weight: 600;
    letter-spacing: -0.025em; color: var(--pd-text);
}

/* Nội dung soạn từ CKEditor: ép lại typography cho dễ đọc */
.pd-prose { font-size: 17px; line-height: 1.65; color: #333336; overflow-wrap: anywhere; }
.pd-prose h1, .pd-prose h2, .pd-prose h3, .pd-prose h4 {
    margin: 1.6em 0 .6em; color: var(--pd-text);
    font-family: inherit; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25;
    text-transform: none;
}
.pd-prose h1, .pd-prose h2 { font-size: 28px; }
.pd-prose h3 { font-size: 22px; }
.pd-prose h4 { font-size: 19px; }
.pd-prose > :first-child { margin-top: 0; }
.pd-prose p { margin: 0 0 1em; }
.pd-prose * { font-family: inherit !important; }
.pd-prose span, .pd-prose p, .pd-prose li { font-size: inherit !important; line-height: inherit !important; }
.pd-prose ul, .pd-prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.pd-prose li { margin-bottom: .4em; }
.pd-prose a { color: var(--pd-accent); }
.pd-prose img { max-width: 100%; height: auto !important; border-radius: 16px; margin: 12px auto; display: block; }
.pd-prose iframe, .pd-prose video { max-width: 100%; border-radius: 16px; }
.pd-prose table { width: 100% !important; border-collapse: collapse; margin: 0 0 1em; font-size: 15px; }
.pd-prose td, .pd-prose th { padding: 10px 12px; border-bottom: 1px solid var(--pd-line); }

.pd-collapsible { position: relative; }
.pd-collapsible.is-collapsed { max-height: 760px; overflow: hidden; }
.pd-collapsible.is-collapsed::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 160px;
    background: linear-gradient(rgba(255, 255, 255, 0), #fff);
}
.pd-more { text-align: center; margin-top: 24px; }
.pd .pd-link {
    border: 1px solid var(--pd-text); background: transparent; color: var(--pd-text);
    padding: 10px 26px; border-radius: 980px;
    font-size: 15px; font-weight: 500; cursor: pointer; transition: background .2s, color .2s;
}
.pd .pd-link:hover { background: var(--pd-text); color: #fff; }

/* Khối đánh giá (component dùng chung): làm phẳng card bootstrap */
.pd #pd-reviews .card {
    border: 0; border-radius: var(--pd-radius); background: #fff; overflow: hidden;
}
.pd #pd-reviews .card-header { display: none; }
.pd #pd-reviews .comment-point strong { font-size: 48px; font-weight: 600; letter-spacing: -0.03em; color: var(--pd-text); }
.pd #pd-reviews .btn { border-radius: 980px; }

/* Sản phẩm cùng loại */
.pd .flex-product { margin: 0 -10px; }
.pd .pagination { flex-wrap: wrap; justify-content: center; gap: 4px 0; margin-top: 24px; }
.pd .pagination + * , .pd .flex-sm-fill { min-width: 0; max-width: 100%; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1199px) {
    .pd-hero { gap: 40px; }
    .pd-title { font-size: 34px; }
}
@media (max-width: 991px) {
    .pd-hero { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 12px 16px 48px; }
    .pd-gallery { position: static; }
    .pd .fotorama__stage { border-radius: 18px; }
    .pd .fotorama__arr { opacity: 1; }
    .pd-section { padding: 56px 16px; }
    .pd-section-title { font-size: 30px; margin-bottom: 24px; }
}
@media (max-width: 575px) {
    .pd-title { font-size: 26px; }
    .pd .pd-price .price-new-pro-detail { font-size: 24px; }
    .pd .grid-properties { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pd-buttons { grid-template-columns: 1fr; }
    .pd-coupon { width: 280px; max-width: 88%; }
    .pd-coupon-badge { flex-basis: 62px; }
    .pd-coupon-badge strong { font-size: 19px; }
    .pd-coupon-body { padding-left: 12px; padding-right: 10px; }
    .pd .pd-btn-primary { order: -1; }
    .pd-prose { font-size: 16px; }
    .pd-prose h1, .pd-prose h2 { font-size: 23px; }
    .pd-section-title { font-size: 26px; }
}
