/* Phase 03B — review badges (BEST / 한달사용) */
.okgs-review-badges,
.okgs-review-modal__badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: 8px;
  vertical-align: middle;
}

.okgs-review-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.okgs-review-badge--best {
  background: #111;
  color: #fff;
}

.okgs-review-badge--after-use {
  background: #eef4ff;
  color: #1a56db;
  border: 1px solid #c7d7fe;
}

.okgs-review-modal__badges {
  display: flex;
  margin-left: 0;
  margin-top: 6px;
}

/* Phase 2B — review list thumbnail: PC right-fixed, mobile Naver-style (v1.0.42) */
/* Phase 3A-6/3A-7 — compact fixed-height list cards (PC), 3-line clamp + ellipsis.
   Mobile list: Naver-style 2-line body + right thumbnail (v1.0.42). */

.okgs-has-review-media .comment_container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

li.okgs-review-clickable .comment_container {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

/* Phase 3A-5 — full-card hover: a li-level overlay fills the rounded card shell
   edge-to-edge when the pointer is anywhere inside .comment_container. */
#comments .commentlist.wd-review-style-2 > li.review.okgs-review-clickable {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 0 !important;
}

#comments .commentlist.wd-review-style-2 > li.review.okgs-review-clickable::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: transparent;
  transition: background-color 0.15s ease;
  pointer-events: none;
}

#comments .commentlist.wd-review-style-2 > li.review.okgs-review-clickable:has(.comment_container:hover)::before {
  background-color: #f5f5f5;
}

#comments .commentlist > li.okgs-review-clickable .comment_container:hover {
  background-color: #f5f5f5 !important;
}

#comments .commentlist > li.okgs-review-clickable .comment_container {
  position: relative;
  z-index: 1;
}

#comments .commentlist.wd-review-style-2 > li.review.okgs-review-clickable > .comment_container {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0 !important;
  width: auto !important;
  max-width: none !important;
}

#comments .commentlist > li.okgs-review-clickable .comment_container,
#comments .commentlist > li.okgs-review-clickable .comment-text,
#comments .commentlist > li.okgs-review-clickable .okgs-review-media-preview,
#comments .commentlist > li.okgs-review-clickable .okgs-review-image-button {
  background-color: transparent !important;
}

.okgs-has-review-media .comment-text {
  flex: 1 1 auto;
  min-width: 0;
}

.okgs-review-media-preview {
  flex: 0 0 120px;
  width: 120px;
  margin: 0;
  padding: 0;
  align-self: center;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.okgs-review-image-button {
  display: block;
  width: 100%;
  padding: 0 !important;
  margin: 0;
  border: 0 !important;
  background: transparent !important;
  cursor: pointer;
  line-height: 0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: none !important;
}

.okgs-review-media-preview img,
.okgs-review-media-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
}

/* Video-only review card: poster + play overlay. */
.okgs-review-image-button--video {
  position: relative;
}

.okgs-review-media-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  padding: 7px;
  box-sizing: border-box;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  fill: #fff;
  pointer-events: none;
}

@media (max-width: 768px) {
  .okgs-review-media-play {
    width: 26px;
    height: 26px;
    padding: 6px;
  }
}

/* ---------------------------------------------------------------------- */
/* Phase 3A-6/3A-7 — fixed-height review list cards + 3-line body clamp   */
/* ---------------------------------------------------------------------- */

@media (min-width: 769px) {
  #comments .commentlist > li.review {
    margin-bottom: 10px;
  }

  #comments .commentlist > li.okgs-review-clickable {
    box-sizing: border-box;
    height: 144px;
    min-height: 144px;
    max-height: 144px;
  }

  #comments .commentlist .comment_container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    margin: 0 !important;
    padding: 0 12px;
    overflow: hidden;
  }

  #comments .commentlist .comment-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 8px 0;
    background: transparent;
  }

  #comments .commentlist .comment-text .meta {
    margin: 0 0 4px;
    line-height: 1.3;
  }

  #comments .commentlist .comment-text .star-rating {
    margin: 0 0 6px;
  }

  #comments .commentlist .comment-text .description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    max-height: calc(1.45em * 3);
    flex: 1 1 auto;
    min-height: 0;
    word-break: break-word;
  }

  #comments .commentlist .comment-text .description p {
    margin: 0;
  }

  #comments .commentlist .okgs-has-review-media .comment-text {
    flex: 1 1 auto;
  }

  #comments .commentlist .okgs-review-media-preview {
    flex: 0 0 120px;
    width: 120px;
    flex-shrink: 0;
    align-self: center;
    margin: 0;
    padding: 0 !important;
    background: transparent !important;
    border: 0;
    box-shadow: none !important;
  }

  #comments .commentlist .okgs-review-image-button {
    padding: 0 !important;
    margin: 0;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }
}

@media (max-width: 768px) {
  /* Naver-style mobile card: compact meta/stars + 3-line body left + 84px thumb right */
  #comments .commentlist.wd-review-style-2 > li.review.okgs-review-clickable {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  #comments .commentlist.wd-review-style-2 > li.review.okgs-review-clickable > .comment_container {
    position: relative;
    inset: auto;
    width: 100% !important;
    max-width: 100% !important;
  }

  #comments .commentlist > li.review {
    margin-bottom: 8px;
  }

  #comments .commentlist > li.okgs-review-clickable {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  #comments .commentlist .comment_container {
    box-sizing: border-box;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    margin: 0 !important;
    padding: 6px 14px 12px;
    overflow: visible;
  }

  #comments .commentlist .comment-text .meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 0;
    line-height: 1.2;
  }

  #comments .commentlist .comment-text .meta .woocommerce-review__author {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #comments .commentlist .comment-text .meta .woocommerce-review__published-date {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  #comments .commentlist .comment-text .star-rating {
    margin: 0 0 10px;
    font-size: 12px;
    letter-spacing: 1px;
    line-height: 1;
  }

  #comments .commentlist .comment-text .description {
    display: -webkit-box !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    padding-bottom: 1px;
    font-size: 16px;
    line-height: 1.5;
    height: auto;
    max-height: none;
    max-block-size: none;
    min-width: 0;
    min-height: 0;
    word-break: keep-all;
    overflow-wrap: break-word;
    white-space: normal;
  }

  #comments .commentlist .comment-text .description p {
    margin: 0;
    padding: 0;
  }

  /* With media: grid — body left, thumbnail right on same row */
  #comments .commentlist > li.okgs-has-review-media .comment_container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 84px;
    grid-template-rows: auto auto auto;
    column-gap: 10px;
    row-gap: 0;
    align-items: start;
  }

  #comments .commentlist > li.okgs-has-review-media .comment-text {
    display: contents;
  }

  #comments .commentlist > li.okgs-has-review-media .comment-text .meta {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  #comments .commentlist > li.okgs-has-review-media .comment-text .star-rating {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0 0 10px;
  }

  #comments .commentlist > li.okgs-has-review-media .comment-text .description {
    grid-column: 1;
    grid-row: 3;
    align-self: start;
    display: -webkit-box !important;
  }

  #comments .commentlist > li.okgs-has-review-media .okgs-review-media-preview {
    grid-column: 2;
    grid-row: 3;
    align-self: center;
    justify-self: end;
    flex: 0 0 84px;
    width: 84px;
    max-width: 84px;
    margin: 0;
    padding: 0 !important;
    background: transparent !important;
    border: 0;
    box-shadow: none !important;
    overflow: hidden;
  }

  #comments .commentlist > li.okgs-has-review-media .okgs-review-image-button {
    width: 84px;
    height: 84px;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  #comments .commentlist > li.okgs-has-review-media .okgs-review-media-thumb {
    width: 84px;
    height: 84px;
    object-fit: cover;
  }

  /* Without media: single column, body uses full width */
  #comments .commentlist > li.okgs-review-clickable:not(.okgs-has-review-media) .comment_container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  #comments .commentlist > li.okgs-review-clickable:not(.okgs-has-review-media) .comment-text {
    flex: none;
    min-height: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    background: transparent;
  }

  /* Narrow mobile (Fold cover / in-app): tighter padding, 80px thumb, 15px body */
  @media (max-width: 340px) {
    #comments .commentlist .comment_container {
      padding: 4px 12px 10px;
    }

    #comments .commentlist .comment-text .meta {
      gap: 6px;
      font-size: 13px;
    }

    #comments .commentlist .comment-text .meta .woocommerce-review__published-date {
      font-size: 12px;
    }

    #comments .commentlist .comment-text .description {
      font-size: 15px;
      line-height: 1.5;
    }

    #comments .commentlist > li.okgs-has-review-media .comment_container {
      grid-template-columns: minmax(0, 1fr) 80px;
      column-gap: 8px;
    }

    #comments .commentlist > li.okgs-has-review-media .okgs-review-media-preview {
      flex: 0 0 80px;
      width: 80px;
      max-width: 80px;
    }

    #comments .commentlist > li.okgs-has-review-media .okgs-review-image-button {
      width: 80px;
      height: 80px;
    }

    #comments .commentlist > li.okgs-has-review-media .okgs-review-media-thumb {
      width: 80px;
      height: 80px;
    }
  }
}

/* ---------------------------------------------------------------------- */
/* Phase 3A (final) — review-browser modal                                */
/* Whole review card -> this modal. Prev/next arrows swap the ENTIRE       */
/* review (author/rating/date/content/media), not just the image.         */
/* ---------------------------------------------------------------------- */

.okgs-review-modal {
  position: fixed;
  inset: 0;
  z-index: 999997;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.78);
}

.okgs-review-modal[hidden] {
  display: none !important;
}

.okgs-review-modal__dialog {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 84vw;
  height: 90vh;
  max-width: 1320px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.35);
}

.okgs-review-modal__topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid #eee;
}

.okgs-review-modal__position {
  font-size: 16px;
  font-weight: 700;
  color: #222;
}

.okgs-review-modal__close {
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #f5f5f5;
  color: #111;
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.okgs-review-modal__close svg {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px;
  min-height: 36px;
  flex-shrink: 0;
  display: block;
}

.okgs-review-modal__body {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.okgs-review-modal__image-col {
  flex: 1 1 58%;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: #f7f7f7;
  padding: 24px 24px 16px;
  box-sizing: border-box;
}

.okgs-review-modal__image-stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.okgs-review-modal__media-stage {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

.okgs-review-modal__big-image-btn {
  display: flex;
  max-width: 100%;
  max-height: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: zoom-in;
}

.okgs-review-modal__big-image-btn[hidden] {
  display: none !important;
}

.okgs-review-modal__big-image-btn img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 200px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}

.okgs-review-modal__big-video-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
}

.okgs-review-modal__big-video-wrap[hidden] {
  display: none !important;
}

.okgs-review-modal__big-video {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 200px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  background: #111;
}

.okgs-review-modal__no-image {
  color: #999;
  font-size: 14px;
}

.okgs-review-modal__no-image[hidden] {
  display: none !important;
}

.okgs-review-modal__info-col {
  flex: 0 0 40%;
  max-width: 480px;
  min-width: 300px;
  padding: 32px 36px;
  overflow: hidden;
  box-sizing: border-box;
  border-left: 1px solid #eee;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.okgs-review-modal__author {
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 8px;
  color: #111;
}

.okgs-review-modal__meta {
  margin-bottom: 20px;
}

.okgs-review-modal__rating {
  color: #f5a623;
  letter-spacing: 4px;
  font-size: 26px;
  line-height: 1;
}

.okgs-review-modal__date {
  color: #999;
  font-size: 13px;
  margin-left: 10px;
}

.okgs-review-modal__content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.75;
  color: #333;
  word-break: break-word;
  margin-bottom: 0;
}

.okgs-review-modal__thumbs {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  margin-top: auto;
  padding: 16px 0 0;
  margin-bottom: 0;
  border-top: 1px solid #eee;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

.okgs-review-modal__thumbs::-webkit-scrollbar {
  height: 4px;
}

.okgs-review-modal__thumbs::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}

.okgs-review-modal__thumbs:empty {
  display: none;
  padding: 0;
  border-top: 0;
}

.okgs-review-modal__thumb-btn {
  position: relative;
  flex: 0 0 84px;
  flex-shrink: 0;
  width: 84px;
  height: 84px;
  padding: 0 !important;
  margin: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  background: transparent;
  line-height: 0;
  display: block;
  box-sizing: border-box;
  transition: outline-color 0.15s ease;
}

.okgs-review-modal__thumb-btn.is-video {
  background: #222;
}

.okgs-review-modal__thumb-video-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #333 0%, #111 100%);
}

.okgs-review-modal__play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  fill: rgba(255, 255, 255, 0.95);
  pointer-events: none;
}

.okgs-review-modal__thumb-btn img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  object-fit: cover;
  object-position: center;
}

.okgs-review-modal__thumb-btn.is-active {
  outline: 2px solid #111;
  outline-offset: 0;
}

/* Prev/next REVIEW arrows — positioned on active media center via JS (review-media.js).
   !important on position: theme generic `button { position: relative }` breaks absolute. */
.okgs-review-modal__arrow {
  position: absolute !important;
  top: 50%;
  left: auto;
  right: auto;
  transform: translateY(-50%);
  visibility: hidden;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.okgs-review-modal__arrow svg {
  width: 34px;
  height: 34px;
  display: block;
  flex: 0 0 auto;
  pointer-events: none;
}

.okgs-review-modal__arrow:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.28);
}

.okgs-review-modal__arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.okgs-review-modal__arrow.is-positioned {
  visibility: visible;
}

@media (max-width: 768px) {
  /* Hide WoodMart sticky bottom toolbar while the review modal is open (JS toggles body class). */
  body.okgs-review-modal-open .wd-toolbar {
    display: none !important;
  }

  .okgs-review-modal {
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
  }

  .okgs-review-modal__dialog {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: 100vh;
    border-radius: 0;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .okgs-review-modal__topbar {
    position: sticky;
    top: 0;
    z-index: 6;
    flex-shrink: 0;
    padding: 10px 16px;
    background: #fff;
  }

  .okgs-review-modal__close svg {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px;
    min-height: 28px;
  }

  .okgs-review-modal__body {
    flex: 0 0 auto;
    flex-direction: column;
    overflow: visible;
    min-height: auto;
  }

  .okgs-review-modal__image-col {
    flex: 0 0 auto;
    position: relative;
    padding: 8px 16px 12px;
    background: #fff;
  }

  .okgs-review-modal__image-stage {
    min-height: 0;
    flex: 0 0 auto;
  }

  .okgs-review-modal__media-stage {
    width: fit-content;
    max-width: 100%;
  }

  .okgs-review-modal__big-image-btn {
    max-width: 100%;
  }

  .okgs-review-modal__big-image-btn img {
    max-width: calc(100vw - 32px);
    max-height: 55vh;
    width: auto;
    height: auto;
    object-fit: contain;
  }

  .okgs-review-modal__big-video {
    max-width: calc(100vw - 32px);
    max-height: 55vh;
    width: auto;
    height: auto;
    object-fit: contain;
  }

  .okgs-review-modal__thumbs {
    padding: 12px 0 0;
    gap: 5px;
    margin-top: 16px;
    border-top: 1px solid #eee;
  }

  .okgs-review-modal__thumb-btn {
    flex: 0 0 72px;
    flex-shrink: 0;
    width: 72px;
    height: 72px;
  }

  .okgs-review-modal__play-icon {
    width: 24px;
    height: 24px;
  }

  .okgs-review-modal__info-col {
    flex: 0 0 auto;
    max-width: none;
    min-width: 0;
    overflow: visible;
    border-left: 0;
    border-top: 0;
    padding: 0 18px 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  }

  .okgs-review-modal__author {
    font-size: 16px;
    margin: 0 0 6px;
  }

  .okgs-review-modal__meta {
    margin-bottom: 14px;
  }

  .okgs-review-modal__rating {
    font-size: 22px;
    letter-spacing: 3px;
  }

  .okgs-review-modal__date {
    font-size: 13px;
  }

  .okgs-review-modal__content {
    flex: 0 0 auto;
    min-height: auto;
    max-height: none;
    height: auto;
    overflow: visible;
    font-size: 17px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .okgs-review-modal__arrow {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
  }

  .okgs-review-modal__arrow svg {
    width: 30px;
    height: 30px;
  }
}

/* ---------------------------------------------------------------------- */
/* Phase 3A — gallery lightbox (WoodMart PhotoSwipe, reused)              */
/* ---------------------------------------------------------------------- */

/* PhotoSwipe is a sitewide singleton; force it above our own modal
   (999997) whenever it is opened (from review list or review modal). */
.pswp {
  z-index: 1000000 !important;
}

.okgs-pswp-thumbs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000010;
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.35);
  overflow-x: auto;
}

.okgs-pswp-thumb {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  padding: 0;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.6;
  background: transparent;
}

.okgs-pswp-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.okgs-pswp-thumb.is-active {
  border-color: #fff;
  opacity: 1;
}
