/* ProductReview4 page layer. Shared component rules live in components.css. */

/* ProductReviewEvent::detail() addSnippet()s the plugin's default review.twig on both
   Product/detail.twig and review_list.twig, and that snippet jQuery-moves section#item_review
   into div.ec-layoutRole__main. On this renewal list page the new .lx-review cards already
   render every review, so the injected legacy block would duplicate them below the list.
   Suppress only the visual duplicate on the list page; the plugin and its event stay intact
   and PR #27 keeps ownership of the product-detail review block. */
body.review_list #item_review {
    display: none;
}

.lx-review {
    grid-template-columns: minmax(0, 1fr);
    word-break: auto-phrase;
    text-wrap-style: pretty;
}

/* Product names can be one long katakana phrase that auto-phrase will not split;
   let them wrap instead of widening the page at 390px. */
.lx-review h1,
.lx-review-form__product p,
.lx-review-confirm dd {
    overflow-wrap: anywhere;
}

.lx-review-form__panel .lx-notice {
    margin: 0;
}

.lx-review-form__choice-list {
    display: grid;
    gap: var(--lx-s-2);
}

.lx-review-form__choice-list label {
    display: flex;
    align-items: center;
    gap: var(--lx-s-2);
    min-height: var(--lx-touch);
    padding: var(--lx-s-2) var(--lx-s-3);
    border: var(--lx-hairline);
    border-radius: var(--lx-radius-card);
    color: var(--lx-body);
    cursor: pointer;
}

.lx-review-form__choice-list label:has(input:checked) {
    border-color: var(--lx-deep);
    background: var(--lx-mist);
    color: var(--lx-deep);
}

.lx-review-form__choice-list label:has(input:focus-visible) {
    outline: 3px solid var(--lx-deep);
    outline-offset: 2px;
}

.lx-review-form__choices--rating .lx-review-form__choice-list {
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
}

.lx-review-form__choices--rating .lx-review-form__choice-list span {
    letter-spacing: 0.04em;
}

.lx-review-form__fieldset .lx-field__error {
    margin-top: 0;
}

@media (min-width: 768px) {
    /* Keep the primary and back actions together instead of spreading them. */
    .lx-review-form__actions {
        justify-content: start;
        gap: var(--lx-s-3);
    }
}

@media (max-width: 767px) {
    .lx-review-form__actions {
        justify-items: stretch;
    }

    .lx-review-form__actions .lx-btn {
        width: 100%;
    }
}
