/* =================================================================
   PEVLO — Single product page (compact, image-first)
================================================================= */
.page-product .breadcrumb {
  padding: 10px 0;
}

.pd-section {
  padding: 8px 0 32px;
}

.pd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

/* ---------- Gallery ---------- */
.pd-gallery {
  position: sticky;
  top: calc(var(--header-height, 80px) + 12px);
  display: grid;
  gap: 10px;
}

.pd-main {
  position: relative;
  aspect-ratio: 1 / 1;
  max-height: calc(100vh - var(--header-height, 80px) - 120px);
  min-height: 320px;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: #f3f5f9;
  border: 1px solid var(--border);
}

html[data-theme="dark"] .pd-main {
  background: #0e1531;
}

.pd-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .15s ease, transform .5s ease;
}

.pd-main img.is-fading {
  opacity: 0;
}

.pd-main:hover img {
  transform: scale(1.04);
}

.pd-off {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 5px 10px;
  border-radius: 9px;
  font-size: .82rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #f43f5e, #ef4444);
  box-shadow: 0 6px 14px rgba(239, 68, 68, .3);
}

.pd-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
}

.pd-thumbs::-webkit-scrollbar {
  display: none;
}

.pd-thumb {
  flex: none;
  width: 64px;
  height: 64px;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--bg-card);
  cursor: pointer;
  opacity: .7;
  transition: border-color .15s, opacity .15s;
}

.pd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pd-thumb:hover,
.pd-thumb.active {
  opacity: 1;
  border-color: var(--primary);
}

/* ---------- Info ---------- */
.pd-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.pd-ic {
  flex: none;
  display: inline-block;
  vertical-align: middle;
}

.pd-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pd-cat {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--primary);
  text-decoration: none;
}

html[data-theme="dark"] .pd-cat {
  color: #8fb0ff;
}

.pd-rate {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .82rem;
  color: var(--text-muted);
  text-decoration: none;
}

.pd-rate b {
  color: var(--text-main);
}

.pd-rate__star {
  display: inline-flex;
  color: #f5b301;
}

.pd-rate__star svg {
  fill: currentColor;
}

.pd-rate__star.is-empty {
  color: var(--text-muted);
}

.pd-rate__star.is-empty svg {
  fill: none;
}

.pd-rate:hover {
  color: var(--primary);
}

.pd-title.product-title {
  margin: -4px 0 0;
  font-size: clamp(1.3rem, 1.1rem + .8vw, 1.75rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-heading, var(--text-main));
}

.pd-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.pd-price .product-current-price {
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1;
  color: var(--secondary);
  letter-spacing: -.01em;
}

.pd-price__old {
  font-size: 1rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.pd-price__save {
  padding: 3px 9px;
  border-radius: 7px;
  font-size: .76rem;
  font-weight: 800;
  color: #16a34a;
  background: rgba(22, 163, 74, .12);
}

html[data-theme="dark"] .pd-price__save {
  color: #34d399;
  background: rgba(52, 211, 153, .12);
}

.pd-short {
  margin: 0;
  font-size: .9rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.pd-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--secondary);
}

/* ---------- Colour / size ---------- */
.pd-vars {
  display: grid;
  gap: 12px;
  padding: 2px;
  border-radius: 12px;
  transition: box-shadow .2s;
}

.pd-vars.needs-attention {
  box-shadow: 0 0 0 2px var(--warning, #f59e0b);
  animation: pcShake .45s ease;
}

.pd-opt__label {
  margin-bottom: 7px;
  font-size: .82rem;
  color: var(--text-muted);
}

.pd-opt__label b {
  color: var(--text-heading, var(--text-main));
  font-weight: 700;
}

.pd-opt__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pd-swatch {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 3px solid var(--bg-card);
  outline: 1px solid var(--border);
  background: var(--sw, #ccc);
  cursor: pointer;
  transition: transform .15s, outline-color .15s;
}

.pd-swatch:hover {
  transform: scale(1.08);
}

.pd-swatch.is-on {
  outline: 2px solid var(--primary);
}

.pd-size {
  min-width: 44px;
  height: 38px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}

.pd-size:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.pd-size.is-on {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .32);
}

.pd-size:disabled,
.pd-swatch:disabled {
  opacity: .3;
  cursor: not-allowed;
  transform: none;
}

.pd-size:disabled {
  text-decoration: line-through;
}

/* ---------- Stock ---------- */
.pd-stock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .84rem;
  font-weight: 700;
}

.pd-stock i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 20%, transparent);
}

.pd-stock.is-in { color: #16a34a; }
.pd-stock.is-low { color: #f59e0b; }
.pd-stock.is-out { color: #ef4444; }

html[data-theme="dark"] .pd-stock.is-in { color: #34d399; }

/* ---------- Buttons ---------- */
.pd-actions {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 10px;
}

.pd-qty.qty-control {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 3px;
  margin: 0;
  border-radius: 7px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
}

.pd-qty .qty-btn {
  width: 32px;
  height: 100%;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
}

.pd-qty .qty-btn:hover {
  background: #eff6ff;
  color: #2563eb;
}

.pd-qty .qty-input {
  width: 36px;
  height: 100%;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-heading, var(--text-main)) !important;
  -moz-appearance: textfield;
  appearance: textfield;
}

.pd-qty .qty-input::-webkit-outer-spin-button,
.pd-qty .qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 16px;
  border-radius: 7px;
  border: 0;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .2s, color .2s, filter .2s;
  -webkit-tap-highlight-color: transparent;
}

.pd-btn span {
  overflow: hidden;
  text-overflow: clip;
}

.pd-btn:active {
  transform: scale(.97);
}

.pd-btn--full {
  width: 100%;
}

.pd-btn--cart {
  color: #1d4ed8;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
}

html[data-theme="dark"] .pd-btn--cart {
  color: #93c5fd;
  background: rgba(37, 99, 235, .16);
  border-color: rgba(147, 197, 253, .3);
}

.pd-btn--cart:hover {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .25);
}

.pd-btn--buy {
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #3b82f6 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, .35);
}

.pd-btn--buy:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, .45);
}

.pd-btn--wa {
  height: 48px;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, .25);
}

.pd-btn--wa:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 6px 18px rgba(16, 185, 129, .35);
  color: #fff;
}
}

.pd-btn--ghost {
  background: var(--gray-100, #f1f5f9);
  color: var(--text-muted);
  cursor: not-allowed;
}

.pd-btn.btn-loading {
  opacity: .75;
  pointer-events: none;
}

/* ---------- Trust + share ---------- */
.pd-trust {
  list-style: none;
  margin: 2px 0 0;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.pd-trust li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-main);
}

.pd-trust .pd-ic {
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 9px;
  color: var(--primary);
  background: var(--primary-xlight);
}

html[data-theme="dark"] .pd-trust .pd-ic {
  color: #8fb0ff;
}

.pd-share {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--text-muted);
}

.pd-share > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 2px;
}

.pd-share a,
.pd-share button {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}

.pd-share a:hover,
.pd-share button:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.pd-sku {
  margin-left: auto;
  font-size: .74rem;
  opacity: .8;
}

/* ---------- Tabs ---------- */
.pd-tabs {
  margin-top: 8px;
}

.pd-tabs .tabs {
  overflow-x: auto;
  scrollbar-width: none;
  flex-wrap: nowrap;
}

.pd-tabs .tabs::-webkit-scrollbar {
  display: none;
}

.pd-tabs .tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* ---------- Mobile sticky bar ---------- */
.pd-sticky {
  display: none;
}

@media (max-width: 991px) {
  .pd-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .pd-gallery {
    position: static;
  }

  .pd-main {
    max-height: none;
    min-height: 0;
  }
}

@media (max-width: 767px) {
  .page-product .breadcrumb {
    display: none;
  }

  .pd-section {
    padding-top: 0;
  }

  .pd-section > .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .pd-main {
    border-radius: 14px;
  }

  .pd-thumb {
    width: 54px;
    height: 54px;
    border-radius: 10px;
  }

  .pd-info {
    gap: 12px;
  }

  .pd-price .product-current-price {
    font-size: 1.6rem;
  }

  .pd-actions {
    grid-template-columns: auto 1fr;
  }

  .pd-actions .pd-btn--buy {
    grid-column: 1 / -1;
  }

  .pd-btn {
    height: 46px;
    font-size: .9rem;
  }

  .pd-qty.qty-control {
    height: 46px;
  }

  .pd-trust {
    gap: 8px 10px;
    padding: 10px;
  }

  .pd-trust li {
    font-size: .74rem;
  }

  .pd-trust .pd-ic {
    width: 26px;
    height: 26px;
    padding: 5px;
  }

  /* Sticky bottom bar (above the mobile bottom nav) */
  .pd-sticky {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(72px + env(safe-area-inset-bottom));
    z-index: 85;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 8px 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-card) 92%, transparent);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    transform: translateY(140%);
    transition: transform .25s ease;
  }

  .pd-sticky.is-visible {
    transform: none;
  }

  .pd-sticky__price {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
  }

  .pd-sticky__price small {
    font-size: .7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
  }

  .pd-sticky__price b {
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--secondary);
  }

  .pd-sticky .pd-btn {
    height: 42px;
    font-size: .85rem;
  }

  .pd-sticky .pd-btn--icon {
    width: 42px;
    padding: 0;
  }

  .pd-sticky .pd-btn--buy {
    padding: 0 16px;
  }

  body:has(.cart-drawer.open) .pd-sticky,
  body:has(.modal-overlay.show) .pd-sticky {
    display: none;
  }
}

html[lang="bn"] .pd-info,
html[lang="bn"] .pd-info button,
html[lang="bn"] .pd-sticky,
html[lang="bn"] .pd-sticky button,
html[lang="bn"] .pd-tabs .tab-btn {
  font-family: 'Noto Sans Bengali', 'Hind Siliguri', var(--font-main, sans-serif);
}

/* =================================================================
   v2 — tighter layout, smaller image, readable buttons in dark mode
================================================================= */
.pd-layout {
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 28px;
  max-width: 1120px;
  margin: 0 auto;
}

.pd-main {
  aspect-ratio: 1 / 1;
  max-height: min(480px, calc(100vh - var(--header-height, 80px) - 140px));
  min-height: 0;
  margin: 0 auto;
}

.pd-info {
  gap: 10px;
}

.pd-title.product-title {
  margin: -2px 0 0;
  font-size: clamp(1.2rem, 1.05rem + .6vw, 1.55rem);
}

.pd-price .product-current-price {
  font-size: 1.7rem;
}

.pd-short {
  margin: -2px 0 2px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: .86rem;
  line-height: 1.6;
  color: var(--text-main);
  background: color-mix(in srgb, var(--text-main) 4%, transparent);
  border-left: 3px solid var(--secondary);
}

.pd-more {
  font-weight: 700;
  color: var(--secondary) !important;
  white-space: nowrap;
  text-decoration: none;
}

.pd-vars {
  gap: 8px;
}

.pd-opt__label {
  margin-bottom: 5px;
}

.pd-swatch {
  width: 26px;
  height: 26px;
}

.pd-size {
  min-width: 40px;
  height: 34px;
  font-size: .85rem;
}

.pd-btn,
.pd-qty.qty-control {
  height: 44px;
}

.pd-btn--wa {
  height: 42px;
}

.pd-trust {
  padding: 10px;
  gap: 8px 12px;
}

/* Always-readable button text (theme link colours were turning it blue) */
.pd-btn--wa,
.pd-btn--wa:link,
.pd-btn--wa:visited,
.pd-btn--wa span,
.pd-btn--wa svg {
  color: #fff !important;
}

.pd-btn--wa:hover,
.pd-btn--wa:focus-visible {
  color: #fff !important;
  background: #128c4a !important;
  box-shadow: 0 10px 24px rgba(18, 140, 74, .35);
  transform: translateY(-1px);
}

.pd-btn--buy,
.pd-btn--buy:hover,
.pd-btn--buy span,
.pd-btn--buy svg {
  color: #fff !important;
}

html[data-theme="dark"] .pd-btn--cart,
html[data-theme="dark"] .pd-btn--cart span,
html[data-theme="dark"] .pd-btn--cart svg {
  color: #e8edff !important;
}

html[data-theme="dark"] .pd-btn--cart {
  background: rgba(59, 108, 255, .16);
  border-color: rgba(120, 150, 255, .35);
}

html[data-theme="dark"] .pd-btn--cart:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.pd-btn--cart:hover span,
.pd-btn--cart:hover svg {
  color: #fff !important;
}

html[data-theme="dark"] .pd-size {
  color: #e8edff;
  background: rgba(255, 255, 255, .04);
  border-color: rgba(120, 150, 255, .25);
}

html[data-theme="dark"] .pd-size:hover:not(:disabled) {
  border-color: var(--secondary);
  color: #fff;
}

.pd-size.is-on,
html[data-theme="dark"] .pd-size.is-on {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
}

html[data-theme="dark"] .pd-opt__label b,
html[data-theme="dark"] .pd-trust li {
  color: #e8edff;
}

@media (max-width: 991px) {
  .pd-layout {
    grid-template-columns: 1fr;
    max-width: 640px;
  }

  .pd-main {
    max-height: 420px;
    width: 100%;
  }
}

@media (max-width: 767px) {
  .pd-main {
    aspect-ratio: 4 / 3.4;
    max-height: 360px;
  }
}

html[data-theme="dark"] .pd-swatch {
  outline-color: rgba(255, 255, 255, .28);
}

html[data-theme="dark"] .pd-swatch.is-on {
  outline: 2px solid var(--secondary);
}

.pd-tabs {
  max-width: none;
}

/* =================================================================
   v3 — use the full page width, gallery arrows, related grid
================================================================= */
.pd-section > .container {
  max-width: var(--container-max, 1320px);
}

.pd-layout,
.pd-tabs {
  max-width: none;
}

.pd-layout {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 32px;
}

.pd-main {
  max-height: min(560px, calc(100vh - var(--header-height, 80px) - 120px));
}

.pd-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #0f172a;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
  cursor: pointer;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity .2s, background .2s;
}

.pd-nav--prev { left: 12px; }
.pd-nav--next { right: 12px; }

.pd-main:hover .pd-nav,
.pd-nav:focus-visible {
  opacity: 1;
}

.pd-nav:hover {
  background: #fff;
}

.pd-counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 23, 42, .6);
  backdrop-filter: blur(4px);
}

.pd-thumbs {
  justify-content: flex-start;
}

.pd-thumb {
  width: 72px;
  height: 72px;
}

/* "You may also like" — proper grid instead of a stacked list */
.pd-related {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.pd-related > .product-card.pc2 {
  height: auto;
}

@media (hover: none) {
  .pd-nav {
    opacity: 1;
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 991px) {
  .pd-related {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .pd-related {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .pd-thumb {
    width: 56px;
    height: 56px;
  }
}

/* Same width as the header everywhere */
.pd-layout,
.pd-tabs {
  max-width: none !important;
}

/* =================================================================
   Phones & tablets — app-style product page
   (the desktop two-column rule above must not apply here)
================================================================= */
@media (max-width: 991px) {
  .pd-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
  }
  .pd-gallery { position: static !important; width: 100%; }
  .pd-main {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: none !important;
    min-height: 0 !important;
  }
  .pd-main img { width: 100%; height: 100%; object-fit: contain; }
}

@media (max-width: 767px) {
  .pd-section > .container { padding-left: 0 !important; padding-right: 0 !important; }
  .pd-gallery { margin: 0; }
  .pd-main {
    border-radius: 0 0 26px 26px !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
  }
  .pd-thumbs, .pd-gallery__thumbs {
    display: flex !important;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 10px 14px 2px;
  }
  .pd-info {
    padding: 0 14px;
    gap: 12px !important;
  }
  .pd-title, .pd-info h1 { font-size: 1.32rem !important; line-height: 1.3 !important; }
  .pd-trust { grid-template-columns: 1fr 1fr !important; }
  .pd-trust li { min-width: 0; }
  .pd-tabs, .pd-related, .pd-section .card { margin-left: 12px; margin-right: 12px; }

  /* the buttons live in the bottom bar on phones */
  .pd-actions .pd-btn--cart,
  .pd-actions .pd-btn--buy { display: none !important; }
  .pd-actions { grid-template-columns: auto !important; justify-content: start; }

  .pd-sticky {
    left: 10px !important;
    right: 10px !important;
    bottom: calc(76px + env(safe-area-inset-bottom)) !important;
    transform: none !important;
    gap: 6px !important;
    padding: 6px 10px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, .6) !important;
    background: rgba(255, 255, 255, .82) !important;
    backdrop-filter: saturate(1.8) blur(18px);
    -webkit-backdrop-filter: saturate(1.8) blur(18px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .18) !important;
  }
  html[data-theme="dark"] .pd-sticky {
    border-color: rgba(148, 170, 255, .16) !important;
    background: rgba(13, 19, 44, .88) !important;
  }
  .pd-sticky__price { padding: 0 12px 0 4px !important; margin-right: 4px !important; }
  .pd-sticky__price small { font-size: .68rem !important; }
  .pd-sticky__price b { font-size: .95rem !important; }
  .pd-sticky .pd-btn { height: 38px !important; border-radius: 6px !important; font-size: .84rem !important; }
  .pd-sticky .pd-btn--cart { flex: 0 0 auto; width: auto !important; padding: 0 11px !important; gap: 5px !important; }
  .pd-sticky .pd-btn--cart span { display: inline !important; }
  .pd-sticky .pd-btn--buy { flex: 1 1 auto; padding: 0 14px !important; font-size: .85rem !important; }
  body.page-product { padding-bottom: calc(140px + env(safe-area-inset-bottom)) !important; }
  /* Chat icon below, scroll-to-top icon above it - exactly like homepage */
  .page-product .floating-chat-container, .page-product .floating-chat-menu { bottom: calc(150px + env(safe-area-inset-bottom)) !important; right: 14px !important; z-index: 999 !important; }
  .page-product #backToTop, .page-product #backToTop.pv-totop { bottom: calc(212px + env(safe-area-inset-bottom)) !important; right: 20px !important; z-index: 998 !important; }
}

/* Main photo: always the whole square (1:1) image — nothing cut off */
.pd-main {
  aspect-ratio: 1 / 1 !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  background: var(--bg-card);
}
.pd-main img,
.pd-main #mainGalleryImg {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center;
}
@media (min-width: 992px) {
  .pd-layout { align-items: start; }
  .pd-gallery { position: sticky; top: calc(var(--header-height, 80px) + 16px); }
}

/* Recently viewed — one slow, endless line (no scrollbar, no jumps) */
.pd-rv__viewport {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.pd-rv__track {
  display: flex;
  gap: 16px;
  width: max-content;
  padding: 4px 0 10px;
  animation: pdRvMarquee var(--rv-dur, 40s) linear infinite;
  will-change: transform;
}
.pd-rv__viewport:hover .pd-rv__track,
.pd-rv__viewport:focus-within .pd-rv__track,
.pd-rv__viewport.is-touch .pd-rv__track { animation-play-state: paused; }
@keyframes pdRvMarquee { from { transform: translateX(0); } to { transform: translateX(calc(-50% - 8px)); } }
.pd-rv__card { flex: none; width: 160px; display: grid; gap: 4px; text-decoration: none; color: inherit; }
.pd-rv__img { display: block; aspect-ratio: 1; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-card); }
.pd-rv__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.pd-rv__card:hover .pd-rv__img img { transform: scale(1.06); }
.pd-rv__name { font-size: .85rem; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: clip; margin-top: 4px; }
.pd-rv__price { font-size: .9rem; font-weight: 800; color: var(--secondary); }
@media (max-width: 767px) {
  .pd-rv { padding: 0 12px; }
  .pd-rv__card { width: 128px; }
}
@media (prefers-reduced-motion: reduce) {
  .pd-rv__viewport { overflow-x: auto; }
  .pd-rv__track { animation: none; }
}

/* Gallery v3: full 1:1 photo that fits the screen; small extra photos float lightly
   over the bottom of the main photo (glass strip), so the page stays compact. */
.pd-gallery .pd-main { position: relative; aspect-ratio: 1 / 1; overflow: hidden; }
.pd-gallery .pd-main img#mainGalleryImg { width: 100%; height: 100%; object-fit: contain; }
.pd-thumbs.pd-thumbs--over {
  position: absolute; left: 10px; bottom: 10px; transform: none;
  z-index: 3; display: flex; flex-direction: row; gap: 6px;
  max-width: calc(100% - 20px); margin: 0 !important; padding: 5px !important;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  background: rgba(255,255,255,.38); border: 1px solid rgba(255,255,255,.55);
  border-radius: 14px; box-shadow: 0 6px 20px rgba(15,23,42,.14);
  backdrop-filter: blur(10px) saturate(1.3); -webkit-backdrop-filter: blur(10px) saturate(1.3);
  opacity: .9; transition: opacity .25s, transform .25s;
}
html[data-theme="dark"] .pd-thumbs.pd-thumbs--over { background: rgba(15,23,42,.42); border-color: rgba(255,255,255,.14); }
.pd-thumbs.pd-thumbs--over::-webkit-scrollbar { display: none; }
.pd-main:hover .pd-thumbs--over { opacity: 1; }
.pd-thumbs--over .pd-thumb {
  flex: 0 0 auto; width: 46px !important; height: 46px !important; padding: 0 !important;
  border-radius: 10px !important; border: 2px solid transparent !important; overflow: hidden;
  background: #fff; opacity: .72; cursor: pointer; transition: opacity .2s, transform .2s, border-color .2s;
}
.pd-thumbs--over .pd-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.pd-thumbs--over .pd-thumb:hover { opacity: 1; transform: translateY(-2px); }
.pd-thumbs--over .pd-thumb.active { opacity: 1; border-color: var(--primary, #2563eb) !important; box-shadow: 0 0 0 2px rgba(255,255,255,.8); }
.pd-main:has(.pd-thumbs--over) .pd-counter { top: 12px; bottom: auto; right: 12px; left: auto; }
.pd-main:has(.pd-thumbs--over) .pd-nav { top: calc(50% - 24px); }
@media (max-width: 575px) {
  .pd-thumbs--over .pd-thumb { width: 40px !important; height: 40px !important; }
  .pd-thumbs.pd-thumbs--over { bottom: 8px; padding: 4px !important; gap: 5px; }
}
@media (min-width: 992px) {
  .pd-gallery { position: sticky; top: calc(var(--pd-head, 96px) + 12px); align-self: start; display: block; }
  .pd-gallery .pd-main {
    width: min(100%, var(--pd-max, calc(100vh - 300px))) !important;
    max-width: 100%; margin: 0 auto !important;
  }
}

/* "Just bought" strip (real orders) */
.pd-live {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 10px 0 4px; padding: 8px 12px; border-radius: 12px;
  background: linear-gradient(90deg, rgba(16,185,129,.10), rgba(14,165,233,.06));
  border: 1px solid rgba(16,185,129,.22); font-size: .84rem; color: var(--text-main, #0f172a);
}
html[data-theme="dark"] .pd-live { color: #e2e8f0; background: linear-gradient(90deg, rgba(16,185,129,.14), rgba(14,165,233,.06)); }
.pd-live__dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #10b981; flex: 0 0 8px; }
.pd-live__dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #10b981; opacity: 0; animation: pdLivePing 1.8s ease-out infinite; }
.pd-live.is-hot .pd-live__dot { background: #f97316; } .pd-live.is-hot .pd-live__dot::after { border-color: #f97316; }
@keyframes pdLivePing { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
.pd-live__ic { font-size: .95rem; line-height: 1; }
.pd-live__txt { flex: 1 1 auto; min-width: 0; transition: opacity .3s, transform .3s; }
.pd-live__txt.is-out { opacity: 0; transform: translateY(-4px); }
.pd-live__txt b { font-weight: 700; }
.pd-live__txt em { font-style: normal; color: #059669; font-weight: 600; }
html[data-theme="dark"] .pd-live__txt em { color: #34d399; }
.pd-live__n { font-size: .74rem; font-weight: 700; color: #ea580c; background: rgba(249,115,22,.12); padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .pd-live__dot::after { animation: none; } }
