/* Product reviews — theme-native block (replaces Photo Reviews plugin output). */

.mg-reviews {
    display: grid;
    gap: 20px;
}

.mg-reviews__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    gap: 24px;
    align-items: start;
}

.mg-reviews__head:has(> :only-child) {
    grid-template-columns: 1fr;
}

.mg-reviews__title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
}

.mg-reviews__intro p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

/* Score summary */
.mg-reviews__score {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
}

.mg-reviews__avg {
    display: grid;
    justify-items: center;
    gap: 4px;
}

.mg-reviews__avg b {
    font-size: 36px;
    line-height: 1;
    color: var(--text);
}

.mg-reviews__avg small {
    color: var(--muted);
    font-size: 12px;
}

.mg-reviews__bars {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
}

.mg-reviews__bars li {
    display: grid;
    grid-template-columns: 28px 1fr 22px;
    gap: 8px;
    align-items: center;
}

.mg-reviews__bars i {
    height: 6px;
    border-radius: 3px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    overflow: hidden;
}

.mg-reviews__bars em {
    display: block;
    height: 100%;
    background: var(--accent);
    transform-origin: left;
    animation: mg-bar-grow .8s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes mg-bar-grow {
    from { transform: scaleX(0); }
}

/* Stars */
.mg-stars {
    position: relative;
    display: inline-block;
    font-size: 16px;
    line-height: 1;
    letter-spacing: 2px;
    color: var(--line-2);
}

.mg-stars::before {
    content: "★★★★★";
}

.mg-stars__fill {
    position: absolute;
    inset: 0 auto 0 0;
    overflow: hidden;
    white-space: nowrap;
    color: var(--accent);
}

.mg-stars__fill::before {
    content: "★★★★★";
}

.mg-stars--sm {
    font-size: 14px;
}

/* List */
.mg-reviews__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.mg-review {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    transition: border-color .2s ease;
}

.mg-review:hover {
    border-color: var(--line-2);
}

.mg-review__head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mg-review__avatar {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--accent);
    font-weight: 800;
    font-size: 14px;
}

.mg-review__who {
    display: grid;
    gap: 2px;
    margin-right: auto;
}

.mg-review__who b {
    color: var(--text);
}

.mg-review__who small {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mg-review__verified {
    color: var(--mg-success);
    font-weight: 600;
}

.mg-review__verified::before {
    content: "✓ ";
}

.mg-review__text {
    margin-top: 12px;
    color: #374151;
    line-height: 1.6;
}

.mg-review__text > :first-child { margin-top: 0; }
.mg-review__text > :last-child { margin-bottom: 0; }

.mg-review__reply {
    margin-top: 12px;
    padding: 12px 14px;
    border-left: 3px solid var(--accent);
    background: var(--surface-2);
    border-radius: 0 12px 12px 0;
    color: #374151;
}

.mg-review__reply p { margin: 4px 0 0; }

.mg-reviews__empty {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px dashed var(--line-2);
    border-radius: 16px;
    color: var(--muted);
}

.mg-reviews__empty span {
    font-size: 24px;
    color: var(--accent);
}

.mg-reviews__empty p { margin: 0; }

.mg-reviews__notice {
    padding: 12px 16px;
    border: 1px solid var(--mg-success);
    border-radius: 12px;
    color: var(--mg-success);
    font-weight: 600;
}

/* Form */
.mg-review-form {
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.mg-review-form .comment-reply-title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
}

.mg-review-form__note {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 13px;
}

.mg-review-form .comment-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

.mg-review-form .comment-form > * {
    grid-column: 1 / -1;
}

.mg-review-form .comment-form > .comment-form-author { grid-column: 1; }
.mg-review-form .comment-form > .comment-form-email { grid-column: 2; }

.mg-review-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}

.mg-review-form .required {
    color: var(--accent);
}

.mg-review-form p,
.mg-review-form .comment-form-rating {
    margin: 0 0 14px;
}

.mg-review-form input[type="text"],
.mg-review-form input[type="email"],
.mg-review-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: #fff;
    font: inherit;
    color: var(--text);
    transition: border-color .16s ease;
}

.mg-review-form textarea {
    min-height: 120px;
    resize: vertical;
}

.mg-review-form input:focus,
.mg-review-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.mg-review-form .form-submit {
    margin: 4px 0 0;
}

.mg-review-form .form-submit .mg-p-btn {
    height: 46px;
    padding: 0 24px;
}

.mg-review-form .form-submit .mg-p-btn:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.mg-review-form .ml-recaptcha {
    margin-bottom: 14px;
}

/* WooCommerce turns select#rating into p.stars links */
.mg-review-form .comment-form-rating select[style*="none"] + p.stars,
.mg-review-form p.stars {
    margin: 0;
    line-height: 1;
}

.mg-review-form p.stars span {
    display: inline-flex;
    gap: 4px;
}

.mg-review-form p.stars a {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 32px;
    font-size: 0;
    text-indent: 0;
    text-decoration: none;
    color: transparent;
}

.mg-review-form p.stars a::before {
    content: "★";
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    font-family: inherit;
    font-size: 30px;
    line-height: 32px;
    text-indent: 0;
    color: var(--line-2);
    transition: color .12s ease, transform .12s ease;
}

.mg-review-form p.stars:hover a::before,
.mg-review-form p.stars.selected a::before {
    color: var(--accent);
    content: "★";
}

.mg-review-form p.stars a:hover ~ a::before,
.mg-review-form p.stars.selected a.active ~ a::before {
    color: var(--line-2);
    content: "★";
}

.mg-review-form p.stars a:hover::before {
    transform: scale(1.15);
}

.ml-review-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media (max-width: 720px) {
    .mg-reviews__head,
    .mg-review-form .comment-form {
        grid-template-columns: 1fr;
    }

    .mg-review-form .comment-form > .comment-form-author,
    .mg-review-form .comment-form > .comment-form-email {
        grid-column: 1;
    }

    .mg-review__head {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mg-reviews__bars em { animation: none; }
}
