/* --- PRODUCT DETAIL PAGE (based on provided layout) --- */

:root {
  --pd-cream: #FDFAF4;
  --pd-sand: #E8DDD0;
  --pd-terracotta: #b55239;
  --pd-warm-black: #1C1A17;
  --pd-muted: #8A8070;
  --pd-gold: #C9A96E;
}

.product-page {
  background: #FDFAF4;
}

.woocommerce-breadcrumb {
  margin: 5px 0 10px 0;
  display: flex;
  align-items: center;
  font-size: 12px !important;
  color: var(--pd-warm-black) !important;
  letter-spacing: 0.04em;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.woocommerce-breadcrumb::-webkit-scrollbar {
  display: none;
}

.woocommerce-breadcrumb a {
  color: var(--pd-muted) !important;
  text-decoration: none;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.woocommerce-breadcrumb a:hover {
  color: var(--pd-terracotta) !important;
}

/* Breadcrumb separator */
.woocommerce-breadcrumb .amz-bc-sep {
  opacity: 0.4;
  color: var(--pd-muted) !important;
  flex-shrink: 0;
  padding: 0 8px;
}

.product-layout {
  margin: 0 auto;
  display: grid;
  /* Cân ảnh / info: hơi nghiêng về ảnh, không chiếm quá nhiều chiều ngang */
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

/* --- LEFT: GALLERY (theo reference index.html) --- */
.gallery-col {
  min-width: 0;
  position: sticky;
  top: 5rem;
  align-self: start;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.main-media {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--pd-sand);
  flex: 1 1 0;
  min-height: 0;
  margin-bottom: 12px;
  width: 100%;
  max-width: 800px;
  margin-inline: auto;
  cursor: grab;
  user-select: none;
}

.main-media:active {
  cursor: grabbing;
}

.main-media-slider {
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* Allow browser pinch zoom; swipe still handled in JS for single touch. */
  touch-action: pan-y pinch-zoom;
}

.main-media-strip {
  display: flex;
  width: 600%;
  height: 100%;
  will-change: transform;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.main-media-strip.is-dragging {
  transition: none;
}

.main-media-slide {
  flex: 0 0 16.666667%;
  width: 16.666667%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.main-media-slide .main-media-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.main-media-slide .main-media-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.main-media-slide iframe.main-media-video {
  width: 100% !important;
  height: 100% !important;
  min-width: 100%;
  min-height: 100%;
  pointer-events: none;
}

.main-media-slide .main-media-img {
  pointer-events: none;
}

.main-media-video {
  background: #000;
  pointer-events: auto;
  border: 0;
}

.main-media-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Icon kính lúp + dấu +, góc trên bên phải, click mở phóng to */
.badge-zoom {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(28, 26, 23, 0.7);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.badge-zoom:hover {
  background: rgba(28, 26, 23, 0.85);
  transform: scale(1.08);
}

.badge-zoom:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

.badge-zoom-icon {
  width: 22px;
  height: 22px;
}

/* Overlay phóng to (kiểu Magnific Popup) */
.zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.zoom-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.zoom-overlay[hidden] {
  display: none !important;
}

.zoom-overlay.is-open[hidden] {
  display: flex !important;
}

.zoom-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.zoom-overlay-inner {
  position: relative;
  width: 100%;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.zoom-overlay-close {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 10020;
}

.zoom-overlay-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.zoom-overlay-slider {
  width: 100%;
  max-width: 95vw;
  height: 90vh;
  max-height: 90vh;
  overflow: hidden;
  /* Keep pinch-zoom available on mobile overlay. */
  touch-action: pan-y pinch-zoom;
  cursor: grab;
}

.zoom-overlay-slider:active {
  cursor: grabbing;
}

.zoom-overlay-strip {
  display: flex;
  width: 600%;
  height: 100%;
  will-change: transform;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.zoom-overlay-strip.is-dragging {
  transition: none;
}

.zoom-overlay-slide {
  flex: 0 0 16.666667%;
  width: 16.666667%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.zoom-overlay-slide img,
.zoom-overlay-slide video {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #000;
  pointer-events: none;
}

.zoom-overlay-slide video {
  max-height: 85vh;
}

.zoom-overlay-slide iframe.main-media-video {
  width: min(95vw, 1600px);
  height: min(90vh, 900px);
  max-width: 100%;
  max-height: 90vh;
  border: 0;
  background: #000;
  pointer-events: none;
}

@media (max-width: 768px) {
  .zoom-overlay {
    padding: 0;
  }

  .zoom-overlay-inner,
  .zoom-overlay-slider {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
  }

  .zoom-overlay-slide img,
  .zoom-overlay-slide video {
    width: 100%;
    max-width: 100vw;
    max-height: 100dvh;
    height: auto;
    object-fit: contain;
  }

  .zoom-overlay-slide iframe.main-media-video {
    width: 100vw;
    height: 56.25vw;
    max-width: 100vw;
    max-height: 100dvh;
  }

  .zoom-overlay-close {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
  }
}

/* Thumb wrapper với nút prev/next */
.thumb-wrap {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  overflow: hidden;
}

.thumb-nav {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--pd-sand);
  font-size: 14px;
  cursor: pointer;
  color: var(--pd-warm-black);
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: all 0.25s;
  z-index: 2;
  line-height: 1;
}

.thumb-nav:hover {
  background: var(--pd-terracotta);
  color: #fff;
  border-color: var(--pd-terracotta);
}

.thumb-nav.visible {
  display: flex;
}

.thumb-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  min-width: 0;
  scrollbar-width: none;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.thumb-list::-webkit-scrollbar {
  display: none;
}

.thumb-item {
  flex: 0 0 82px;
  height: 82px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  background: var(--pd-sand);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
  box-sizing: border-box;
}

.thumb-item.active {
  border-color: var(--pd-terracotta);
}

.thumb-item:hover {
  border-color: var(--pd-muted);
}

.thumb-item .t-emoji {
  font-size: 28px;
  opacity: 0.45;
}

.thumb-item.video-thumb {
  background: linear-gradient(135deg, #2C2926, #3D3830);
}

.thumb-item.video-thumb .t-emoji {
  color: #fff;
  opacity: 0.8;
  font-size: 22px;
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Desktop gallery: vertical thumbs on the left of main image */
@media (min-width: 1025px) {
  /* Không kéo cao theo viewport — chiều cao khung = cạnh hình vuông của ảnh chính */
  .gallery-col {
    display: grid;
    grid-template-columns: 5.75rem minmax(0, 1fr);
    grid-template-rows: auto;
    gap: 12px;
    align-items: stretch;
    height: auto;
    max-height: none;
  }

  .gallery-col .thumb-wrap {
    order: 1;
    width: 5.75rem;
    height: 100%;
    min-height: 0;
    align-items: stretch;
    justify-content: stretch;
    gap: 0;
  }

  .gallery-col .main-media {
    order: 2;
    margin-bottom: 0;
    min-width: 0;
    flex: none;
    width: 100%;
    max-width: min(800px, calc(100svh - 5rem - 1rem));
    height: auto;
    aspect-ratio: 1 / 1;
    max-height: calc(100svh - 5rem - 1rem);
  }

  /* Keep thumb rail clean on desktop (Y scroll instead of X arrows) */
  .gallery-col .thumb-nav {
    display: none !important;
  }

  .gallery-col .thumb-list {
    flex: none;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
    scrollbar-width: thin;
  }

  .gallery-col .thumb-list::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    display: block;
  }

  .gallery-col .thumb-list::-webkit-scrollbar-thumb {
    background: rgba(64, 52, 40, 0.28);
    border-radius: 999px;
  }

  .gallery-col .thumb-item {
    flex: 0 0 82px;
  }
}

/* --- RIGHT: INFO --- */
.info-col {
  min-width: 0;
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.06);
  padding: 1rem;
}

.product-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.product-category-tag {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--pd-terracotta);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.product-category-tag::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--pd-terracotta);
}

.product-share {
  background: rgba(255, 248, 238, 0.9);
  border: 1px solid rgba(196, 113, 74, 0.6);
  color: var(--pd-terracotta);
  cursor: pointer;
  font-size: 14px;
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(196, 113, 74, 0.18);
  transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.product-share:hover {
  color: #fff;
  background: var(--pd-terracotta);
  border-color: var(--pd-terracotta);
  box-shadow: 0 10px 24px rgba(196, 113, 74, 0.28);
  transform: translateY(-1px);
}

.product-share-wrap {
  position: relative;
}

.product-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 10px;
}

.product-share-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-share-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  padding: 10px 12px 12px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.06);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 50;
}

.product-share-wrap.is-open .product-share-popover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.share-title {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pd-muted);
  margin-bottom: 10px;
}

.share-link-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.share-link-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: #fff;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 12px;
  color: var(--pd-warm-black);
}

.share-link-input:focus {
  outline: none;
  border-color: var(--pd-terracotta);
}

.share-copy-btn {
  flex-shrink: 0;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #FDFAF4;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pd-warm-black);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.share-copy-btn:hover {
  background: #F5F0E8;
  border-color: rgba(0, 0, 0, 0.18);
}

.product-title {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: clamp(15px, 1.35vw, 22px);
  font-weight: 400;
  line-height: 1.3;
  margin: 0 0 12px;
  color: var(--pd-warm-black);
}

.product-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.product-sku {
  font-size: 12px;
  color: var(--pd-muted);
  letter-spacing: 0.05em;
}

.product-sku span {
  color: var(--pd-warm-black);
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stars {
  color: var(--pd-gold);
  font-size: 13px;
  letter-spacing: 1px;
}

.rating-num,
.rating-count {
  font-size: 12px;
  color: var(--pd-muted);
}

.stock-badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.stock-badge--success {
  background: #E8F5E9;
  color: #2E7D32;
}

.stock-badge--danger {
  background: #FFEBEE;
  color: #C62828;
}

.stock-badge--warning {
  background: #FFF8E1;
  color: #E65100;
}

.price-block {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}

.price-main {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--pd-terracotta);
}

.price-main.is-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border: 2px solid #d08a67;
  border-radius: 10px;
  background: #fff3ec;
  color: #a8502e;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  box-shadow: 0 3px 10px rgba(208, 138, 103, 0.18);
}

.price-original {
  font-size: 11px;
  color: var(--pd-muted);
  text-decoration: line-through;
}

.price-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--pd-terracotta);
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.price-badge-mobile {
  display: none;
}

@media (max-width: 768px) {
  .woocommerce-breadcrumb {
    margin: 5px 1rem 10px 1rem !important;
  }

  .price-badge-desktop {
    display: none;
  }

  .price-badge-mobile {
    display: inline-flex;
  }
}

.divider {
  width: 100%;
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 18px 0;
}

.product-shortdesc {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.7;
  color: #4A4640;
}

/* --- ATTRIBUTES --- */
.attr-group {
  margin-bottom: 18px;
}

.attr-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pd-muted);
  margin-bottom: 10px;
}

.attr-label strong {
  color: var(--pd-warm-black);
  font-weight: 500;
}

.color-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.color-swatch.active {
  border-color: var(--pd-warm-black);
  box-shadow: 0 0 0 3px #FDFAF4, 0 0 0 5px var(--pd-warm-black);
}

.color-swatch:hover {
  transform: scale(1.08);
}

.option-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.opt-btn {
  padding: 5px;
    border-radius: 5px;
  border: 1px solid var(--pd-sand);
  background: #fff;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 13px;
  cursor: pointer;
  color: var(--pd-warm-black);
  letter-spacing: 0.04em;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
}

/* Thuộc tính có ảnh (term meta): thumbnail trái, tên biến thể phải */
.opt-btn .amz-opt-img {
  flex-shrink: 0;
  width: 25px;
  height: 25px;
  border-radius: 5px;
  object-fit: cover;
  border: 1px solid rgba(28, 26, 23, 0.12);
  vertical-align: middle;
}

.opt-btn .amz-opt-label {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.35;
}

.opt-btn.active .amz-opt-img {
  border-color: rgba(253, 250, 244, 0.45);
}

.opt-btn .amz-opt-icon {
  font-size: 16px;
  line-height: 1;
}

.opt-btn .amz-opt-swatch {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  flex-shrink: 0;
}

.opt-btn.active .amz-opt-swatch {
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75);
}

.opt-btn:hover:not(.disabled) {
  border-color: var(--pd-muted);
}

.opt-btn.active {
  border-color: var(--pd-warm-black);
  background: var(--pd-warm-black);
  color: #FDFAF4;
}

.opt-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}

.purchase-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

/* .btn-cart { display:flex } đè lên thuộc tính HTML [hidden] — bắt buộc ẩn khi có hidden */
.product-page .purchase-row [hidden],
.product-page #stickyCartWrap [hidden] {
  display: none !important;
}

.purchase-row.is-variation-oos {
  flex-wrap: wrap;
}

.purchase-row.is-variation-oos .btn-cart-contact {
  flex: 1;
  text-decoration: none;
  color: #fff;
  justify-content: center;
  box-sizing: border-box;
}

.purchase-row.is-variation-oos .btn-cart-contact:hover {
  color: #fff;
}

.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid rgba(155, 137, 118, 0.35);
  border-radius: 999px;
  overflow: hidden;
  height: 36px;
}

.qty-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(253, 250, 244, 1);
  font-size: 18px;
  cursor: pointer;
  color: #6b5b4a;
}

.qty-input {
  width: 52px;
  height: 44px;
  border: none;
  text-align: center;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--pd-warm-black);
  background: #fff;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.btn-order {
  flex: 1;
  height: 44px;
  padding: 0 18px;
  background: var(--pd-terracotta);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-order:hover {
  background: #9a4630;
  transform: translateY(-1px);
}

.btn-cart {
  flex: 1;
  max-width: 236px;
  height: 36px;
  padding: 0 18px;
  background: var(--pd-terracotta);
  color: #fff;
  border: 1px solid rgba(196, 113, 74, 0.55);
  border-radius: 999px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(196, 113, 74, 0.22);
  transition: transform 0.18s ease, box-shadow 0.22s ease, background-color 0.2s ease, border-color 0.2s ease;
  align-items: center;
  display: flex;
}

/* Ajax add-to-cart loading (main + sticky) */
.btn-cart.is-loading,
.btn-cart-sticky.is-loading,
.single_add_to_cart_button.is-loading,
#stickyCartBtn.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

.btn-cart,
.btn-cart-sticky,
#stickyCartBtn {
  position: relative;
}

.amz-btn-loader {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.amz-btn-loader::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: rgba(255, 255, 255, 0.95);
  animation: amzSpin 0.8s linear infinite;
}

@keyframes amzSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Add-to-cart toast moved to theme.css (global) */
.btn-cart.is-loading .amz-btn-loader,
.btn-cart-sticky.is-loading .amz-btn-loader,
#stickyCartBtn.is-loading .amz-btn-loader {
  display: flex;
}

.btn-cart.is-loading .btn-cart-text,
.btn-cart.is-loading .btn-cart-mobile-text,
.btn-cart.is-loading .btn-cart-plus,
.btn-cart.is-loading .btn-cart-icon,
#stickyCartBtn.is-loading .btn-cart-sticky-text,
#stickyCartBtn.is-loading .btn-cart-sticky-icon,
#stickyCartBtn.is-loading .btn-cart-icon {
  opacity: 0;
}

.btn-cart.is-loading .btn-cart-plus,
.btn-cart.is-loading .btn-cart-icon,
#stickyCartBtn.is-loading .btn-cart-icon {
  opacity: 0.65;
}

.btn-cart:hover {
  background: #9a4630;
  border-color: rgba(154, 70, 48, 0.7);
  box-shadow: 0 16px 36px rgba(196, 113, 74, 0.28);
  transform: translateY(-1px);
}

.btn-cart:active {
  transform: translateY(0);
  box-shadow: 0 12px 28px rgba(196, 113, 74, 0.22);
}

.btn-cart:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(196, 113, 74, 0.25), 0 16px 36px rgba(196, 113, 74, 0.28);
}

.btn-cart-icon {
  font-size: 18px;
  margin-right: 8px;
}

/* Nút Thêm vào giỏ (cạnh ô số lượng): trên mobile hiển thị "+" + "Giỏ hàng" */
.btn-cart-plus,
.btn-cart-mobile-text {
  display: none;
}

@media (max-width: 768px) {

  /* Nút "Thêm vào giỏ": chỉ ẩn icon/chữ đầy đủ — không áp cho "Liên hệ mua hàng" */
  .purchase-row .btn-cart:not(.btn-cart-contact) .btn-cart-icon,
  .purchase-row .btn-cart:not(.btn-cart-contact) .btn-cart-text {
    display: none;
  }

  .purchase-row .btn-cart .btn-cart-plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    margin-right: 6px;
  }

  .purchase-row .btn-cart .btn-cart-mobile-text {
    display: inline;
  }
}

/* Nút Thêm vào giỏ cố định bên phải khi cuộn xuống (hiển thị trên nút scroll to top) */
.sticky-cart-wrap {
  position: fixed;
  right: 18px;
  top: 50%;
  bottom: auto;
  z-index: 1260;
  opacity: 0;
  visibility: hidden;
  transform: translateY(calc(-50% + 8px));
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

.sticky-cart-wrap.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%);
}

.sticky-cart-wrap[hidden] {
  display: none !important;
}

.sticky-cart-wrap.is-visible[hidden] {
  display: block !important;
}

.btn-cart-sticky {
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(196, 113, 74, 0.35);
}

.btn-cart-sticky-icon {
  display: none;
}

/* Mobile: nút sticky chỉ hiển thị icon giỏ hàng (trắng), nằm trên nút scroll to top */
@media (max-width: 768px) {
  .sticky-cart-wrap {
    right: 3px;
    top: 50%;
    bottom: auto;
    transform: translateY(calc(-50% + 8px));
  }

  /* Sticky "Thêm vào giỏ": tròn, chỉ icon SVG — nút Liên hệ giữ chữ + icon vì không có .btn-cart-sticky-icon */
  .btn-cart-sticky:not(.btn-cart-contact) {
    min-width: 0;
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn-cart-sticky:not(.btn-cart-contact) .btn-cart-icon,
  .btn-cart-sticky:not(.btn-cart-contact) .btn-cart-sticky-text {
    display: none;
  }

  .btn-cart-sticky:not(.btn-cart-contact) .btn-cart-sticky-icon {
    display: block;
    width: 26px;
    height: 26px;
    object-fit: contain;
    filter: brightness(0) invert(1);
  }

  .btn-cart-sticky.btn-cart-contact {
    width: auto;
    min-width: 0;
    max-width: calc(100vw - 56px);
    height: auto;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 999px;
  }

  .btn-cart-sticky.btn-cart-contact .btn-cart-icon,
  .btn-cart-sticky.btn-cart-contact .btn-cart-sticky-text {
    display: inline-flex;
    align-items: center;
  }

  .btn-cart-sticky.btn-cart-contact .btn-cart-icon {
    margin-right: 6px;
    font-size: 16px;
  }

  .btn-cart-sticky.btn-cart-contact .btn-cart-sticky-text {
    font-size: 11px;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-align: left;
    white-space: normal;
    max-width: 9.5rem;
  }
}

/* --- PROMO & TRUST --- */
.promo-box {
  margin-top: 2rem;
  padding: 1rem;
  border-radius: 8px;
  border: 1.5px dashed var(--pd-gold);
  background: linear-gradient(135deg, #FFF8EE, #FFF3E0);
}

.promo-title {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pd-gold);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.promo-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.promo-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--pd-warm-black);
  line-height: 1.5;
}

.promo-icon {
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

.trust-row {
  display: flex;
  border-radius: 8px;
  border: 1px solid var(--pd-sand);
  overflow: hidden;
  margin-top: 2rem;
}

.trust-item {
  flex: 1;
  padding: 12px 10px;
  text-align: center;
  border-right: 1px solid var(--pd-sand);
  background: #fff;
  transition: background-color 0.2s ease;
}

.trust-item:last-child {
  border-right: none;
}

.trust-item:hover {
  background: var(--pd-cream);
}

.trust-icon {
  font-size: 20px;
  margin-bottom: 4px;
}

.trust-text {
  font-size: 11px;
  color: var(--pd-muted);
  line-height: 1.4;
  letter-spacing: 0.02em;
}

/* Inline related products (inside info column) */
.inline-related {
  margin-top: 18px;
  display: grid;
}

.inline-related-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.inline-related-title {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 18px;
  font-weight: 500;
}

.inline-related-list {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: 0 -4px 0 0;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.inline-related-list::-webkit-scrollbar {
  height: 4px;
}

.inline-related-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 999px;
}

.inline-related-card {
  flex: 0 0 150px;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
}

.inline-related-thumb {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
  background: var(--pd-sand);
}

.inline-related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.inline-related-name {
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 4px;
}

.inline-related-price {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14px;
  color: var(--pd-terracotta);
}

/* --- DESCRIPTION (theo reference index.html) --- */
.desc-section {
  margin: 0 auto;
  padding: 2rem 0 0;
  /* Khi scroll vào đây (ví dụ sau khi bấm Thu gọn), để phần tiêu đề tab không bị header che */
  scroll-margin-top: 5.5rem;
}

.desc-header {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.desc-header::-webkit-scrollbar {
  display: none;
}

.desc-tabs {
  display: flex;
  gap: 0;
  white-space: nowrap;
  border-bottom: 2px solid var(--pd-sand);
  min-width: max-content;
}

.desc-tab {
  padding: 10px 24px 12px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  border-bottom: 3px solid transparent;
  background: none;
  cursor: pointer;
  color: var(--pd-muted);
  margin-bottom: -2px;
  transition: color 0.25s, border-color 0.25s;
  font-family: 'Be Vietnam Pro', sans-serif;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.desc-tab:hover {
  color: var(--pd-warm-black);
}

.desc-tab.active {
  color: var(--pd-terracotta);
  font-weight: 500;
  border-bottom-color: var(--pd-terracotta);
}

.desc-tab-count {
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.desc-body {
  max-height: 240px;
  overflow: hidden;
  position: relative;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--pd-cream);
  border: 1px solid var(--pd-sand);
  outline: 4px solid var(--pd-cream);
  outline-offset: -10px;
  box-shadow:
    inset 0 0 0 1px var(--pd-sand),
    0 4px 24px rgba(28, 26, 23, 0.06);
  border-radius: 2px;
  padding: 1.6rem 1rem;
}

.desc-body::before {
  content: '✦';
  position: absolute;
  top: 10px;
  left: 14px;
  font-size: 11px;
  color: var(--pd-gold);
  opacity: 0.7;
  pointer-events: none;
  line-height: 1;
}

.desc-frame-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.desc-frame-corner.tl {
  top: 4px;
  left: 4px;
  border-top: 1.5px solid var(--pd-gold);
  border-left: 1.5px solid var(--pd-gold);
}

.desc-frame-corner.tr {
  top: 4px;
  right: 4px;
  border-top: 1.5px solid var(--pd-gold);
  border-right: 1.5px solid var(--pd-gold);
}

.desc-frame-corner.bl {
  bottom: 4px;
  left: 4px;
  border-bottom: 1.5px solid var(--pd-gold);
  border-left: 1.5px solid var(--pd-gold);
}

.desc-frame-corner.br {
  bottom: 4px;
  right: 4px;
  border-bottom: 1.5px solid var(--pd-gold);
  border-right: 1.5px solid var(--pd-gold);
}

.desc-body.expanded {
  max-height: 2000px;
}

.desc-body::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(transparent, var(--pd-cream));
  transition: opacity 0.4s;
  pointer-events: none;
  border-radius: 0 0 2px 2px;
}

.desc-body.expanded::after {
  opacity: 0;
}

/* Vùng click "Xem thêm" + 1 chevron, nằm ngay chỗ mờ (theo ảnh mẫu) */
.desc-expand-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(transparent, var(--pd-cream) 30%);
  cursor: pointer;
  z-index: 1;
  border: none;
  padding: 0;
  margin: 0;
  border-radius: 0 0 2px 2px;
  transition: background 0.2s ease;
}

.desc-expand-hint:hover {
  background: linear-gradient(transparent, rgba(253, 250, 244, 0.9) 25%, var(--pd-cream) 50%);
}

/* Chữ "Xem thêm" nhấp nháy nhẹ */
.desc-expand-hint .desc-expand-text {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14px;
  color: #2563eb;
  font-weight: 500;
  animation: desc-text-blink 2s ease-in-out infinite;
  transition: color 0.2s ease;
}

.desc-expand-hint:hover .desc-expand-text {
  color: #1d4ed8;
  animation: none;
  opacity: 1;
}

@keyframes desc-text-blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.65;
  }
}

/* Icon chevron chạy động (bounce xuống) */
.desc-expand-hint .desc-expand-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  animation: desc-chevron-bounce 1.6s ease-in-out infinite;
  transition: color 0.2s ease;
}

.desc-expand-hint:hover .desc-expand-chevron {
  color: #1d4ed8;
  animation: desc-chevron-bounce 0.8s ease-in-out infinite;
}

@keyframes desc-chevron-bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(4px);
  }
}

/* Dùng chung cho nút Thu gọn (không animation) */
.desc-collapse-btn .desc-expand-text,
.desc-expand-chevron {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14px;
  color: #2563eb;
  font-weight: 500;
  transition: color 0.2s ease;
}

.desc-expand-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, transform 0.2s ease;
}

.desc-expand-hint.is-hidden {
  display: none;
}

/* Nút Thu gọn (hiện khi đã Xem thêm), nằm dưới khung mô tả */
.desc-collapse-wrap {
  display: none;
  justify-content: center;
  margin-top: 16px;
  padding-bottom: 4px;
}

.desc-collapse-wrap.is-visible {
  display: flex;
}

.desc-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px 10px 22px;
  border: 1.5px solid rgba(37, 99, 235, 0.35);
  border-radius: 999px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  cursor: pointer;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #2563eb;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.08);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.desc-collapse-btn:hover {
  color: #1d4ed8;
  border-color: rgba(29, 78, 216, 0.5);
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.15);
  transform: translateY(-1px);
}

.desc-collapse-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.desc-collapse-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.desc-collapse-btn .desc-expand-chevron {
  color: #2563eb;
  transition: color 0.2s ease, transform 0.2s ease;
}

.desc-collapse-btn:hover .desc-expand-chevron {
  color: #1d4ed8;
}

.desc-chevron-up {
  transform: rotate(0deg);
}

.desc-content {
  font-size: 14px;
  line-height: 1.9;
  color: #4A4640;
}

.desc-content h3 {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--pd-warm-black);
  margin: 24px 0 10px;
}

.desc-content h3:first-child {
  margin-top: 0;
}

.desc-content p {
  margin-bottom: 14px;
}

.desc-content ul {
  padding-left: 18px;
  margin-bottom: 14px;
}

.desc-content li {
  margin-bottom: 6px;
}

.desc-content .highlight-box {
  background: var(--pd-sand);
  border-left: 3px solid var(--pd-terracotta);
  padding: 14px 18px;
  border-radius: 0 4px 4px 0;
  margin: 16px 0;
  font-style: italic;
  color: var(--pd-muted);
}

.desc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
}

.desc-content table th,
.desc-content table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--pd-sand);
}

.desc-content table th {
  background: var(--pd-sand);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--pd-muted);
}

.desc-content table tr:last-child td {
  border-bottom: none;
}

.desc-content table tr:hover td {
  background: var(--pd-cream);
}

.review-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.review-item {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.review-media {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
  border-radius: 8px;
  overflow: hidden;
  background: #ddd;
}

.review-media img {
  width: 68px;
  height: auto;
  object-fit: cover;
  display: block;
  cursor: pointer;
  flex-shrink: 0;
}

.review-zoom-image {
  border-radius: 6px;
}

.review-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.review-meta {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
  min-height: 20px;
}

.review-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--pd-warm-black);
}

.review-phone {
  font-size: 12px;
  color: var(--pd-muted);
  white-space: nowrap;
}

.review-text {
  font-size: 13px;
  line-height: 1.6;
  color: #4A4640;
  margin: 0;
}

.review-stars {
  font-size: 13px;
  color: var(--pd-gold);
  letter-spacing: 1px;
}

.review-cta-row {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.review-cta-btn {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(155, 137, 118, 0.4);
  background: #FDFAF4;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--pd-warm-black);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.review-cta-buy {
  background: var(--pd-terracotta);
  border-color: var(--pd-terracotta);
  color: #fff;
}

.review-cta-buy:hover,
.review-cta-combined:hover {
  background: #9a4630;
  border-color: #9a4630;
  box-shadow: 0 8px 20px rgba(196, 113, 74, 0.35);
}

/* --- RELATED --- */
.related-section {
  margin: 0 auto;
  padding: 34px 0 10px;
}

.related-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.related-title {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 26px;
  font-weight: 500;
}

.related-title em {
  font-style: italic;
  color: #3D5445;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.rel-card {
  cursor: pointer;
  transition: transform 0.25s ease;
}

.rel-card:hover {
  transform: translateY(-3px);
}

.rel-img {
  aspect-ratio: 1/1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--pd-sand);
  margin-bottom: 10px;
  position: relative;
}

.rel-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rel-cat {
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--pd-muted);
  margin-bottom: 4px;
}

.rel-name {
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 8px;
}

.rel-price {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--pd-terracotta);
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .product-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .gallery-col {
    position: static;
    height: auto;
    max-height: none;
    min-height: 0;
    padding: 0;
  }

  .main-media {
    flex: none;
    aspect-ratio: 1 / 1;
    /* Khung ảnh không vượt chiều cao viewport; chừa ~header (5rem) + 1rem đáy */
    max-width: min(800px, calc(100svh - 5rem - 1rem));
    max-height: calc(100svh - 5rem - 1rem);
  }

  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .product-page {
    padding: 0;
    margin-bottom: 2rem;
  }

  .info-col {
    padding: 18px 16px 18px;
  }

  .main-media {
    flex: none;
    aspect-ratio: 1 / 1;
  }

  .thumb-item {
    flex: 0 0 64px;
    height: 64px;
  }

  .thumb-item .t-emoji {
    font-size: 24px;
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {}