/* ==========================================================================
   BuddyTH Deal & Affiliate Showcase (Phase 1 MVP)
   File: css/buddy-deals.css
   Design tokens inherit from template/buddy-ui.css with safe fallbacks.
   Strictly scoped under .bd-* to avoid side effects on blog-single.php.
   ========================================================================== */

:root {
  --pf-shopee: #EE4D2D;
  --pf-shopee-d: #D13A1C;
  --pf-shopee-soft: #FFF1EE;
  --pf-shopee-line: #FECAC0;

  --pf-lazada: #0F146D;
  --pf-lazada-d: #090C4A;
  --pf-lazada-soft: #EEF0FF;
  --pf-lazada-line: #C7CEFF;

  --pf-tiktok: #111827;
  --pf-tiktok-d: #030712;
  --pf-tiktok-soft: #F3F4F6;
  --pf-tiktok-line: #D1D5DB;

  --pf-other: var(--brand, #6A49F2);
  --pf-other-d: var(--brand-ink, #4E31CF);
  --pf-other-soft: var(--mist, #F4F2FB);
  --pf-other-line: var(--line, #E6E2F3);

  --bd-ok: #0E8A5F;
  --bd-ok-ink: #065F46;
  --bd-ok-bg: #ECFDF5;
  --bd-ok-line: #A7F3D0;

  --bd-warn: #B45309;
  --bd-warn-ink: #92400E;
  --bd-warn-bg: #FFFBEB;
  --bd-warn-line: #FDE68A;

  --bd-radius: 16px;
  --bd-radius-sm: 10px;
  --bd-shadow: 0 2px 10px rgba(26, 20, 51, .06);
  --bd-shadow-hover: 0 12px 28px rgba(26, 20, 51, .12);
}

/* Focus-visible parity with buddy-ui.css */
.bd-hero a:focus-visible,
.bd-hero button:focus-visible,
.bd-hero input:focus-visible,
.bd-cats a:focus-visible,
.bd-cats button:focus-visible,
.bd-grid a:focus-visible,
.bd-detail-grid a:focus-visible,
.bd-detail-grid button:focus-visible,
.bd-sticky-bar a:focus-visible,
.bd-sticky-bar button:focus-visible,
.bd-sheet a:focus-visible,
.bd-sheet button:focus-visible,
.bd-embed-wrap a:focus-visible,
.bd-embed-wrap button:focus-visible {
  outline: 3px solid var(--sunset, #FF8A3D);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ==========================================================================
   1. Deals Listing Page (deals.php -> /ดีลเด็ด)
   ========================================================================== */

.bd-hero {
  background:
    radial-gradient(circle at 88% 18%, rgba(106, 73, 242, .30), transparent 46%),
    radial-gradient(circle at 12% 85%, rgba(255, 138, 61, .14), transparent 42%),
    var(--night, #1A1433);
  color: #fff;
  padding: 40px 0 42px;
  position: relative;
  overflow: hidden;
  font-family: var(--body, 'Anuphan', system-ui, sans-serif);
}

.bd-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--brand, #6A49F2) 0 70%, var(--sunset, #FF8A3D) 70% 100%);
}

.bd-hero h1 {
  font-family: var(--display, 'Chakra Petch', 'Anuphan', sans-serif);
  font-weight: 700;
  font-size: clamp(28px, 4.8vw, 46px);
  line-height: 1.15;
  margin: 0 0 12px;
  color: #fff;
  letter-spacing: -.01em;
}

.bd-hero p {
  font-size: clamp(15px, 2vw, 17px);
  line-height: 1.6;
  color: #D9D3F5;
  margin: 0 0 22px;
  max-width: 42em;
}

.bd-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--paper, #FFFFFF);
  border-radius: 14px;
  padding: 6px;
  max-width: 560px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .24);
  border: 2px solid transparent;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.bd-search:focus-within {
  border-color: var(--sunset, #FF8A3D);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .3);
}

.bd-search input[type="search"],
.bd-search input[type="text"],
.bd-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink, #1D1834);
  font: inherit;
  font-size: 16px;
  padding: 10px 12px;
  outline: none;
}

.bd-search input::placeholder {
  color: var(--muted, #6B6785);
}

.bd-search button,
.bd-search .btn {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--brand, #6A49F2);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, transform .1s ease;
}

.bd-search button:hover,
.bd-search .btn:hover {
  background: var(--brand-ink, #4E31CF);
}

.bd-search button:active {
  transform: scale(.98);
}

.bd-disclosure-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line-dark, #3A2F66);
  color: #D9D3F5;
  font-size: 13px;
  line-height: 1.45;
  max-width: 100%;
}

/* Category Filter Bar (Mobile Horizontal Scroll) */
.bd-cats {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 0 8px;
  margin-bottom: 14px;
  scrollbar-width: thin;
}

.bd-cats::-webkit-scrollbar {
  height: 5px;
}

.bd-cats::-webkit-scrollbar-thumb {
  background: var(--line, #E6E2F3);
  border-radius: 999px;
}

.bd-cat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line, #E6E2F3);
  background: var(--paper, #FFFFFF);
  color: var(--ink, #1D1834);
  font-family: var(--body, 'Anuphan', system-ui, sans-serif);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.bd-cat:hover {
  border-color: var(--brand, #6A49F2);
  color: var(--brand-ink, #4E31CF);
  background: var(--mist, #F4F2FB);
}

.bd-cat.is-active {
  background: var(--brand, #6A49F2);
  border-color: var(--brand, #6A49F2);
  color: #fff;
  box-shadow: 0 4px 12px rgba(106, 73, 242, .28);
}

.bd-cat.is-active:hover {
  background: var(--brand-ink, #4E31CF);
  color: #fff;
}

/* Search Result Summary Note (deals.php) */
.bd-result-note {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: var(--bd-radius-sm);
  background: var(--mist, #F4F2FB);
  border: 1px solid var(--line, #E6E2F3);
  color: var(--muted, #6B6785);
  font-size: 14px;
  line-height: 1.5;
}

.bd-result-note a {
  color: var(--brand-ink, #4E31CF);
  font-weight: 600;
  text-decoration: underline;
}

.bd-result-note a:hover {
  color: var(--brand, #6A49F2);
}

/* Deal Cards Grid (Mobile 1 -> Tablet 2 -> Desktop 4) */
.bd-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 36px;
}

.bd-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--paper, #FFFFFF);
  border: 1px solid var(--line, #E6E2F3);
  border-radius: var(--bd-radius);
  overflow: hidden;
  box-shadow: var(--bd-shadow);
  color: var(--ink, #1D1834);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.bd-card:hover {
  transform: translateY(-3px);
  border-color: rgba(106, 73, 242, .45);
  box-shadow: var(--bd-shadow-hover);
}

.bd-card-img {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--mist, #F4F2FB);
  overflow: hidden;
}

.bd-card-img img,
.bd-card-img .bd-card-pic {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.bd-card-pic.ph {
  width: 100%;
  height: 100%;
  display: block;
  background: var(--mist, #F4F2FB);
}

.bd-card:hover .bd-card-img img {
  transform: scale(1.03);
}

.bd-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--night, #1A1433);
  color: #fff;
  border: 1px solid rgba(255, 138, 61, .65);
  font-family: var(--body, 'Anuphan', system-ui, sans-serif);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .01em;
  box-shadow: 0 4px 12px rgba(26, 20, 51, .28);
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bd-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  padding: 15px 16px 16px;
  min-width: 0;
}

.bd-card-cat {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-ink, #4E31CF);
  letter-spacing: .02em;
  text-transform: uppercase;
}

.bd-card-title {
  margin: 0;
  font-family: var(--body, 'Anuphan', system-ui, sans-serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink, #1D1834);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bd-card:hover .bd-card-title {
  color: var(--brand-ink, #4E31CF);
}

.bd-card-price {
  font-family: var(--display, 'Chakra Petch', 'Anuphan', sans-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink, #1D1834);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.bd-card-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.bd-pf-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  border: 1px solid var(--pf-other-line);
  background: var(--pf-other-soft);
  color: var(--pf-other-d);
  white-space: nowrap;
}

.bd-pf-chip.pf-shopee {
  background: var(--pf-shopee-soft);
  border-color: var(--pf-shopee-line);
  color: var(--pf-shopee-d);
}

.bd-pf-chip.pf-lazada {
  background: var(--pf-lazada-soft);
  border-color: var(--pf-lazada-line);
  color: var(--pf-lazada);
}

.bd-pf-chip.pf-tiktok {
  background: var(--pf-tiktok-soft);
  border-color: var(--pf-tiktok-line);
  color: var(--pf-tiktok);
}

.bd-pf-chip.pf-other {
  background: var(--pf-other-soft);
  border-color: var(--pf-other-line);
  color: var(--pf-other-d);
}

.bd-card-meta {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line, #E6E2F3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted, #6B6785);
  font-variant-numeric: tabular-nums;
}

.bd-empty {
  grid-column: 1 / -1;
  background: var(--mist, #F4F2FB);
  border: 2px dashed var(--line, #E6E2F3);
  border-radius: var(--bd-radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--muted, #6B6785);
}

.bd-empty h2,
.bd-empty h3 {
  margin: 0 0 8px;
  color: var(--ink, #1D1834);
  font-family: var(--display, 'Chakra Petch', 'Anuphan', sans-serif);
}

.bd-empty p {
  margin: 0 auto 16px;
  max-width: 34em;
}

/* ==========================================================================
   2. Deal Detail Page (deal-detail.php -> /ดีล-{id}-{slug}.html)
   ========================================================================== */

.bd-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 16px 0 14px;
  font-size: 13px;
  color: var(--muted, #6B6785);
  line-height: 1.4;
}

.bd-crumb a {
  color: var(--muted, #6B6785);
  text-decoration: none;
  transition: color .15s ease;
}

.bd-crumb a:hover {
  color: var(--brand-ink, #4E31CF);
  text-decoration: underline;
}

.bd-crumb span:last-child,
.bd-crumb [aria-current="page"] {
  color: var(--ink, #1D1834);
  font-weight: 600;
}

/* 2-Column Desktop / Single-Column Mobile */
.bd-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 32px;
}

.bd-gallery-col,
.bd-buy-col {
  min-width: 0;
}

/* Gallery */
.bd-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bd-gallery-main {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  background: var(--mist, #F4F2FB);
  border: 1px solid var(--line, #E6E2F3);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--bd-shadow);
}

.bd-gallery-main img,
.bd-gallery-main .bd-gallery-ph {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bd-gallery-main img[hidden],
.bd-sheet[hidden],
.bd-sheet-backdrop[hidden] {
  display: none !important;
}

.bd-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .24);
  background: rgba(26, 20, 51, .68);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background-color .15s ease, transform .12s ease;
}

.bd-gallery-nav:hover {
  background: rgba(26, 20, 51, .9);
}

.bd-gallery-nav:active {
  transform: translateY(-50%) scale(.94);
}

.bd-gallery-nav.prev {
  left: 10px;
}

.bd-gallery-nav.next {
  right: 10px;
}

.bd-gallery-counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(26, 20, 51, .78);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
}

.bd-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 4px;
  scrollbar-width: thin;
}

.bd-thumb {
  flex: 0 0 68px;
  width: 68px;
  height: 68px;
  padding: 0;
  border-radius: 12px;
  border: 2px solid var(--line, #E6E2F3);
  background: var(--mist, #F4F2FB);
  overflow: hidden;
  cursor: pointer;
  opacity: .74;
  transition: opacity .15s ease, border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}

.bd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bd-thumb:hover {
  opacity: 1;
  border-color: var(--brand, #6A49F2);
}

.bd-thumb.is-active {
  opacity: 1;
  border-color: var(--brand, #6A49F2);
  box-shadow: 0 0 0 3px rgba(106, 73, 242, .18);
}

/* Buy Box */
.bd-buy-box {
  background: var(--paper, #FFFFFF);
  border: 1px solid var(--line, #E6E2F3);
  border-radius: 18px;
  padding: 20px 18px;
  box-shadow: var(--bd-shadow);
}

.bd-title {
  margin: 0 0 8px;
  font-family: var(--display, 'Chakra Petch', 'Anuphan', sans-serif);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink, #1D1834);
}

.bd-subtitle {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted, #6B6785);
}

.bd-price-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: 14px;
  background: var(--mist, #F4F2FB);
  border: 1px solid var(--line, #E6E2F3);
}

.bd-price-main {
  font-family: var(--display, 'Chakra Petch', 'Anuphan', sans-serif);
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--brand-ink, #4E31CF);
  font-variant-numeric: tabular-nums;
}

.bd-price-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted, #6B6785);
  white-space: nowrap;
}

/* Multi-Platform Buy Rows */
.bd-buy-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bd-buy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--line, #E6E2F3);
  border-left-width: 5px;
  border-left-color: var(--pf-other);
  background: var(--paper, #FFFFFF);
  color: var(--ink, #1D1834);
  text-decoration: none;
  transition: transform .14s ease, box-shadow .16s ease, border-color .15s ease, background-color .15s ease;
}

.bd-buy-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(26, 20, 51, .09);
}

.bd-buy-row.pf-shopee {
  border-left-color: var(--pf-shopee);
}
.bd-buy-row.pf-shopee:hover {
  border-color: var(--pf-shopee);
  background: #FFFCFB;
}

.bd-buy-row.pf-lazada {
  border-left-color: var(--pf-lazada);
}
.bd-buy-row.pf-lazada:hover {
  border-color: var(--pf-lazada);
  background: #FAFBFD;
}

.bd-buy-row.pf-tiktok {
  border-left-color: var(--pf-tiktok);
}
.bd-buy-row.pf-tiktok:hover {
  border-color: var(--pf-tiktok);
  background: #FAFAFB;
}

.bd-buy-row.pf-other {
  border-left-color: var(--pf-other);
}
.bd-buy-row.pf-other:hover {
  border-color: var(--pf-other);
  background: #FCFBFF;
}

.bd-buy-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.bd-buy-left strong,
.bd-buy-left b {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink, #1D1834);
}

.bd-promo-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: #FFF4EC;
  border: 1px solid #FED7AA;
  color: #9A3412;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  max-width: 100%;
}

.bd-buy-price {
  font-family: var(--display, 'Chakra Petch', 'Anuphan', sans-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink, #1D1834);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex: 0 0 auto;
}

.bd-buy-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 15px;
  border-radius: 10px;
  background: var(--pf-other);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: background-color .15s ease, transform .1s ease;
}

.bd-buy-row.pf-shopee .bd-buy-cta { background: var(--pf-shopee); }
.bd-buy-row.pf-shopee:hover .bd-buy-cta { background: var(--pf-shopee-d); }

.bd-buy-row.pf-lazada .bd-buy-cta { background: var(--pf-lazada); }
.bd-buy-row.pf-lazada:hover .bd-buy-cta { background: var(--pf-lazada-d); }

.bd-buy-row.pf-tiktok .bd-buy-cta { background: var(--pf-tiktok); }
.bd-buy-row.pf-tiktok:hover .bd-buy-cta { background: var(--pf-tiktok-d); }

.bd-buy-row.pf-other .bd-buy-cta { background: var(--pf-other); }
.bd-buy-row.pf-other:hover .bd-buy-cta { background: var(--pf-other-d); }

/* Out-of-stock / unavailable state */
.bd-buy-row.is-oos {
  opacity: .64;
  background: #F8F8FA;
  border-color: var(--line, #E6E2F3);
  border-left-color: #9CA3AF;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.bd-buy-row.is-oos:hover {
  transform: none;
  box-shadow: none;
  background: #F8F8FA;
  border-color: var(--line, #E6E2F3);
}

.bd-buy-row.is-oos .bd-buy-price {
  color: var(--muted, #6B6785);
  text-decoration: line-through;
}

.bd-buy-row.is-oos .bd-buy-cta {
  background: #6B7280;
  color: #fff;
}

/* Transparent Affiliate Disclosure Box */
.bd-disclosure {
  margin-top: 16px;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--mist, #F4F2FB);
  border: 1px solid var(--line, #E6E2F3);
  color: var(--muted, #6B6785);
  font-size: 13px;
  line-height: 1.55;
}

/* Pros & Cons Boxes — โทนธีม BuddyTH (ม่วง Buddy + ส้มพระอาทิตย์ตก) · 27 พ.ย. 2569 */
.bd-pros-cons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.bd-box-pros,
.bd-box-cons {
  --pc: var(--brand, #6A49F2);
  --pc-ink: var(--brand-ink, #4E31CF);
  --pc-soft: rgba(106, 73, 242, .09);
  --pc-line: rgba(106, 73, 242, .22);
  position: relative;
  overflow: hidden;
  border-radius: var(--bd-radius);
  padding: 20px 20px 18px;
  background: var(--paper, #FFFFFF);
  border: 1px solid var(--line, #E6E2F3);
  box-shadow: var(--bd-shadow);
}

.bd-box-cons {
  --pc: var(--sunset, #FF8A3D);
  --pc-ink: #C2540F;
  --pc-soft: rgba(255, 138, 61, .11);
  --pc-line: rgba(255, 138, 61, .30);
}

/* แถบสีด้านบน + แสงฟุ้งมุมการ์ด */
.bd-box-pros::before,
.bd-box-cons::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--pc);
  background: linear-gradient(90deg, var(--pc), color-mix(in srgb, var(--pc) 45%, #fff));
}

.bd-box-pros::after,
.bd-box-cons::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--pc-soft), transparent 70%);
  pointer-events: none;
}

.bd-pc-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--pc-line);
}

.bd-pc-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--pc), var(--pc-ink));
  box-shadow: 0 6px 14px var(--pc-line);
}

.bd-box-pros h2,
.bd-box-pros h3,
.bd-box-cons h2,
.bd-box-cons h3 {
  flex: 1;
  margin: 0;
  font-family: var(--display, 'Chakra Petch', 'Anuphan', sans-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink, #1D1834);
}

.bd-pc-count {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--pc-ink);
  background: var(--pc-soft);
  border: 1px solid var(--pc-line);
  padding: 2px 10px;
  border-radius: 999px;
}

.bd-box-pros ul,
.bd-box-cons ul {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bd-box-pros li,
.bd-box-cons li {
  position: relative;
  padding: 9px 12px 9px 42px;
  border-radius: 12px;
  background: var(--mist, #F4F2FB);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink, #1D1834);
  transition: background .15s, transform .15s;
}

.bd-box-cons li {
  background: #FFF6EF;
}

.bd-box-pros li:hover,
.bd-box-cons li:hover {
  background: var(--pc-soft);
  transform: translateX(2px);
}

.bd-box-pros li::before,
.bd-box-cons li::before {
  position: absolute;
  left: 12px;
  top: 11px;
  width: 20px;
  height: 20px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: var(--pc);
}

.bd-box-pros li::before {
  content: "✓";
}

.bd-box-cons li::before {
  content: "!";
}

@media (prefers-reduced-motion: reduce) {
  .bd-box-pros li,
  .bd-box-cons li { transition: none; }
  .bd-box-pros li:hover,
  .bd-box-cons li:hover { transform: none; }
}

/* Content Sections (Specs & Review) */
.bd-section {
  background: var(--paper, #FFFFFF);
  border: 1px solid var(--line, #E6E2F3);
  border-radius: var(--bd-radius);
  padding: 20px 18px;
  margin-bottom: 24px;
  box-shadow: var(--bd-shadow);
}

.bd-sec-title {
  margin: 0 0 16px;
  padding-left: 12px;
  border-left: 4px solid var(--brand, #6A49F2);
  font-family: var(--display, 'Chakra Petch', 'Anuphan', sans-serif);
  font-size: clamp(19px, 2.4vw, 22px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink, #1D1834);
}

/* 2-Column Mobile-Safe Spec Table */
.bd-spec-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  border: 1px solid var(--line, #E6E2F3);
  border-radius: 12px;
  overflow: hidden;
  font-size: 14.5px;
}

.bd-spec-table th,
.bd-spec-table td {
  padding: 11px 13px;
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
  border-bottom: 1px solid var(--line, #E6E2F3);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.bd-spec-table tr:last-child th,
.bd-spec-table tr:last-child td {
  border-bottom: 0;
}

.bd-spec-table th,
.bd-spec-table td:first-child {
  width: 38%;
  background: var(--mist, #F4F2FB);
  color: var(--ink, #1D1834);
  font-weight: 600;
  border-right: 1px solid var(--line, #E6E2F3);
}

.bd-spec-table td:last-child {
  width: 62%;
  background: var(--paper, #FFFFFF);
  color: var(--ink, #1D1834);
  font-weight: 400;
}

/* Review Body */
.bd-review-body {
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink, #1D1834);
}

.bd-review-body > :first-child { margin-top: 0; }
.bd-review-body > :last-child { margin-bottom: 0; }

.bd-review-body h2,
.bd-review-body h3,
.bd-review-body h4 {
  font-family: var(--display, 'Chakra Petch', 'Anuphan', sans-serif);
  color: var(--ink, #1D1834);
  line-height: 1.35;
  margin: 22px 0 10px;
}

.bd-review-body p {
  margin: 0 0 14px;
}

.bd-review-body ul,
.bd-review-body ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.bd-review-body li {
  margin-bottom: 6px;
}

.bd-review-body blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 4px solid var(--brand, #6A49F2);
  background: var(--mist, #F4F2FB);
  border-radius: 0 10px 10px 0;
  color: var(--ink, #1D1834);
}

.bd-review-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 14px 0;
}

.bd-review-body a {
  color: var(--brand-ink, #4E31CF);
  text-decoration: underline;
  font-weight: 500;
}

/* Related Deals */
.bd-related {
  margin: 32px 0 40px;
}

.bd-related .bd-grid {
  margin-bottom: 0;
}

/* ==========================================================================
   3. Mobile Sticky Bottom Bar + Bottom Sheet (<= 900px)
   ========================================================================== */

.bd-sticky-bar {
  display: none;
}

.bd-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(26, 20, 51, .56);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s ease;
}

.bd-sheet-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.bd-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  max-height: 82vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--paper, #FFFFFF);
  border-radius: 22px 22px 0 0;
  padding: 12px 18px calc(22px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -14px 40px rgba(26, 20, 51, .28);
  transform: translateY(106%);
  visibility: hidden;
  pointer-events: none;
  transition: transform .26s cubic-bezier(.22, 1, .36, 1), visibility .26s ease;
}

.bd-sheet::before {
  content: "";
  display: block;
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: var(--line, #E6E2F3);
  margin: 0 auto 12px;
}

.bd-sheet.is-open {
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}

.bd-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line, #E6E2F3);
}

.bd-sheet-head h2,
.bd-sheet-head h3,
.bd-sheet-head strong,
.bd-sheet > h2,
.bd-sheet > h3 {
  margin: 0;
  font-family: var(--display, 'Chakra Petch', 'Anuphan', sans-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink, #1D1834);
}

.bd-sheet-close,
.bd-sheet [data-close],
.bd-sheet-head button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line, #E6E2F3);
  background: var(--mist, #F4F2FB);
  color: var(--ink, #1D1834);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background-color .15s ease, border-color .15s ease;
}

.bd-sheet-close:hover,
.bd-sheet [data-close]:hover,
.bd-sheet-head button:hover {
  background: var(--line, #E6E2F3);
  border-color: var(--brand, #6A49F2);
}

/* ==========================================================================
   4. Article Embedded Deals Box (blog-single.php)
   Strictly scoped inside .bd-embed-wrap; does not alter .prose styles.
   ========================================================================== */

.bd-embed-wrap {
  margin: 34px 0 28px;
  padding: 20px 18px;
  border-radius: var(--bd-radius);
  background: var(--mist, #F4F2FB);
  border: 1px solid var(--line, #E6E2F3);
  position: relative;
  overflow: hidden;
  font-family: var(--body, 'Anuphan', system-ui, sans-serif);
  color: var(--ink, #1D1834);
}

.bd-embed-wrap::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand, #6A49F2) 0 70%, var(--sunset, #FF8A3D) 70% 100%);
}

.bd-embed-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 14px;
}

.bd-embed-head h2,
.bd-embed-head h3,
.bd-embed-head strong {
  margin: 0;
  font-family: var(--display, 'Chakra Petch', 'Anuphan', sans-serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink, #1D1834);
}

.bd-embed-head a {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-ink, #4E31CF);
  text-decoration: none;
  white-space: nowrap;
}

.bd-embed-head a:hover {
  text-decoration: underline;
}

.bd-embed-head small,
.bd-embed-head .bd-embed-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--paper, #FFFFFF);
  border: 1px solid var(--line, #E6E2F3);
  color: var(--muted, #6B6785);
  font-size: 11px;
  font-weight: 600;
}

.bd-embed-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.bd-embed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 13px;
  background: var(--paper, #FFFFFF);
  border: 1px solid var(--line, #E6E2F3);
  box-shadow: 0 2px 6px rgba(26, 20, 51, .04);
  min-width: 0;
  transition: border-color .15s ease, box-shadow .15s ease, transform .14s ease;
}

.bd-embed-item:hover {
  border-color: rgba(106, 73, 242, .45);
  box-shadow: 0 6px 16px rgba(26, 20, 51, .08);
  transform: translateY(-1px);
}

.bd-embed-item > a:first-child {
  flex: 0 0 auto;
  display: block;
}

.bd-embed-item img,
.bd-embed-pic,
.bd-embed-pic.ph {
  flex: 0 0 72px;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  display: block;
  border-radius: 10px;
  object-fit: cover;
  background: var(--mist, #F4F2FB);
  border: 1px solid var(--line, #E6E2F3);
  margin: 0;
}

.bd-embed-item > div {
  flex: 1;
  min-width: 0;
}

.bd-embed-item h4,
.bd-embed-item strong,
.bd-embed-item b {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 4px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.38;
  color: var(--ink, #1D1834);
}

.bd-embed-item .bd-card-price {
  font-size: 16px;
  margin: 0;
}

.bd-embed-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 10px;
  background: var(--brand, #6A49F2);
  color: #fff !important;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, transform .1s ease;
}

.bd-embed-btn:hover {
  background: var(--brand-ink, #4E31CF);
}

.bd-embed-btn:active {
  transform: scale(.98);
}

.bd-embed-btn.pf-shopee { background: var(--pf-shopee); }
.bd-embed-btn.pf-shopee:hover { background: var(--pf-shopee-d); }
.bd-embed-btn.pf-lazada { background: var(--pf-lazada); }
.bd-embed-btn.pf-lazada:hover { background: var(--pf-lazada-d); }
.bd-embed-btn.pf-tiktok { background: var(--pf-tiktok); }
.bd-embed-btn.pf-tiktok:hover { background: var(--pf-tiktok-d); }

/* M-3: High-contrast affiliate disclosure on light embed card */
.bd-embed-wrap .bd-disclosure-inline {
  display: block;
  margin: 14px 0 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--paper, #FFFFFF);
  border: 1px solid var(--line, #E6E2F3);
  color: #4B4666;
  font-size: 12.5px;
  line-height: 1.5;
}

/* ==========================================================================
   5. Responsive Breakpoints (Mobile-First)
   ========================================================================== */

/* Tablet >= 600px */
@media (min-width: 600px) {
  .bd-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bd-embed-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mid-Tablet >= 720px */
@media (min-width: 720px) {
  .bd-pros-cons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bd-buy-box,
  .bd-section {
    padding: 24px;
  }

  .bd-embed-wrap {
    padding: 22px 24px;
  }
}

/* Desktop >= 901px (Sticky 2-col Detail Layout, No Mobile Sticky Bar) */
@media (min-width: 901px) {
  .bd-hero {
    padding: 52px 0 48px;
  }

  .bd-detail-grid {
    grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
    gap: 36px;
  }

  .bd-gallery-col {
    position: sticky;
    top: 84px;
  }

  .bd-spec-table th,
  .bd-spec-table td:first-child {
    width: 30%;
  }

  .bd-spec-table td:last-child {
    width: 70%;
  }
}

/* Wide Desktop >= 1024px (4-Column Deals Grid) */
@media (min-width: 1024px) {
  .bd-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }
}

/* Mobile & Compact Tablet <= 900px (Sticky Bottom CTA Bar + Bottom Padding) */
@media (max-width: 900px) {
  body:has(.bd-sticky-bar),
  body.bd-has-sticky {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }

  .bd-sticky-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--line, #E6E2F3);
    box-shadow: 0 -6px 24px rgba(26, 20, 51, .12);
  }

  .bd-sticky-price {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-family: var(--display, 'Chakra Petch', 'Anuphan', sans-serif);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--brand-ink, #4E31CF);
    font-variant-numeric: tabular-nums;
  }

  .bd-sticky-price small {
    font-family: var(--body, 'Anuphan', system-ui, sans-serif);
    font-size: 11px;
    font-weight: 600;
    color: var(--muted, #6B6785);
    line-height: 1.2;
  }

  .bd-sticky-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 0 auto;
    min-height: 46px;
    padding: 10px 20px;
    border: 0;
    border-radius: 12px;
    background: var(--brand, #6A49F2);
    color: #fff;
    font-family: var(--body, 'Anuphan', system-ui, sans-serif);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(106, 73, 242, .32);
    transition: background-color .15s ease, transform .1s ease;
  }

  .bd-sticky-btn:hover {
    background: var(--brand-ink, #4E31CF);
  }

  .bd-sticky-btn:active {
    transform: scale(.98);
  }

  .bd-sticky-btn.pf-shopee { background: var(--pf-shopee); box-shadow: 0 4px 14px rgba(238, 77, 45, .32); }
  .bd-sticky-btn.pf-shopee:hover { background: var(--pf-shopee-d); }
  .bd-sticky-btn.pf-lazada { background: var(--pf-lazada); box-shadow: 0 4px 14px rgba(15, 20, 109, .32); }
  .bd-sticky-btn.pf-lazada:hover { background: var(--pf-lazada-d); }
  .bd-sticky-btn.pf-tiktok { background: var(--pf-tiktok); box-shadow: 0 4px 14px rgba(17, 24, 39, .32); }
  .bd-sticky-btn.pf-tiktok:hover { background: var(--pf-tiktok-d); }
  .bd-sticky-btn.pf-other { background: var(--pf-other); }
  .bd-sticky-btn.pf-other:hover { background: var(--pf-other-d); }
}

/* Narrow Mobile <= 480px */
@media (max-width: 480px) {
  .bd-hero {
    padding: 28px 0 32px;
  }

  .bd-buy-row {
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 12px;
  }

  .bd-buy-left {
    flex: 1 1 100%;
  }

  .bd-buy-price {
    font-size: 17px;
  }

  .bd-buy-cta {
    margin-left: auto;
    padding: 8px 14px;
  }

  .bd-embed-item {
    flex-wrap: wrap;
  }

  .bd-embed-btn {
    width: 100%;
    margin-top: 2px;
  }

  .bd-thumb {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
  }
}

/* Reduced Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
  .bd-card,
  .bd-card-img img,
  .bd-cat,
  .bd-thumb,
  .bd-gallery-nav,
  .bd-buy-row,
  .bd-buy-cta,
  .bd-sticky-btn,
  .bd-sheet-backdrop,
  .bd-sheet,
  .bd-embed-item,
  .bd-embed-btn {
    transition: none !important;
  }
}