/* Uses your tokens: --bg, --fg, --muted, --surface, --border, --primary, --radius, --shadow */


/* Layout */
.pd-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    margin-top: 8px
}

@media (max-width: 980px) {
    .pd-grid {
        grid-template-columns: 1fr
    }
}

/* Gallery */
.pd-gallery.card {
    padding: 16px
}

.pd-main {
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border)
}

.pd-main img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform .35s ease
}

.pd-main:hover img {
    transform: scale(1.01);
    cursor: pointer;
}

.pd-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    overflow: auto;
    padding-bottom: 4px
}

.pd-thumb {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    background: var(--bg);
    cursor: pointer;
    transition: transform .12s ease, border-color .2s ease
}

.pd-thumb:focus-visible {
    outline: none;
    box-shadow: var(--focus)
}

.pd-thumb:hover {
    transform: translateY(-1px)
}

.pd-thumb img {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 8px
}

.pd-thumb.is-active {
    border-color: color-mix(in oklab, var(--primary) 65%, var(--border))
}

/* Buy box */
.pd-info.card {
    padding: 16px;
    position: sticky;
    top: 86px;
    align-self: start
}

.pd-title {
    margin: 0 0 6px;
    font-size: 20px;
}

.pd-meta {
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
    color: var(--muted)
}

.pd-price {
    display: flex;
    gap: 10px;
    align-items: baseline;
    margin: 10px 0 14px
}

.pd-price .now {
    font-size: 28px;
    font-weight: 800
}

.pd-price .old {
    text-decoration: line-through;
    color: var(--muted)
}

.pd-attrs {
    display: grid;
    gap: 6px;
    margin: 10px 0
}

.pd-attrs .attr .k {
    color: var(--muted);
    margin-right: 4px
}

.pd-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px
}

.btn-xl {
    height: 44px;
    padding: 0 16px
}

/* Banner “đã mua” */
.owned-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #ecfdf5;
    /* xanh nhạt */
    border: 1px solid #a7f3d0;
    color: #065f46;
    /* mực xanh đậm */
    font-size: 14px;
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
    margin-top: 10px;
}

.owned-banner a {
    color: #047857;
    font-weight: 700;
    text-decoration: underline;
}

.owned-icon {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    background: #10b981;
    color: #fff;
    display: grid;
    place-items: center;
    flex: 0 0 22px;
}

.owned-icon svg {
    width: 14px;
    height: 14px
}

/* Bullet trust (khi chưa mua) */
.trust-bullets {
    margin: 10px 0 0;
    padding-left: 0 !important;
    color: #475569;
}

.trust-bullets li {
    margin: 4px 0;
    list-style: none;    
}
.trust-bullets li::before {
    display: none;
}
/* Nếu có style cũ của .pd-trust, tránh ảnh hưởng: */
.pd-trust.owned-note {
    display: block !important;
}

.pd-share {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px
}

.pd-share .share {
    font-size: 13px;
    color: var(--primary);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 999px
}

.pd-share .share:hover {
    filter: brightness(0.98)
}

/* ========== TABS (pro) ========== */
.pd-tabs.card {
    margin-top: 16px;
    padding: 0;
}

.pd-tab-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    gap: 4px;
    padding: 6px 8px 6px;
    /* chừa đáy cho ink */
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    /* fade 2 mép khi tràn */
    -webkit-mask-image: linear-gradient(to right, transparent, #000 20px, #000 calc(100% - 20px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 20px, #000 calc(100% - 20px), transparent);
}

.pd-tab-head::-webkit-scrollbar {
    display: none;
}

.pd-tab-head {
    scrollbar-width: none;
}

.pd-tab {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    scroll-snap-align: start;
    transition: background .18s ease, color .18s ease;
}

.pd-tab:hover {
    background: var(--surface);
}

.pd-tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in oklab, var(--primary) 30%, transparent);
}

.pd-tab.is-active {
    color: var(--fg);
    background: color-mix(in oklab, var(--primary) 14%, transparent);
}

/* Ink bar trượt dưới đáy head */
.pd-tab-head {
    position: sticky;
}

.pd-tab-head .pd-ink {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: var(--ink-w, 0px);
    transform: translateX(var(--ink-x, 0px));
    background: var(--primary);
    border-radius: 2px;
    transition: transform .25s ease, width .25s ease;
}

/* Panels */
.pd-tab-panels {
    padding: 12px;
}

.pd-panel {
    display: none;
}

.pd-panel.is-active {
    display: block;
}

/* Mobile: nút dễ bấm hơn */
@media (max-width: 768px) {
    .pd-tab {
        padding: 10px 12px;
    }
}

/* Content defaults inside tabs (if HTML injected) */
.pd-panel h2,
.pd-panel h3 {
    margin: 14px 0 8px
}

.pd-panel pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    overflow: auto
}

.content ul li p {
    margin: 0px 0 0 0;
    /* Nếu có thẻ p bên trong li, thường là do HTML được inject từ CMS, nên cần reset margin để không bị thụt vào gấp đôi */
}

/* Mobile sticky CTA (optional) */
.pd-sticky-cta {
    position: sticky;
    bottom: 0;
    z-index: 40;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--border);
    padding: 10px 12px;
    display: none
}

.pd-sticky-cta .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px
}

.pd-sticky-cta .price {
    font-weight: 800
}

@media (max-width: 980px) {
    .pd-sticky-cta {
        display: block
    }
}

/* Blur-up */
.img-blur {
    filter: blur(6px) saturate(1) contrast(1.02);
    transform: scale(1.02)
}

.img-blur.is-loaded {
    filter: none;
    transform: none;
    transition: filter .35s ease, transform .35s ease
}

/* LIGHTBOX */
.pd-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.pd-lightbox {
    display: none;
    /* mặc định ẩn */
}

.pd-lightbox.is-open {
    display: flex;
    /* khi mở */
}

.pd-lightbox img {
    max-width: 90%;
    max-height: 85%;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

.lb-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 32px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
}

.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 10px 15px;
}

.lb-prev {
    left: 25px;
}

.lb-next {
    right: 25px;
}

@media (max-width: 640px) {
  .pd-thumb img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px
  }
  .lb-prev,
  .lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .3s ease;
    backdrop-filter: blur(4px);
  }
      .hs-nav {
        width: 36px;
        background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .22));
    }
}
