.livecommerce-page {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 16px;
  padding: 24px 18px;
  max-width: 1200px;
  /* auto centers it horizontally — margin: 20px 0 (no auto) only added vertical
     spacing and dropped centering, pinning the page flush left. */
  margin: 20px auto;
  box-sizing: border-box;
}

.livecommerce-empty {
  padding: 40px 0;
  text-align: center;
  color: #6b6b6b;
  font-size: 16px;
  font-weight: 700;
}

.livecommerce-row {
  display: flex;
  align-items: stretch;
  gap: 16px;
  height: 310px;
  padding: 2px;
  border-radius: 10px;
  /* ponytail: matches live-block.css's dark card look — same defaults, since this
     page (unlike the theme block) has no merchant color settings to read from. */
  background: #202124;
  color: #e8eaed;
}

.livecommerce-preview {
  position: relative;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 420px;
  /* height: 100%; */
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}

.livecommerce-preview-video {
  min-height: 0;
  width: 100%;
  height: 100%;
}

.livecommerce-preview-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.livecommerce-watch-cue {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  gap: 7px;

  min-height: 34px;
  padding: 7px 13px;

  background: rgba(55, 55, 55, 0.88);
  color: #fff;

  border-radius: 999px;

  font-size: 16px;
  font-weight: 500;
  line-height: 1;

  white-space: nowrap;

  pointer-events: none;
  z-index: 5;

  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.livecommerce-watch-cue svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: block;
}

.livecommerce-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  background: #E02020;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 4px;
}

.livecommerce-viewer-count {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.livecommerce-viewer-count[hidden] {
  display: none;
}

.livecommerce-viewer-count--preview {
  top: 10px;
  left: auto;
  right: 10px;
  padding: 4px 8px;
  font-size: 11px;
}

/* ponytail: shared base + scoped modal override, matching live-block.css's
   .livecom-mute-toggle/.livecom-play-toggle architecture — one pair of classes
   reused by both preview and modal buttons instead of separate modal-* classes. */
.livecommerce-mute-toggle,
.livecommerce-play-toggle {
  position: absolute;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(45, 45, 45, 0.90);
  color: #fff;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.livecommerce-mute-toggle svg,
.livecommerce-play-toggle svg {
  display: block;
  flex-shrink: 0;
}

.livecommerce-mute-toggle:hover,
.livecommerce-play-toggle:hover {
  background: rgba(35, 35, 35, 0.96);
  transform: scale(1.05);
}

.livecommerce-mute-toggle:active,
.livecommerce-play-toggle:active {
  transform: scale(0.94);
}

.livecommerce-mute-toggle:disabled,
.livecommerce-play-toggle:disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.livecommerce-mute-toggle--preview,
.livecommerce-play-toggle--preview {
  top: auto;
  bottom: 8px;
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.livecommerce-mute-toggle--preview {
  left: 8px;
  right: auto;
}

.livecommerce-play-toggle--preview {
  left: 44px;
  right: auto;
}

.livecommerce-mute-toggle--preview svg {
  width: 14px;
  height: 14px;
}

.livecommerce-play-toggle--preview svg {
  width: 13px;
  height: 13px;
}

/* modal variants — scoped by ancestor, same class as preview */
.livecommerce-modal-video-col .livecommerce-mute-toggle,
.livecommerce-modal-video-col .livecommerce-play-toggle {
  bottom: 10px;
  width: 28px;
  height: 28px;
  background: rgba(55, 55, 55, 0.90);
}

.livecommerce-modal-video-col .livecommerce-mute-toggle {
  left: 10px;
  right: auto;
}

.livecommerce-modal-video-col .livecommerce-play-toggle {
  left: 48px;
  right: auto;
}

.livecommerce-modal-video-col .livecommerce-mute-toggle svg,
.livecommerce-modal-video-col .livecommerce-play-toggle svg {
  width: 14px;
  height: 14px;
}

.livecommerce-modal-video-col .livecommerce-mute-toggle:hover,
.livecommerce-modal-video-col .livecommerce-play-toggle:hover {
  background: rgba(65, 65, 65, 0.96);
  transform: scale(1.05);
}

.livecommerce-products {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 14px;
  padding: 2px 2px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.livecommerce-products::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.livecommerce-product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 190px;
  gap: 0;
  padding: 0;
  margin-bottom: 0;
  /* ponytail: explicit height instead of relying on a 4-level flex stretch
     chain (row > products > card > image) — that chain wasn't resolving
     reliably, collapsing the image to ~20px. Matches row's inner height:
     310px row height minus 16px top/bottom padding, this is the one axis
     where the standalone page's card intentionally keeps its own fix
     instead of live-block.css's stretch-based sizing. */
  /* height: 273px; */
  scroll-snap-align: start;
  background: #2a2b2f;
  background: linear-gradient(180deg, #2a2b2f 0%, color-mix(in srgb, #2a2b2f 90%, black 10%) 100%);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.livecommerce-product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 106, 0, 0.5);
}

.livecommerce-product-card.is-featured {
  box-shadow: 0 0 0 1px #FF6A00, 0 10px 22px rgba(0, 0, 0, 0.4);
}

.livecommerce-product-card-image {
  width: 100%;
  flex: 1;
  min-height: 0;
  border-radius: 0;
  background: #f4f1ec;
  overflow: hidden;
}

.livecommerce-product-card-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  padding: 6px;
  box-sizing: border-box;
  transition: transform 0.25s ease;
}

.livecommerce-product-card:hover .livecommerce-product-card-image img {
  transform: scale(1.15);
}

.livecommerce-product-card-cta {
  display: none;
}

.livecommerce-product-card-featured-tag {
  display: none;
}

.livecommerce-product-card.is-featured .livecommerce-product-card-featured-tag {
  display: block;
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 3px 7px;
  border-radius: 4px;
  background: #FF6A00;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.livecommerce-product-card-info {
  flex-shrink: 0;
  padding: 10px 10px 12px;
}

.livecommerce-product-card-title {
  white-space: normal;
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  min-height: 2.6em;
}

.livecommerce-product-card-price {
  font-size: 13px;
  font-weight: 700;
  color: #FF6A00;
  letter-spacing: 0.2px;
  margin: 0;
}

.livecommerce-product-card-add-btn {
  width: 100%;
  margin-top: 6px;
  padding: 6px 0;
  border: none;
  border-radius: 6px;
  background: #FF6A00;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.livecommerce-product-card-add-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.livecommerce-product-card.is-sold-out .livecommerce-product-card-image img {
  opacity: 0.5;
}

.livecommerce-product-card.is-sold-out .livecommerce-product-card-add-btn {
  background: #6b6b6b;
}

.livecommerce-product-card-price-original {
  text-decoration: line-through;
  color: #9aa0a6;
  font-weight: 500;
  font-size: 12px;
  margin-right: 6px;
}

.livecommerce-product-card-discount-badge {
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #E02020;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.livecommerce-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.livecommerce-modal[hidden] {
  display: none;
}

.livecommerce-modal-inner {
  position: relative;
  width: min(96vw, 1440px);
  height: min(92vh, 860px);
  display: flex;
  background: #202124;
  border-radius: 12px;
  overflow: hidden;
}

.livecommerce-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.livecommerce-modal-video-col {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #000;
}

.livecommerce-modal-video {
  flex: 1;
  min-height: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.livecommerce-modal-video video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.livecommerce-modal-products {
  flex-shrink: 0;
  /* ponytail: fixed 360px stayed rigid at every width, squeezing the video into
     whatever was left over on narrow screens — scaling with the modal instead
     keeps both sides proportionate, so no stacking breakpoint is needed at all. */
  width: min(360px, 38%);
  padding: 20px;
  overflow-y: auto;
  color: #e8eaed;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.livecommerce-modal-products::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.livecommerce-modal-heading {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
}

/* ponytail: modal card scoped to match live-block.css's .livecom-product-card
   (the homepage widget's modal card) property-for-property, since the base
   .livecommerce-product-card above is tuned for the row/preview strip instead. */
.livecommerce-modal-product-list .livecommerce-product-card {
  flex-direction: column;
  width: 100%;
  height: auto;
  padding: 0;
  border-radius: 10px;
  background: #292a2d;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.livecommerce-modal-product-list .livecommerce-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 106, 0, 0.4);
}

.livecommerce-modal-product-list .livecommerce-product-card.is-featured {
  border-color: #FF6A00;
  box-shadow: 0 0 0 1px #FF6A00;
}

.livecommerce-modal-product-list .livecommerce-product-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  flex: none;
  background: #f2ede4;
}

.livecommerce-modal-product-list .livecommerce-product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  padding: 0;
  display: block;
}

.livecommerce-modal-product-list .livecommerce-product-card-info {
  min-width: 0;
  padding: 12px 14px 14px;
}

.livecommerce-modal-product-list .livecommerce-product-card-title {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 6px;
  line-height: 1.3;
}

.livecommerce-modal-product-list .livecommerce-product-card-price {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
}

.livecommerce-modal-product-list .livecommerce-product-card-add-btn {
  margin-top: 8px;
  padding: 7px 0;
  font-size: 12px;
}

@media (max-width: 720px) {
  .livecommerce-row {
    flex-direction: column;
    height: auto;
  }
  .livecommerce-preview {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
  .livecommerce-watch-cue {
    font-size: 13px;
    padding: 7px 11px;
    gap: 6px;
  }
  .livecommerce-watch-cue svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 640px) {
  /* ponytail: video-then-products stacking for the modal on phones — the fluid
     width alone still left the product panel too narrow to be usable at this
     size, so switch to a column with the video pinned to the top instead. */
  .livecommerce-modal-inner {
    flex-direction: column;
  }
  .livecommerce-modal-video-col {
    order: -1;
    flex: none;
    width: 100%;
    /* height:100% (base rule) blocks aspect-ratio from taking effect unless
       reset to auto here. */
    height: auto;
    aspect-ratio: 16 / 9;
  }
  .livecommerce-modal-products {
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow-y: hidden;
  }
  /* horizontal scrolling row instead of a stacked list — matches the
     preview strip's card layout instead of the desktop modal's list one. */
  .livecommerce-modal-product-list {
    display: flex;
    /* ponytail: row's default align-items:stretch was pulling every card to
       the full row height, leaving each card's bottom half blank — align to
       the top instead so a card is only as tall as its own content. */
    align-items: flex-start;
    gap: 12px;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .livecommerce-modal-product-list::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }
  .livecommerce-modal-product-list .livecommerce-product-card {
    flex-shrink: 0;
    width: 140px;
    height: auto;
    margin-bottom: 0;
  }
}
