:root {
  --bg: #f4f6f8;
  --card: #fff;
  --text: #1a1d21;
  --muted: #5c6570;
  --brand: #ee4d2d;
  --brand-dark: #d73211;
  --ok: #1a7f37;
  --line: #e6e9ee;
  --shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
  --radius: 16px;
  --font: "Sarabun", "Segoe UI", system-ui, sans-serif;
  --header-h: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --pad-x: clamp(.75rem, 3.2vw, 1.25rem);
  /* fluid type scale */
  --fs-xs: clamp(.72rem, .68rem + .2vw, .8rem);
  --fs-sm: clamp(.8rem, .76rem + .25vw, .9rem);
  --fs-base: clamp(.9rem, .86rem + .3vw, 1rem);
  --fs-md: clamp(.95rem, .9rem + .35vw, 1.05rem);
  --fs-lg: clamp(1.05rem, .98rem + .45vw, 1.2rem);
  --fs-xl: clamp(1.15rem, 1.05rem + .7vw, 1.45rem);
  --fs-2xl: clamp(1.28rem, 1.12rem + 1vw, 1.85rem);
  --fs-nav: clamp(.88rem, .84rem + .2vw, .95rem);
  --fs-nav-mobile: 1.05rem;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  color: var(--text);
  background: linear-gradient(180deg, #fff7f5 0%, var(--bg) 280px);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.55;
  padding-bottom: var(--safe-bottom);
  -webkit-font-smoothing: antialiased;
  /* ห้าม transform/filter/overflow บน body — กัน fixed bar หลุดบน iOS */
  transform: none !important;
  filter: none !important;
  perspective: none !important;
  overflow: visible !important;
}

a { color: inherit; text-decoration: none; }
img, video, svg { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; max-width: 100%; }

/* มือถือ: เต็มจอ / desktop: 90% (ดู media 961px) */
.container {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
  box-sizing: border-box;
}

/* ===== Header: logo + search + home ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: var(--safe-top);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: var(--header-h);
  padding: .4rem 0;
  position: relative;
}
.site-header__inner--search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .5rem .65rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  font-size: var(--fs-md);
  min-width: 0;
  z-index: 2;
  flex: 0 0 auto;
}
.logo-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(28vw, 140px);
  line-height: 1.2;
}
.logo-badge {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), #ff8a65);
  color: #fff;
  font-size: 1rem;
}

.header-search {
  display: flex;
  align-items: center;
  gap: .3rem;
  min-width: 0;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: .18rem .3rem .18rem .55rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.header-search:focus-within {
  border-color: #ffb39f;
  box-shadow: 0 0 0 3px rgba(238, 77, 45, .12);
}
.header-search__ico {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
  opacity: .85;
}
.header-search__input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  padding: .42rem .2rem;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--text);
}
.header-search__input::placeholder { color: #9aa3ad; }
.header-search__submit {
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 800;
  padding: .4rem .8rem;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.header-search__submit:hover { background: var(--brand-dark); }
.header-home {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: .4rem .75rem;
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}
.header-home:hover,
.header-home.is-active {
  background: #fff1ed;
  color: var(--brand);
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* legacy mobile drawer nav — ปิดแล้ว (หมวดอยู่ sidebar/chips) */
.nav-toggle,
.nav-backdrop,
.nav { display: none !important; }
body.nav-open { overflow: visible; touch-action: auto; }

.hero {
  padding: 2.2rem 0 1.2rem;
}
.hero-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.6rem;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: "";
  position: absolute; inset: auto -20% -40% auto;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(238,77,45,.18), transparent 70%);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  background: #e8f8ee; color: var(--ok);
  border-radius: 999px; padding: .25rem .7rem; font-size: .9rem; font-weight: 600;
}
.hero h1 {
  margin: .55rem 0 .35rem;
  font-size: var(--fs-2xl);
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 52ch;
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.checklist {
  margin: 1rem 0 0; padding: 0; list-style: none;
  display: grid; gap: .45rem;
}
.checklist li {
  display: flex; align-items: center; gap: .55rem;
  font-weight: 600;
}
.checklist li span.dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
}

.section-title {
  display: flex; align-items: end; justify-content: space-between;
  gap: 1rem; margin: 1.8rem 0 .9rem;
}
.section-title h2 {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 800;
  line-height: 1.3;
}
.section-title a {
  color: var(--brand);
  font-weight: 700;
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: .75rem;
  margin: 1rem 0 1.5rem;
}
.cat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  transition: transform .15s ease, box-shadow .15s ease;
}
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cat-card__icon { font-size: 1.6rem; }
.cat-card__title { font-weight: 700; margin: .35rem 0 .15rem; }
.cat-card__count { color: var(--muted); font-size: .88rem; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
  gap: .75rem;
}
/* หน้าแรก (legacy แบ่งหมวด): มือถือ 6 / desktop 5 */
.product-grid--home > .product-card:nth-child(n+7) {
  display: none;
}
@media (min-width: 961px) {
  .product-grid--home > .product-card:nth-child(n+6) {
    display: none;
  }
}
/* หน้าแรก: สุ่ม 20 รายการ ไม่ซ่อน */
.product-grid--featured {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
}
.product-grid--featured > .product-card {
  display: flex;
}
/* หน้าหมวด: มือถือ 16 รายการ / desktop 15 รายการ (3 แถว × 5 การ์ด) */
.product-grid--category > .product-card:nth-child(n+17) {
  display: none;
}
@media (min-width: 961px) {
  .product-grid--category > .product-card:nth-child(n+16) {
    display: none;
  }
  /* Desktop: 5 การ์ดต่อแถว เต็มความกว้าง */
  .product-grid,
  .product-grid--featured,
  .product-grid--category,
  .product-grid--home {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .85rem;
  }
}
.product-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow .15s ease, transform .15s ease;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.product-card__img {
  aspect-ratio: 1; background: #fafafa; position: relative; overflow: hidden;
}
.product-card__img img {
  width: 100%; height: 100%; object-fit: cover;
}
.product-card__body { padding: .75rem .8rem 1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.product-card__name {
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}
.product-card__meta { color: var(--muted); font-size: var(--fs-xs); }
.product-card__price {
  color: var(--brand);
  font-weight: 800;
  font-size: var(--fs-md);
  line-height: 1.25;
}
.product-card__rating-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .55rem;
  min-height: 1.2em;
}
.product-card__sold {
  color: var(--muted);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.product-card__shop {
  color: var(--muted);
  font-size: .8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-card__actions { margin-top: auto; padding-top: .4rem; }

/* Shopee-like stars */
.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  line-height: 1;
  vertical-align: middle;
}
.star-rating__star {
  font-size: .92rem;
  color: #d0d0d0;
  position: relative;
  display: inline-block;
  width: .95em;
  text-align: center;
}
.star-rating__star.is-full {
  color: #ee4d2d;
}
.star-rating__star.is-half {
  color: #d0d0d0;
  background: linear-gradient(90deg, #ee4d2d 50%, #d0d0d0 50%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.star-rating__star.is-empty {
  color: #d0d0d0;
}
.star-rating__num {
  margin-left: .25rem;
  font-size: var(--fs-xs);
  color: #ee4d2d;
  font-weight: 700;
}
.star-rating--empty .star-rating__star {
  color: #e5e5e5;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  border: 0; border-radius: 999px; padding: .55rem .95rem;
  font: inherit; font-weight: 700; cursor: pointer;
}
.btn-primary { background: var(--brand); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline {
  background: #fff; color: var(--brand); border: 1px solid #ffd2c7;
}
.badge {
  display: inline-block; font-size: .75rem; font-weight: 700;
  background: #fff1ed; color: var(--brand); border-radius: 999px; padding: .1rem .45rem;
}

.toolbar {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
  margin: .5rem 0 1rem;
}
.toolbar select, .search-box input {
  border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem;
  font: inherit; background: #fff;
}

/* ===== Catalog layout: sidebar (desktop) + chips (mobile) ===== */
.page-layout {
  display: block;
  width: 100%;
}
.page-layout__main {
  min-width: 0;
}
.catalog-sidebar {
  display: none;
}
.catalog-sidebar__heading {
  margin: 0 0 .55rem;
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--muted);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.catalog-sidebar__block + .catalog-sidebar__block {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.catalog-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.catalog-sidebar__link {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .6rem;
  border-radius: 10px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  transition: background .12s ease, color .12s ease;
}
.catalog-sidebar__link:hover {
  background: #fff1ed;
  color: var(--brand);
}
.catalog-sidebar__link.is-active {
  background: linear-gradient(135deg, #fff1ed, #ffe4db);
  color: var(--brand);
  font-weight: 800;
  box-shadow: inset 3px 0 0 var(--brand);
}
.catalog-sidebar__ico {
  flex-shrink: 0;
  width: 1.35rem;
  text-align: center;
  font-size: 1.05rem;
}
.catalog-sidebar__sort {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.catalog-sidebar__sort-link {
  display: block;
  padding: .42rem .65rem;
  border-radius: 10px;
  font-size: var(--fs-sm);
  font-weight: 600;
  border: 1px solid transparent;
  color: var(--text);
}
.catalog-sidebar__sort-link:hover {
  background: #f4f6f8;
}
.catalog-sidebar__sort-link.is-active {
  background: #fff;
  border-color: #ffd2c7;
  color: var(--brand);
  font-weight: 800;
}
.catalog-sidebar__search {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.catalog-sidebar__search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .5rem .65rem;
  background: #fff;
}
.catalog-sidebar__search-btn {
  width: 100%;
}

/* มือถือ: dropdown หมวดด้านบน */
.catalog-mobile-bar {
  display: block;
  margin: 0 0 .85rem;
}
.catalog-mobile-bar__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: .5rem;
}
.catalog-mobile-bar__row:has(.catalog-mobile-bar__field--sort) {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}
.catalog-mobile-bar__field {
  display: flex;
  flex-direction: column;
  gap: .28rem;
  min-width: 0;
}
.catalog-mobile-bar__label {
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--muted);
  letter-spacing: .02em;
}
.catalog-mobile-bar__select-wrap {
  position: relative;
  display: block;
  min-width: 0;
}
.catalog-mobile-bar__select-wrap::after {
  content: "";
  position: absolute;
  right: .85rem;
  top: 50%;
  width: .45rem;
  height: .45rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}
.catalog-mobile-bar__select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 44px;
  padding: .55rem 2rem .55rem .75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.catalog-mobile-bar__select:focus {
  outline: 0;
  border-color: #ffb39f;
  box-shadow: 0 0 0 3px rgba(238, 77, 45, .12);
}
/* legacy chips (ปิด) */
.catalog-chips { display: none !important; }
.hero--compact .hero-card {
  padding: .9rem 1rem;
}
.hero--compact h1 {
  font-size: var(--fs-xl);
  margin: .2rem 0 .35rem;
}

@media (min-width: 961px) {
  .page-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
    padding-top: .35rem;
  }
  .catalog-sidebar {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + 12px);
    max-height: none;
    overflow: visible;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .9rem .75rem;
    box-shadow: var(--shadow);
  }
  .catalog-mobile-bar {
    display: none;
  }
  .catalog-chips {
    display: none !important;
  }
  .toolbar--desktop-hide-sort select {
    /* sort อยู่ใน sidebar แล้ว */
  }
}

@media (min-width: 1100px) {
  .page-layout {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 1.5rem;
  }
}
.search-box {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  flex: 1 1 100%;
  min-width: 0;
  width: 100%;
}
.search-box input {
  flex: 1 1 160px;
  min-width: 0;
  width: 100%;
}
.search-box .btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 96px;
}

/* ===== Pagination (mobile-friendly) ===== */
.pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .65rem;
  margin: 1.6rem 0 2.2rem;
  padding: 0 .25rem;
}
.pagination__info {
  font-size: .92rem;
  color: var(--muted);
  text-align: center;
}
.pagination__info strong {
  color: var(--brand);
  font-weight: 800;
}
.pagination__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: 100%;
  max-width: 640px;
}
.pagination__pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .3rem;
}
.pagination__page,
.pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  min-height: 42px;
  min-width: 42px;
  padding: 0 .7rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.pagination__page:hover,
.pagination__btn:hover:not(.is-disabled) {
  border-color: #ffc4b5;
  background: #fff7f5;
  color: var(--brand);
}
.pagination__page:active,
.pagination__btn:active:not(.is-disabled) {
  transform: scale(0.97);
}
.pagination__page.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(238, 77, 45, 0.28);
  pointer-events: none;
}
.pagination__btn--prev,
.pagination__btn--next {
  min-width: auto;
  padding: 0 .9rem;
  color: var(--brand);
  border-color: #ffd2c7;
  background: #fff;
}
.pagination__btn.is-disabled {
  opacity: .4;
  cursor: not-allowed;
  color: var(--muted);
  border-color: var(--line);
  background: #f7f7f7;
  box-shadow: none;
}
.pagination__chev {
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 800;
}
.pagination__ellipsis {
  min-width: 28px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .05em;
}
.pagination__mobile {
  display: none;
  width: 100%;
  max-width: 420px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .5rem;
}
.pagination__mobile .pagination__btn {
  width: 100%;
  min-height: 46px;
  border-radius: 999px;
}
.pagination__mobile .pagination__btn--prev,
.pagination__mobile a.pagination__btn:first-child {
  justify-self: stretch;
}
.pagination__mobile-status {
  font-weight: 800;
  color: var(--brand);
  font-size: .95rem;
  white-space: nowrap;
  text-align: center;
  padding: 0 .35rem;
}

@media (max-width: 640px) {
  .pagination__bar {
    display: none; /* ใช้แถบ compact บนมือถือ */
  }
  .pagination__mobile {
    display: grid;
  }
  .pagination__info {
    font-size: .88rem;
  }
}
@media (min-width: 641px) {
  .pagination__mobile {
    display: none !important;
  }
}
@media (max-width: 380px) {
  .pagination__btn-text {
    /* ปุ่มแคบมาก: เหลือ chevron อย่างเดียวใน bar (bar ซ่อนอยู่แล้วบนมือถือ) */
  }
}

.product-detail {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 1.4rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem; margin: 1rem 0 2rem;
  box-shadow: var(--shadow);
}
.product-detail__img {
  border-radius: 14px; overflow: hidden; background: #fafafa; aspect-ratio: 1;
}
.product-detail__img img { width: 100%; height: 100%; object-fit: cover; }
.product-detail h1 { margin: 0 0 .5rem; font-size: 1.35rem; }
.muted { color: var(--muted); }
.site-footer {
  margin-top: 1.5rem;
  padding: .85rem 0 1rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,247,245,.4) 0%, #fff 55%);
}
.site-footer__inner {
  display: flex;
  justify-content: center;
}
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem .5rem;
  align-items: stretch;
  width: 100%;
}
.site-footer__link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 40px;
  padding: .4rem .85rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  transition: background .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease;
}
.site-footer__link:hover {
  background: #fff7f5;
  border-color: #ffd8cc;
  color: var(--brand);
  box-shadow: 0 4px 12px rgba(238, 77, 45, .08);
}
.site-footer__link.is-active {
  background: linear-gradient(135deg, #fff1ed, #ffe8e0);
  border-color: #ffc9b8;
  color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(238, 77, 45, .06);
}
.site-footer__ico {
  flex-shrink: 0;
  font-size: 1.05em;
  line-height: 1;
}
.empty {
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 2rem; text-align: center; color: var(--muted);
}

/* ===== Product view (9chaichana-style) ===== */
body.view-page {
  background: #f7f3ee;
}
.view-hero {
  padding: 1.25rem 0 1.4rem;
  background: linear-gradient(135deg, #9a2805 0%, #d83607 55%, #ee4d2d 100%);
  color: #fff;
  margin-bottom: 1.1rem;
}
.ViewProduct > .container {
  padding-bottom: .5rem;
}
.view-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-bottom: .7rem;
  font-size: .9rem;
  color: rgba(255,255,255,.88);
}
.view-breadcrumb a { color: rgba(255,255,255,.92); }
.view-breadcrumb a:hover { color: #ffe8b8; }
.view-breadcrumb__sep { opacity: .7; }
.view-hero h1 {
  margin: 0 0 .5rem;
  font-size: clamp(1.2rem, 3.2vw, 1.75rem);
  font-weight: 800;
  line-height: 1.35;
  color: #fff;
  max-width: 50ch;
}
.ViewProduct { padding-bottom: 2rem; }
.view-product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(240px, .75fr);
  gap: clamp(.85rem, 2vw, 1.25rem);
  align-items: start;
}
.view-product-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(.85rem, 2.5vw, 1.25rem);
  box-shadow: var(--shadow);
  min-width: 0;
}
.view-product-main,
.view-product-sidebar {
  min-width: 0;
}
.entry-content { max-width: 100%; }

/* Gallery — รูปใหญ่เต็มคอลัมน์รายละเอียด */
.shopee-aff-gallery {
  width: 100%;
  max-width: min(100%, 820px);
  margin: 0 auto 1.25rem;
}
.shopee-aff-gallery__stage {
  position: relative;
  aspect-ratio: 1 / 1;
  min-height: min(72vw, 420px);
  background: #f5f5f5;
  border-radius: 14px;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}
.shopee-aff-gallery__main {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.shopee-aff-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
}
.shopee-aff-gallery__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}
.shopee-aff-gallery__nav:hover { background: rgba(0,0,0,.6); }
.shopee-aff-gallery__nav--prev { left: 10px; }
.shopee-aff-gallery__nav--next { right: 10px; }
.shopee-aff-gallery__counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 13px;
  pointer-events: none;
}
.shopee-aff-gallery__thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.shopee-aff-gallery__thumb {
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #f5f5f5;
  overflow: hidden;
  cursor: pointer;
}
.shopee-aff-gallery__thumb.is-active { border-color: #ee4d2d; }
.shopee-aff-gallery__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 961px) {
  .shopee-aff-gallery {
    max-width: min(100%, 900px);
  }
  .shopee-aff-gallery__stage {
    min-height: 520px;
    border-radius: 16px;
  }
  .shopee-aff-gallery__thumb {
    flex-basis: 88px;
    width: 88px;
    height: 88px;
  }
  .shopee-aff-gallery__nav {
    width: 46px;
    height: 46px;
  }
}

.shopee-aff-view__meta {
  max-width: 100%;
  margin: 0 0 1rem;
  text-align: left;
}
.shopee-aff-view__meta-row {
  margin: .35rem 0;
  line-height: 1.6;
}
.shopee-aff-view__meta-label {
  font-weight: 700;
  color: var(--text);
  margin-right: .25rem;
}
.shopee-aff-view__meta-label::after { content: ":"; }
.shopee-aff-view__price {
  color: var(--brand);
  font-weight: 800;
  font-size: 1.35rem;
  margin-right: .4rem;
}
.shopee-aff-view__description {
  margin: 1.1rem 0 1.3rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
}
.shopee-aff-view__description h2 {
  margin: 0 0 .6rem;
  font-size: 1.1rem;
}
.shopee-aff-view__description-body {
  line-height: 1.75;
  color: #333;
  font-size: .97rem;
}
.shopee-aff-view__note {
  text-align: center;
  font-size: .9rem;
  color: var(--muted);
  margin-top: 1rem;
}

/* ปุ่มสั่งซื้อในเนื้อหา — แบบ 9chaichana (บังคับโชว์) */
.view-shopee-cta {
  display: block !important;
  visibility: visible !important;
  width: 100%;
  margin: .85rem 0 1.25rem;
  padding: 10px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(216, 54, 7, 0.1);
  box-shadow: 0 8px 28px rgba(216, 54, 7, 0.22);
  box-sizing: border-box;
}
.view-shopee-cta__link {
  display: flex !important;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ee4d2d 0%, #ff6b35 100%) !important;
  color: #fff !important;
  text-decoration: none !important;
  transition: transform .2s ease, box-shadow .2s ease;
  box-sizing: border-box;
}
.view-shopee-cta__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(238, 77, 45, 0.38);
  color: #fff !important;
}
.view-shopee-cta__icon {
  display: flex !important;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.view-shopee-cta__icon img,
.view-shopee-cta__icon svg {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  display: block !important;
}
.view-shopee-cta__text {
  display: flex !important;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  color: #fff !important;
}
.view-shopee-cta__title {
  font-size: clamp(1rem, 3.5vw, 1.15rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.01em;
  word-break: break-word;
  color: #fff !important;
}
.view-shopee-cta__sub {
  font-size: .88rem;
  font-weight: 500;
  line-height: 1.35;
  opacity: .95;
  color: #fff !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.view-shopee-cta__arrow {
  flex-shrink: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff !important;
}
.shopee-aff-view__note { display: none; }

/* ===== แถบลอย Shopee อย่างเดียว — ไม่มีกรอบนอก ===== */
body {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
}
.site-float-shopee {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  z-index: 99999 !important;
  display: block !important;
  width: 100% !important;
  max-width: 100vw !important;
  margin: 0 !important;
  padding: 0 0 env(safe-area-inset-bottom, 0px) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  transform: none !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
.site-float-shopee__link {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  min-height: 56px !important;
  padding: 12px 14px !important;
  border-radius: 0 !important;
  border: 0 !important;
  background: linear-gradient(135deg, #ee4d2d 0%, #ff6b35 100%) !important;
  color: #fff !important;
  text-decoration: none !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  -webkit-tap-highlight-color: transparent;
}
.site-float-shopee__link:hover,
.site-float-shopee__link:active {
  color: #fff !important;
}
.site-float-shopee__icon {
  display: flex !important;
  flex-shrink: 0 !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.site-float-shopee__icon img {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  display: block !important;
  object-fit: contain !important;
}
.site-float-shopee__text {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  gap: 2px !important;
  min-width: 0 !important;
  color: #fff !important;
}
.site-float-shopee__title {
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
  color: #fff !important;
}
.site-float-shopee__sub {
  font-size: .88rem !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  color: #fff !important;
  opacity: .95 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.site-float-shopee__arrow {
  flex-shrink: 0 !important;
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  color: #fff !important;
}

/* Desktop — ไม่แสดงหน้าต่างลอย */
@media (min-width: 961px) {
  body {
    padding-bottom: var(--safe-bottom) !important;
  }
  .site-float-shopee {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
  }
}

.view-sidebar-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 72px;
}
.view-sidebar-card__title {
  margin: 0 0 .8rem;
  font-size: 1.05rem;
}
.view-related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .65rem;
}
.view-related-item__link {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: .65rem;
  align-items: start;
}
.view-related-item__img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: #f3f4f6;
}
.view-related-item__img--empty { display: block; }
.view-related-item__name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.35;
}
.view-related-item__price {
  display: block;
  color: var(--brand);
  font-weight: 800;
  margin-top: .15rem;
}
.view-related-item__meta {
  display: block;
  color: var(--muted);
  font-size: .8rem;
}
.view-sidebar-more {
  display: inline-block;
  margin-top: .9rem;
  color: var(--brand);
  font-weight: 700;
  font-size: .92rem;
}

/* Product reviews (best-effort from Shopee) */
.product-reviews {
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}
.product-reviews__title {
  margin: 0 0 .6rem;
  font-size: 1.1rem;
}
.product-reviews__summary {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .9rem;
}
.product-reviews__summary-text {
  color: var(--muted);
  font-size: .9rem;
}
.product-reviews__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .85rem;
}
.product-reviews__item {
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .8rem .9rem;
}
.product-reviews__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .7rem;
  margin-bottom: .35rem;
}
.product-reviews__author { font-size: .95rem; }
.product-reviews__time {
  color: var(--muted);
  font-size: .8rem;
  margin-left: auto;
}
.product-reviews__comment {
  margin: .25rem 0 0;
  line-height: 1.6;
  font-size: .95rem;
  color: #333;
  white-space: pre-wrap;
}
.product-reviews__imgs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .55rem;
}
.product-reviews__imgs img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #eee;
}
.product-reviews__empty {
  background: #fff8f6;
  border: 1px dashed #ffd2c7;
  border-radius: 12px;
  padding: .9rem 1rem;
  color: #5c6570;
}
.product-reviews__empty p { margin: .2rem 0; }
.product-reviews__hint { font-size: .88rem; }
.star-rating--sm .star-rating__star { font-size: .85rem; }

/* ===== Responsive breakpoints ===== */

/* Large tablets / small laptops */
@media (max-width: 1024px) {
  .view-product-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, .9fr);
  }
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  }
}

/* Tablets / phones: compact header + ห่างขอบมากขึ้น */
@media (max-width: 960px) {
  :root {
    --header-h: 56px;
    --pad-x: max(1rem, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  }

  .container {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }

  .site-header {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }
  /* กัน padding ซ้อน: header มีขอบแล้ว ข้างในไม่ซ้ำ */
  .site-header .container.site-header__inner,
  .site-header .site-header__inner {
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100%;
  }
  .site-header__inner--search {
    gap: .45rem .55rem;
    min-height: var(--header-h);
    padding-top: .35rem;
    padding-bottom: .35rem;
  }

  .logo-text {
    max-width: min(22vw, 96px);
    font-size: var(--fs-sm);
  }
  .logo-badge {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: .95rem;
  }
  .header-search {
    max-width: none;
    padding: .18rem .28rem .18rem .5rem;
  }
  .header-search__submit {
    padding: .38rem .55rem;
    font-size: var(--fs-xs);
  }
  .header-home {
    padding: .35rem .55rem;
    font-size: var(--fs-xs);
    min-height: 34px;
  }
  .catalog-mobile-bar {
    margin-top: .15rem;
    margin-bottom: 1rem;
  }

  .view-product-layout { grid-template-columns: 1fr; }
  .view-sidebar-card { position: static; }
  .product-detail { grid-template-columns: 1fr; }

  .section-title {
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem .75rem;
    margin: 1.25rem 0 .7rem;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar select {
    width: 100%;
    min-height: 46px;
    font-size: var(--fs-base);
  }
  .toolbar .btn-outline {
    width: 100%;
    text-align: center;
    min-height: 46px;
    font-size: var(--fs-base);
  }
}

/* Phones */
@media (max-width: 640px) {
  :root {
    --header-h: 52px;
    --fs-base: .92rem;
    --fs-sm: .84rem;
    --fs-md: .95rem;
    --fs-lg: 1.08rem;
    --fs-xl: 1.18rem;
    --fs-2xl: 1.32rem;
    --fs-nav-mobile: 1.04rem;
  }

  .container {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }

  .site-header {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }
  .site-header__inner {
    min-height: var(--header-h);
    padding: .4rem 0;
    gap: .4rem;
  }
  .logo-text {
    max-width: min(20vw, 72px);
    font-size: .9rem;
  }
  .header-search__submit {
    padding: .35rem .5rem;
  }
  .header-home {
    padding: .32rem .5rem;
  }

  .hero { padding: 1rem 0 .75rem; }
  .hero-card {
    padding: .95rem .9rem 1.05rem;
    border-radius: 14px;
  }
  .hero-card::before {
    width: 120px;
    height: 120px;
  }
  .hero-badge {
    font-size: var(--fs-xs);
    padding: .2rem .55rem;
  }
  .checklist li {
    align-items: flex-start;
    font-size: var(--fs-sm);
    line-height: 1.4;
    gap: .45rem;
  }

  .cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
  }
  .cat-card { padding: .8rem .7rem; }
  .cat-card__icon { font-size: 1.35rem; }
  .cat-card__title {
    font-size: var(--fs-sm);
    font-weight: 800;
    line-height: 1.3;
  }
  .cat-card__count { font-size: var(--fs-xs); }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
  }
  .product-card__body {
    padding: .5rem .5rem .65rem;
    gap: .25rem;
  }
  .product-card__name {
    font-size: .8rem;
    min-height: 2.25em;
    line-height: 1.32;
  }
  .product-card__price {
    font-size: .9rem;
  }
  .product-card__sold,
  .star-rating__num { font-size: .72rem; }
  .star-rating__star { font-size: .78rem; }
  .badge {
    font-size: .68rem;
    padding: .08rem .35rem;
  }
  .btn {
    min-height: 40px;
    padding: .45rem .6rem;
    font-size: .84rem;
  }

  .view-hero {
    padding: 1rem 0 1.1rem;
    margin-bottom: .9rem;
  }
  .view-hero h1 {
    font-size: clamp(1.02rem, 4.4vw, 1.28rem);
    max-width: none;
    line-height: 1.32;
  }
  .view-breadcrumb {
    font-size: .78rem;
    gap: .22rem;
    line-height: 1.35;
  }
  .view-product-panel {
    border-radius: 14px;
    padding: .75rem;
  }
  .shopee-aff-view__meta-row {
    font-size: var(--fs-sm);
  }
  .shopee-aff-view__price { font-size: 1.15rem; }
  .shopee-aff-view__description h2 {
    font-size: var(--fs-md);
  }
  .shopee-aff-view__description-body {
    font-size: var(--fs-sm);
    line-height: 1.65;
  }

  .view-sidebar-card__title {
    font-size: var(--fs-md);
  }
  .view-related-item__name {
    font-size: var(--fs-sm);
  }
  .view-related-item__price {
    font-size: var(--fs-sm);
  }

  .shopee-aff-gallery__stage {
    min-height: min(88vw, 380px);
  }
  .shopee-aff-gallery__nav {
    width: 40px;
    height: 40px;
  }
  .shopee-aff-gallery__thumb {
    flex-basis: 68px;
    width: 68px;
    height: 68px;
  }

  .pagination__info {
    font-size: var(--fs-sm);
  }
  .pagination__mobile .pagination__btn {
    min-height: 44px;
    font-size: var(--fs-sm);
  }

  .site-footer {
    margin-top: 1rem;
    padding: .75rem 0 calc(.9rem + var(--safe-bottom));
  }
  .site-footer__links {
    gap: .3rem;
  }
  .site-footer__link {
    min-height: 36px;
    padding: .32rem .6rem;
    font-size: var(--fs-xs);
    border-radius: 10px;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  :root {
    --fs-base: .9rem;
    --fs-2xl: 1.22rem;
  }
  .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: .4rem;
  }
  .cat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .logo-text {
    max-width: 18vw;
    font-size: .85rem;
  }
  .header-search__submit {
    /* มือถือจอแคบ: ย่อปุ่ม */
    font-size: .72rem;
    padding: .32rem .42rem;
  }
  .product-card__name { font-size: .76rem; }
  .product-card__price { font-size: .86rem; }
  .btn { font-size: .8rem; min-height: 38px; }
}

/* Desktop: เนื้อหา 90% + เมนูบนห่างขอบชัด */
@media (min-width: 961px) {
  :root {
    --header-h: 64px;
    --pad-x: clamp(1.1rem, 2vw, 2rem);
  }
  .container {
    width: 90%;
    max-width: none;
  }

  .site-header {
    padding-left: max(1.25rem, calc((100vw - 90vw) / 2));
    padding-right: max(1.25rem, calc((100vw - 90vw) / 2));
  }
  .site-header .container.site-header__inner,
  .site-header .site-header__inner {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: .55rem 0 !important;
    gap: .85rem 1.1rem;
  }
  .logo {
    gap: .6rem;
  }
  .logo-badge {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 1.05rem;
  }
  .logo-text {
    max-width: none;
    font-size: 1.05rem;
  }
  .header-search {
    max-width: min(560px, 46vw);
    min-height: 46px;
    padding: .22rem .35rem .22rem .75rem;
  }
  .header-search__input {
    font-size: .95rem;
    padding: .5rem .3rem;
  }
  .header-search__submit {
    min-height: 38px;
    padding: .45rem 1.05rem;
    font-size: .92rem;
  }
  .header-home {
    min-height: 42px;
    padding: .45rem 1.05rem;
    font-size: .95rem;
  }
}

/* Large desktop — ยังคง 5 การ์ดเต็มจอ */
@media (min-width: 1200px) {
  .product-grid,
  .product-grid--featured,
  .product-grid--category,
  .product-grid--home {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
  }
}

/* Hover only where supported (not touch-primary) */
@media (hover: none) {
  .product-card:hover,
  .cat-card:hover,
  .view-shopee-cta__link:hover {
    transform: none;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print */
@media print {
  .site-header, .pagination, .view-shopee-cta, .site-footer {
    display: none !important;
  }
  body { background: #fff; }
}

/* =========================================================
   Aff-Shopee — Shopee-like UI overrides (v50)
   ========================================================= */
:root {
  --bg: #f5f5f5;
  --card: #fff;
  --text: #222;
  --muted: #757575;
  --brand: #ee4d2d;
  --brand-dark: #d73211;
  --brand-soft: #fff5f1;
  --ok: #26aa99;
  --line: #e8e8e8;
  --shadow: 0 1px 2px rgba(0,0,0,.08);
  --radius: 2px;
  --header-h: 84px;
  --font: "Sarabun", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(72px + var(--safe-bottom));
}

/* ===== Shopee orange header ===== */
.site-header {
  background: linear-gradient(90deg, #ee4d2d 0%, #ff7337 100%);
  border-bottom: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 1px 1px rgba(0,0,0,.08);
}
.site-header__inner--search {
  min-height: 72px;
  padding: .65rem 0;
  gap: .75rem 1rem;
}
.logo {
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  text-decoration: none;
}
.logo:hover { opacity: .96; }
.logo-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: block;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .14);
  background: #fff;
}
.logo-wordmark {
  display: flex;
  flex-direction: column;
  gap: .05rem;
  min-width: 0;
  line-height: 1.15;
}
.logo-wordmark__name {
  color: #fff;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(34vw, 160px);
}
.logo-wordmark__tag {
  color: rgba(255, 255, 255, .88);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(34vw, 160px);
}
/* legacy */
.logo-text { color: #fff; font-weight: 800; }
.logo-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
  display: none;
}

.header-search {
  max-width: 740px;
  background: #fff;
  border: 0;
  border-radius: 2px;
  box-shadow: none;
  padding: .2rem .2rem .2rem .75rem;
  gap: .25rem;
}
.header-search:focus-within {
  border-color: transparent;
  box-shadow: 0 0 0 2px rgba(255,255,255,.35);
}
.header-search__ico { display: none; }
.header-search__input {
  padding: .55rem .35rem;
  font-size: .95rem;
}
.header-search__input::placeholder { color: #bbb; }
.header-search__submit {
  border-radius: 2px;
  background: var(--brand);
  padding: .5rem 1.1rem;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.header-search__submit:hover { background: var(--brand-dark); }
.header-search__submit-ico { font-size: .95rem; line-height: 1; }
@media (max-width: 520px) {
  .header-search__submit-txt { display: none; }
  .header-search__submit { padding: .5rem .7rem; }
  .logo-mark { width: 34px; height: 34px; border-radius: 9px; }
  .logo-wordmark__name { font-size: .98rem; max-width: min(30vw, 110px); }
  .logo-wordmark__tag { display: none; }
}
@media (max-width: 380px) {
  .logo-wordmark__name { max-width: 88px; }
}

.header-home {
  color: #fff;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 2px;
  gap: .3rem;
  min-height: 40px;
}
.header-home:hover,
.header-home.is-active {
  background: #fff;
  color: var(--brand);
}
.header-home__txt { font-size: .88rem; }
@media (max-width: 640px) {
  .header-home__txt { display: none; }
}

/* ===== Category icon grid (Shopee style) ===== */
.shopee-cats {
  background: #fff;
  border-radius: 2px;
  box-shadow: var(--shadow);
  margin: .85rem 0 1rem;
  padding: .75rem .4rem .9rem;
}
.shopee-cats__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .35rem .15rem;
}
@media (min-width: 640px) {
  .shopee-cats__grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
@media (min-width: 961px) {
  .shopee-cats__grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .55rem .25rem; }
}
@media (min-width: 1200px) {
  .shopee-cats__grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
.shopee-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: .45rem .25rem;
  text-align: center;
  color: var(--text);
  border-radius: 2px;
  transition: background .12s ease, color .12s ease;
  min-width: 0;
}
.shopee-cat:hover {
  background: var(--brand-soft);
  color: var(--brand);
}
.shopee-cat.is-preferred .shopee-cat__icon {
  border-color: #ee4d2d;
  box-shadow: 0 0 0 2px rgba(238, 77, 45, .15);
}
.shopee-cat.is-preferred .shopee-cat__name {
  color: var(--brand);
  font-weight: 700;
}
.shopee-cat__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  background: linear-gradient(180deg, #fff7f5 0%, #ffe8e0 100%);
  border: 1px solid #ffd8cc;
  box-shadow: 0 1px 2px rgba(238,77,45,.08);
}
.shopee-cat__name {
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
}
.shopee-cat__count {
  font-size: .65rem;
  color: var(--muted);
  font-weight: 600;
}

/* Section headers */
.shopee-section {
  margin: 0 0 1.15rem;
}
.shopee-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  padding: .75rem 1rem;
  border-radius: 2px 2px 0 0;
  box-shadow: var(--shadow);
}
.shopee-section__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.shopee-section__tag {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: #fff;
  background: var(--brand);
  padding: .2rem .45rem;
  border-radius: 2px;
}
.shopee-section__more {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
}
.shopee-section__more:hover { color: var(--brand); }
.shopee-section .product-grid {
  background: transparent;
  border-radius: 0 0 2px 2px;
}

/* ===== Product grid — Shopee density ===== */
.product-grid,
.product-grid--featured,
.product-grid--category,
.product-grid--home {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .4rem;
}
.product-grid--home > .product-card:nth-child(n+7) { display: flex; }
.product-grid--category > .product-card:nth-child(n+17) { display: flex; }
@media (min-width: 640px) {
  .product-grid,
  .product-grid--featured,
  .product-grid--category,
  .product-grid--home {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
  }
}
@media (min-width: 961px) {
  .product-grid,
  .product-grid--featured,
  .product-grid--category,
  .product-grid--home {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .55rem;
  }
  .product-grid--category > .product-card:nth-child(n+16) { display: flex; }
  .product-grid--home > .product-card:nth-child(n+6) { display: flex; }
}
@media (min-width: 1200px) {
  .product-grid,
  .product-grid--featured,
  .product-grid--category,
  .product-grid--home {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* ===== Product card — Shopee ===== */
.product-card {
  background: #fff;
  border: 0;
  border-radius: 2px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease;
  position: relative;
}
.product-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  z-index: 1;
}
.product-card__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
  min-width: 0;
}
.product-card__img {
  aspect-ratio: 1;
  background: #fafafa;
  position: relative;
  overflow: hidden;
}
.product-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-card__discount {
  position: absolute;
  top: 0;
  right: 0;
  background: #feee69;
  color: var(--brand);
  font-size: .72rem;
  font-weight: 800;
  padding: .2rem .35rem .35rem;
  line-height: 1.1;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 85%, 0 100%);
  min-width: 2.2rem;
  text-align: center;
}
.product-card__mall,
.product-card__preferred {
  position: absolute;
  left: 0;
  top: .4rem;
  font-size: .65rem;
  font-weight: 800;
  color: #fff;
  padding: .12rem .35rem;
  border-radius: 0 2px 2px 0;
  letter-spacing: .02em;
}
.product-card__mall { background: #d0011b; }
.product-card__preferred { background: #ee4d2d; }
.product-card__body {
  padding: .5rem .55rem .55rem;
  display: flex;
  flex-direction: column;
  gap: .28rem;
  flex: 1;
}
.product-card__name {
  font-size: .82rem;
  font-weight: 400;
  line-height: 1.35;
  color: #222;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.2em;
}
.product-card__price-row {
  display: flex;
  align-items: baseline;
  gap: .35rem;
  flex-wrap: wrap;
  margin-top: .1rem;
}
.product-card__price {
  color: var(--brand);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.2;
}
.product-card__price-orig {
  color: #bbb;
  font-size: .75rem;
  text-decoration: line-through;
}
.product-card__rating-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .2rem .4rem;
  margin-top: auto;
}
.product-card__sold {
  color: var(--muted);
  font-size: .72rem;
}
.product-card__buy {
  display: block;
  text-align: center;
  background: var(--brand);
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  padding: .45rem .5rem;
  border-top: 1px solid rgba(255,255,255,.15);
  opacity: 1;
  max-height: none;
  overflow: visible;
}
.product-card__buy:hover {
  background: var(--brand-dark);
}
.product-card .badge { display: none; }
.product-card__actions { display: none; }

.star-rating__star { font-size: .78rem; width: .82em; }
.star-rating__star.is-full { color: #ee4d2d; }
.star-rating__num { font-size: .72rem; color: #ee4d2d; }

/* Category banner */
.cat-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
  background: #fff;
  border-radius: 2px;
  box-shadow: var(--shadow);
  padding: .85rem 1rem;
  margin: .85rem 0 .75rem;
}
.cat-banner__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: linear-gradient(180deg, #fff7f5, #ffe8e0);
  border: 1px solid #ffd8cc;
  flex-shrink: 0;
}
.cat-banner__text { flex: 1 1 160px; min-width: 0; }
.cat-banner__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.cat-banner__lead {
  margin: .2rem 0 0;
  color: var(--muted);
  font-size: .88rem;
}
.cat-banner__shopee {
  width: auto;
  border-radius: 2px;
  padding: .55rem 1rem;
  white-space: nowrap;
}

/* Layout home: no sidebar */
.page-layout--home,
body.page-home .page-layout {
  display: block;
}
body.page-home .catalog-sidebar,
body.page-home .catalog-mobile-bar {
  display: none !important;
}

/* Desktop sidebar tighter for 21 cats */
@media (min-width: 961px) {
  .page-layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .catalog-sidebar {
    border-radius: 2px;
    box-shadow: var(--shadow);
    border: 0;
    max-height: none;
    overflow: visible;
  }
  .catalog-sidebar__link {
    border-radius: 2px;
    padding: .4rem .5rem;
    font-size: .85rem;
  }
  .catalog-sidebar__link.is-active {
    box-shadow: inset 3px 0 0 var(--brand);
    background: var(--brand-soft);
  }
}
@media (min-width: 1100px) {
  .page-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

/* Footer */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  margin-top: 1.25rem;
  padding: 1rem 0 1.25rem;
}
.site-footer__inner {
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}
.site-footer__link {
  border-radius: 2px;
  box-shadow: none;
  border: 1px solid var(--line);
  font-size: .82rem;
}
.site-footer__link.is-active {
  background: var(--brand-soft);
  border-color: #ffc9b8;
  color: var(--brand);
}
.site-footer__note {
  margin: 0;
  font-size: .75rem;
  color: var(--muted);
  text-align: center;
}

/* Buttons */
.btn { border-radius: 2px; }
.btn-primary { background: var(--brand); }
.btn-outline { border-radius: 2px; }

/* Container max width like Shopee */
@media (min-width: 961px) {
  .container {
    max-width: 1200px;
    width: 90%;
  }
}
@media (min-width: 1300px) {
  .container { max-width: 1200px; }
}

/* Empty / misc */
.empty {
  border-radius: 2px;
  border: 0;
  box-shadow: var(--shadow);
}
.pagination__page,
.pagination__btn {
  border-radius: 2px;
}
.pagination__page.is-active {
  background: var(--brand);
}

/* Mobile header height */
@media (max-width: 640px) {
  .site-header__inner--search {
    min-height: 64px;
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  :root { --header-h: 72px; }
}

/* =========================================================
   Product page — Shopee-like (v54)
   ========================================================= */
body.sp-product-page,
body.view-page.sp-product-page {
  background: #f5f5f5 !important;
}
body.sp-product-page .view-hero { display: none !important; }

.sp-product {
  padding: .75rem 0 2rem;
}
.sp-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem .4rem;
  margin: 0 0 .75rem;
  font-size: .82rem;
  color: #0000008a;
  line-height: 1.4;
}
.sp-breadcrumb a {
  color: #000000de;
  text-decoration: none;
}
.sp-breadcrumb a:hover { color: var(--brand); }
.sp-breadcrumb__sep { color: #00000042; font-size: .75rem; }
.sp-breadcrumb__current {
  color: #0000008a;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Main product card: gallery | info */
.sp-product__main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 1px 1px rgba(0,0,0,.05);
  padding: .85rem;
  margin-bottom: .75rem;
}
@media (min-width: 961px) {
  .sp-product__main {
    grid-template-columns: minmax(0, 450px) minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1rem 1.25rem 1.25rem;
    align-items: start;
  }
}

/* Gallery */
.sp-product__gallery {
  min-width: 0;
}
.sp-product-page .shopee-aff-gallery {
  max-width: 100%;
  margin: 0;
}
.sp-product-page .shopee-aff-gallery__stage {
  aspect-ratio: 1 / 1;
  min-height: 0;
  border-radius: 2px;
  background: #fff;
  border: 1px solid #f0f0f0;
}
.sp-product-page .shopee-aff-gallery__main img {
  object-fit: contain;
}
.sp-product-page .shopee-aff-gallery__nav {
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,.25);
  font-size: 1.25rem;
  opacity: 0;
  transition: opacity .15s ease, background .15s ease;
}
.sp-product-page .shopee-aff-gallery:hover .shopee-aff-gallery__nav,
.sp-product-page .shopee-aff-gallery__nav:focus {
  opacity: 1;
}
.sp-product-page .shopee-aff-gallery__nav:hover { background: rgba(0,0,0,.45); }
.sp-product-page .shopee-aff-gallery__counter {
  border-radius: 2px;
  font-size: .75rem;
  padding: 3px 8px;
  background: rgba(0,0,0,.4);
}
.sp-product-page .shopee-aff-gallery__thumbs {
  gap: 8px;
  margin-top: 10px;
  justify-content: flex-start;
}
.sp-product-page .shopee-aff-gallery__thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 2px;
  border: 2px solid transparent;
  background: #fff;
}
.sp-product-page .shopee-aff-gallery__thumb.is-active {
  border-color: #ee4d2d;
}
.sp-product-page .shopee-aff-gallery__thumb:hover {
  border-color: #ee4d2d;
}

/* Info column */
.sp-product__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: .35rem;
}
@media (min-width: 961px) {
  .sp-product__info { padding-top: 0; }
}

.sp-product__badges {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: .4rem;
}
.sp-badge {
  display: inline-flex;
  align-items: center;
  font-size: .7rem;
  font-weight: 700;
  padding: .1rem .35rem;
  border-radius: 2px;
  color: #fff;
  line-height: 1.3;
  letter-spacing: .02em;
}
.sp-badge--mall { background: #d0011b; }
.sp-badge--preferred { background: #ee4d2d; }

.sp-product__title {
  margin: 0 0 .65rem;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 500;
  line-height: 1.4;
  color: #222;
  word-break: break-word;
}

/* Rating + sold row */
.sp-product__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem 1rem;
  margin-bottom: .85rem;
  padding-bottom: .15rem;
}
.sp-product__rating {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.sp-product__rating:hover { border-bottom-color: #ee4d2d; }
.sp-product__rating-num {
  color: #ee4d2d;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sp-product__stats-div {
  width: 1px;
  height: 1rem;
  background: #e8e8e8;
}
.sp-product__sold {
  display: inline-flex;
  align-items: baseline;
  gap: .35rem;
  color: #222;
}
.sp-product__sold-num {
  font-size: 1rem;
  font-weight: 500;
}
.sp-product__sold-label {
  font-size: .85rem;
  color: #767676;
}

/* Price box — Shopee pink gradient */
.sp-product__price-box {
  background: #fafafa;
  background-image: linear-gradient(90deg, #fff5f1 0%, #fafafa 100%);
  padding: 1rem 1.1rem;
  margin: 0 0 1rem;
  border-radius: 2px;
}
.sp-product__price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
}
.sp-product__price-orig {
  color: #929292;
  font-size: 1rem;
  text-decoration: line-through;
}
.sp-product__price {
  color: #ee4d2d;
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  font-weight: 500;
  line-height: 1.2;
}
.sp-product__discount {
  background: #ee4d2d;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: .15rem .4rem;
  border-radius: 2px;
  line-height: 1.2;
}

/* Attributes */
.sp-product__attrs {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  margin-bottom: 1.25rem;
}
.sp-product__attr {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: .5rem 1rem;
  align-items: start;
  font-size: .9rem;
  line-height: 1.45;
}
@media (max-width: 480px) {
  .sp-product__attr {
    grid-template-columns: 88px minmax(0, 1fr);
  }
}
.sp-product__attr-label {
  color: #757575;
  font-weight: 400;
}
.sp-product__attr-val {
  color: #222;
  min-width: 0;
  word-break: break-word;
}
.sp-product__attr-val a { color: #05a; }
.sp-product__attr-val a:hover { color: var(--brand); }
.sp-product__attr-hint {
  color: #757575;
  font-size: .85rem;
}

/* Action buttons — Shopee style */
.sp-product__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: auto;
  padding-top: .25rem;
}
.sp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 48px;
  padding: .65rem 1.25rem;
  border-radius: 2px;
  font-size: .95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  transition: opacity .12s ease, background .12s ease;
  flex: 1 1 auto;
  min-width: 140px;
  box-sizing: border-box;
}
.sp-btn__ico { font-size: 1.1rem; line-height: 1; }
.sp-btn--cart {
  background: #fff5f1;
  color: #ee4d2d;
  border: 1px solid #ee4d2d;
}
.sp-btn--cart:hover {
  background: #ffece6;
  color: #ee4d2d;
}
.sp-btn--buy {
  background: #ee4d2d;
  color: #fff;
  flex: 1.2 1 auto;
}
.sp-btn--buy:hover {
  background: #d73211;
  color: #fff;
}
@media (min-width: 640px) {
  .sp-btn {
    flex: 0 1 auto;
    min-width: 180px;
    padding: .7rem 1.75rem;
  }
  .sp-btn--buy { min-width: 200px; }
}

/* Shop card */
.sp-shop {
  display: flex;
  align-items: center;
  gap: .85rem;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 1px 1px rgba(0,0,0,.05);
  padding: 1rem 1.15rem;
  margin-bottom: .75rem;
}
.sp-shop__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ee4d2d, #ff8a65);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}
.sp-shop__body { flex: 1; min-width: 0; }
.sp-shop__name {
  font-size: .95rem;
  font-weight: 500;
  color: #222;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
}
.sp-shop__meta {
  margin-top: .25rem;
  font-size: .82rem;
  color: #757575;
}
.sp-shop__cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: .4rem .9rem;
  border: 1px solid #ee4d2d;
  color: #ee4d2d;
  background: #fff;
  border-radius: 2px;
  font-size: .85rem;
  font-weight: 500;
  white-space: nowrap;
}
.sp-shop__cta:hover {
  background: #fff5f1;
}

/* Generic white panels */
.sp-panel {
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 1px 1px rgba(0,0,0,.05);
  padding: 1rem 1.15rem 1.25rem;
  margin-bottom: .75rem;
}
.sp-panel__title {
  margin: 0 0 .9rem;
  font-size: 1.1rem;
  font-weight: 500;
  color: #222;
  text-transform: uppercase;
  letter-spacing: .02em;
  padding-bottom: .65rem;
  border-bottom: 1px solid #f0f0f0;
}

/* Description specs table */
.sp-desc__specs {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f0f0f0;
}
.sp-desc__spec {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: .4rem 1rem;
  font-size: .9rem;
  line-height: 1.45;
}
.sp-desc__spec-label { color: #757575; }
.sp-desc__spec-val { color: #222; word-break: break-word; }
.sp-desc__spec-val a { color: #05a; }
.sp-desc__body {
  font-size: .9rem;
  line-height: 1.7;
  color: #000000de;
  word-break: break-word;
  white-space: pre-wrap;
}
.sp-desc__body br + br { display: block; content: ""; margin-top: .35rem; }

/* Reviews panel */
.sp-reviews .shopee-reviews,
.sp-reviews .product-reviews,
.sp-reviews h2,
.sp-reviews h3 {
  margin-top: 0;
}
.sp-product-page .sp-reviews .sp-panel__title,
.sp-product-page .sp-reviews > h2:first-child {
  /* reviews section may render its own heading */
}

/* Related */
.sp-related__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .25rem;
}
.sp-related__head .sp-panel__title {
  margin-bottom: .65rem;
  border-bottom: 0;
  padding-bottom: 0;
  text-transform: none;
  color: #ee4d2d;
  font-weight: 500;
}
.sp-related__more {
  color: #ee4d2d;
  font-size: .9rem;
  font-weight: 500;
  white-space: nowrap;
  margin-bottom: .65rem;
}
.sp-related .product-grid--related {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .4rem;
}
@media (min-width: 640px) {
  .sp-related .product-grid--related {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 961px) {
  .sp-related .product-grid--related {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* Hide old sidebar layout remnants if any */
.sp-product-page .view-product-sidebar,
.sp-product-page .view-hero {
  display: none !important;
}

/* Mobile tweaks */
@media (max-width: 960px) {
  .sp-product { padding-top: .5rem; }
  .sp-product__main { padding: .65rem; }
  .sp-product__price-box { padding: .85rem .9rem; margin-left: -.15rem; margin-right: -.15rem; }
  .sp-product__actions {
    position: sticky;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    z-index: 20;
    background: #fff;
    margin: .5rem -.65rem -.65rem;
    padding: .65rem;
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 -2px 8px rgba(0,0,0,.04);
  }
  .sp-product-page .shopee-aff-gallery__nav { opacity: 1; }
}

/* Desktop: hide mobile float is already handled; ensure buy buttons stay visible */
@media (min-width: 961px) {
  .sp-product__actions {
    position: static;
    box-shadow: none;
    border-top: 0;
    margin: 0;
    padding: .25rem 0 0;
    background: transparent;
  }
}
