/* Product Comments 9: the reviews occupy one full column in the PDP sidebar. */
#product-comments-content.open {
  max-height: none;
}

#product-comments-list .product-comment-list-item {
  display: flex;
  flex-wrap: wrap;
  margin-left: 0;
  margin-right: 0;
}

#product-comments-list .comment-infos,
#product-comments-list .comment-content {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#product-comments-list .comment-content .h4 {
  height: auto;
  min-height: 0;
  margin-bottom: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Keep pagination clear of the button and remove inherited list markers. */
#product-comments-list-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  clear: both;
}

#product-comments-list-pagination {
  position: static;
  float: none;
  width: 100%;
  height: auto;
}

#product-comments-list-pagination ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#product-comments-list-pagination ul li {
  float: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

#product-comments-list-pagination li span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  cursor: pointer;
}

#product-comments-list-pagination li.disabled span {
  cursor: default;
  opacity: .45;
}

#product-comments-list-pagination li.hidden {
  display: none;
}

#product-comments-list-footer > .post-product-comment {
  align-self: center;
  float: none;
  max-width: 100%;
  height: auto;
  white-space: normal;
}

/* The companion script moves dialogs to body, outside sticky containers. */
body#product > .product-comment-modal .modal-dialog {
  margin: 24px auto;
}

#post-product-comment-modal .modal-dialog .h3 {
  height: auto;
}

#post-product-comment-modal #criterions_list {
  padding: 0;
  list-style: none;
}

@media (max-width: 575px) {
  body#product > .product-comment-modal .modal-header,
  body#product > .product-comment-modal .modal-body {
    padding: 16px;
  }

  #post-product-comment-modal .criterion-rating {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin: 12px 0;
  }
}

/* Keep the photo column alongside long product information and open reviews. */
@media (min-width: 992px) {
  body#product .primary_block > .maxbox-product-columns {
    display: flex;
    align-items: flex-start;
  }

  body#product .primary_block > .maxbox-product-columns > .maxbox-product-media-column {
    position: sticky;
    top: var(--maxbox-media-sticky-top, 24px);
    align-self: flex-start;
  }

  body#product .primary_block > .maxbox-product-columns > .maxbox-product-info-column {
    position: static !important;
  }
}

/* Compact review dialog with clear groups, visible focus and inline feedback. */
body#product > .maxbox-review-modal .modal-dialog {
  max-width: 680px;
  margin: 16px auto;
  padding: 0;
}

body#product.maxbox-review-open > .modal-backdrop {
  z-index: 99999998 !important;
}

body#product > .maxbox-review-modal .modal-content {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
}

body#product > .product-comment-modal .modal-content {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 18px 70px rgba(26, 16, 36, .25);
  overflow: hidden;
}

body#product > .maxbox-review-modal .modal-header {
  position: relative;
  flex: 0 0 auto;
  padding: 22px 76px 18px 24px;
  border-bottom: 1px solid #eee8f2;
}

#maxbox-review-modal-title {
  float: none;
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
  text-transform: none;
  color: #2d2236;
}

#maxbox-review-modal-intro {
  margin: 0;
  color: #655e6b;
  font-size: 14px;
  line-height: 1.5;
}

body#product > .product-comment-modal .close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f4eff7;
  color: #594365;
  font-size: 28px;
  opacity: 1;
}

body#product > .maxbox-review-modal .modal-body {
  display: flex;
  flex: 1 1 auto;
  padding: 0;
  overflow: hidden;
  min-height: 0;
}

.maxbox-review-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-width: 100%;
  margin: 0;
}

.maxbox-review-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px;
}

.maxbox-review-product {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 10px 12px;
  margin-bottom: 16px;
  background: #f8f5fa;
  border: 1px solid #eee8f2;
  border-radius: 12px;
}

.maxbox-review-product img {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  margin: 0;
}

.maxbox-review-product p {
  flex: 1;
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 700;
  color: #3c3046;
}

.maxbox-review-rating {
  margin: 0 0 16px;
  padding: 0 0 12px;
  border: 0;
  border-bottom: 1px solid #eee8f2;
}

.maxbox-review-rating legend {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 700;
}

#post-product-comment-modal .maxbox-review-rating #criterions_list {
  margin: 0;
}

#post-product-comment-modal .maxbox-review-rating .criterion-rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 0;
}

#post-product-comment-modal .maxbox-review-rating .grade-stars {
  height: 40px !important;
  width: 188px !important;
  min-width: 188px !important;
  flex: 0 0 188px;
  margin: 0;
}

#post-product-comment-modal .maxbox-review-rating .star-full {
  height: 40px !important;
  gap: 2px !important;
  margin: 0;
}

#post-product-comment-modal .maxbox-review-rating .star-full div.star {
  width: 36px !important;
  height: 40px !important;
  min-width: 36px !important;
  border-radius: 6px;
}

#post-product-comment-modal .maxbox-review-rating .star-full div.star::before {
  width: 36px !important;
  height: 40px !important;
  line-height: 40px !important;
  font-size: 30px !important;
  text-align: center;
}

.maxbox-review-rating-feedback,
.maxbox-review-hint {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  color: #6d6574;
}

#post-product-comment-modal .maxbox-review-form .form-label {
  display: block;
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 700;
  text-align: left;
}

#post-product-comment-modal .maxbox-review-form input[type="text"],
#post-product-comment-modal .maxbox-review-form textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cfc6d6;
  border-radius: 8px;
  background: #fff;
  color: #302536;
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  height: auto;
  min-height: 48px;
  box-shadow: none;
}

#post-product-comment-modal .maxbox-review-form textarea {
  min-height: 112px;
  resize: vertical;
  margin-bottom: 6px;
}

.maxbox-review-fields,
.maxbox-review-scroll > input[type="text"] {
  margin-bottom: 16px;
}

.maxbox-review-hint {
  margin-top: 6px;
}

.maxbox-review-errors {
  padding: 12px 16px;
  margin-bottom: 20px;
  border: 1px solid #e6bdc4;
  border-radius: 8px;
  background: #fff3f4;
  color: #8d263d;
  font-size: 14px;
}

.maxbox-review-errors[hidden] {
  display: none;
}

.maxbox-review-errors ul {
  margin: 0;
  padding-left: 18px;
}

#post-product-comment-modal .maxbox-review-form [aria-invalid="true"] {
  border-color: #b43c56;
}

.maxbox-review-form .maxbox-review-actions {
  display: flex;
  flex: 0 0 auto;
  margin: 0;
  padding: 16px 24px;
  border-top: 1px solid #eee8f2;
  align-items: center;
}

.maxbox-review-actions > div {
  padding: 0;
}

.maxbox-review-actions p.required {
  margin: 0;
}

body#product > .product-comment-modal .btn-comment,
body#product > .product-comment-modal .btn-comment-inverse {
  min-height: 46px;
  height: auto;
  border-radius: 8px;
  box-shadow: none;
  font-size: 14px;
  line-height: 20px;
  padding: 12px 20px;
}

body#product > .product-comment-modal .btn-comment {
  background: #875ba0;
  color: #fff;
}

body#product > .product-comment-modal .btn-comment:hover {
  background: #704687;
}

body#product > .product-comment-modal .btn-comment-inverse {
  background: #fff;
  border: 1px solid #cfc6d6;
  color: #594365;
}

body#product > .product-comment-modal button:focus-visible,
.maxbox-review-form [role="radio"]:focus-visible,
.maxbox-review-form input:focus,
.maxbox-review-form textarea:focus {
  outline: 3px solid rgba(135, 91, 160, .35);
  outline-offset: 2px;
}

.maxbox-review-form button:disabled {
  opacity: .65;
  cursor: wait;
}

@media (max-width: 575px) {
  body#product > .maxbox-review-modal .modal-dialog {
    width: calc(100% - 24px);
    margin: 12px auto;
  }

  body#product > .maxbox-review-modal .modal-header {
    padding: 20px 64px 16px 20px;
  }

  body#product > .maxbox-review-modal .modal-body {
    padding: 0;
  }

  .maxbox-review-scroll {
    padding: 20px;
  }

  .maxbox-review-form .maxbox-review-actions {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px;
  }

  #maxbox-review-modal-title {
    font-size: 22px;
  }

  .maxbox-review-fields > div + div {
    margin-top: 16px;
  }

  .maxbox-review-product {
    padding: 10px;
    gap: 12px;
  }

  .maxbox-review-rating-feedback {
    flex-basis: 100%;
  }

  .maxbox-review-form .post-comment-buttons {
    margin-top: 12px;
  }

  .maxbox-review-form .post-comment-buttons button {
    flex: 1;
  }
}
