/* ══════════════════════════════════════════════════════════════════
   Swordis — review modal (assets/js/review-modal.js)
   Product page 'Customer Reviews' + homepage 'From our customers'.
   On the product page this loads before product.css, whose mobile rules
   override the shared base rules below (.pdp-avatar, .pdp-modal-overlay).
   ══════════════════════════════════════════════════════════════════ */

/* Reviewer avatar, date, verified badge, aspect pairs, video play badge */
.pdp-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .02em;
  flex-shrink: 0;
}

.pdp-rev-date {
  font-size: 13px;
  color: var(--fg-tertiary);
}

.pdp-rev-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ok-600, #0b6b3a);
  font-weight: 600;
  letter-spacing: .04em;
}

.pdp-rev-subs {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 13px;
  flex-wrap: wrap;
}

.pdp-rev-subs span.k {
  color: var(--fg-tertiary);
}

.pdp-rev-subs .pair {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pdp-rev-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(11, 19, 16, .58);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 2px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* Modal thumbnails carry real media too */
.pdp-revmodal-thumbs button {
  position: relative;
  overflow: hidden;
}

.pdp-revmodal-thumbs button img,
.pdp-revmodal-thumbs button video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pdp-revmodal-thumbs .pdp-rev-play {
  width: 20px;
  height: 20px;
}

/* Real media inside the modal stage */
.pdp-revmodal-img.is-label {
  background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 100%);
}

.pdp-revmodal-img:not(.is-label) {
  background: transparent;
  aspect-ratio: auto;
  width: 100%;
  height: 100%;
}

.pdp-revmodal-img img,
.pdp-revmodal-img video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

/* Review expand modal */
.pdp-revmodal {
  position: relative;
  width: min(1040px, 100%);
  max-height: 92vh;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  grid-template-rows: minmax(0, 1fr);
}

.pdp-revmodal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-900);
  cursor: pointer;
}

.pdp-revmodal-gallery {
  background: #1a1a1a;
  color: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.pdp-revmodal-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  overflow: hidden;
}

.pdp-revmodal-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 100%;
  border-radius: 4px;
  background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: rgba(255, 255, 255, .5);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pdp-revmodal-arrow {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: var(--ink-900);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pdp-revmodal-arrow:disabled {
  opacity: .4;
  cursor: default;
}

.pdp-revmodal-arrow--r {
  left: auto;
  right: 12px;
}

.pdp-revmodal-thumbs {
  padding: 16px 20px;
  display: flex;
  gap: 8px;
  justify-content: center;
  background: rgba(0, 0, 0, .3);
}

.pdp-revmodal-thumbs button {
  width: 44px;
  height: 44px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .08);
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}

.pdp-revmodal-thumbs button.is-active {
  border-color: #fff;
}

.pdp-revmodal-body {
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  max-height: 92vh;
  overflow: hidden;
}

.pdp-revmodal-who {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.pdp-revmodal-who .pdp-avatar {
  width: 48px;
  height: 48px;
  font-size: 19px;
}

.pdp-revmodal-name {
  font-size: 16px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pdp-revmodal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-size: 17px;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: -.01em;
}

.pdp-revmodal-text {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  font-size: 16px;
  line-height: 26px;
  color: var(--fg-body);
}

.pdp-revmodal-text p {
  margin: 0 0 10px;
}

.pdp-revmodal-subs {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .pdp-revmodal {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    overflow-y: auto;
  }

  .pdp-revmodal-gallery {
    min-height: 320px;
  }

  .pdp-revmodal-body {
    max-height: none;
    overflow: visible;
  }

  .pdp-revmodal-text {
    overflow: visible;
  }
}

/* Overlay — also used by the other product page dialogs (single-product-popups.php) */
.pdp-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 26, 24, .45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 16px;
  overflow-y: auto;
}

/* Dark blurred overlay (ask-a-question / review expand — matches prototype).
   Must come after the base rule so it wins the cascade. */
.pdp-modal-overlay--dark {
  background: rgba(0, 0, 0, .82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  padding: 24px;
}

@media (max-width: 720px) {
  .pdp-modal-overlay {
    padding: 40px 12px;
  }
}
