.product-review-section {
    --pr-primary: var(--pdt-btn-cart-hover-bg-color, var(--theme-default-color, #3eae1e));
    --pr-primary-dark: var(--pdt-btn-cart-hover-border-color, var(--theme-hover-color, #2d8a16));
    --pr-primary-soft: color-mix(in srgb, var(--pr-primary) 10%, #ffffff);
    --pr-primary-soft-2: color-mix(in srgb, var(--pr-primary) 5%, #ffffff);
    --pr-border: var(--pdt-box-border-color, #e8edf2);
    --pr-border-dark: color-mix(in srgb, var(--pr-primary) 28%, #ffffff);
    --pr-text: var(--pdt-box-title-color, #2d2a4a);
    --pr-muted: var(--pdt-box-body-color, #7d7896);
    --pr-muted-2: color-mix(in srgb, var(--pr-muted) 85%, #ffffff);
    --pr-star: #ffbf2f;
    --pr-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
    --pr-shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.1);
    --pr-radius: 24px;
    width: 100%;
    background: #fff;
    border: 1px solid var(--pr-border);
    border-radius: var(--pr-radius);
    padding: 28px;
    box-shadow: var(--pr-shadow);
    margin-top: 24px;
}

.product-review-section .review-section-header {
    margin-bottom: 22px;
}

.product-review-section .review-section-header h2 {
    position: relative;
    margin: 0 0 8px;
    padding-bottom: 10px;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--pr-text);
}

.product-review-section .review-section-header h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 54px;
    height: 3px;
    border-radius: 30px;
    background: var(--pr-primary);
}

.product-review-section .review-section-header p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--pr-muted);
}

.product-review-section .review-content-row {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 18px;
    align-items: stretch;
}

.product-review-section--empty .review-content-row {
    grid-template-columns: 1fr;
}

.product-review-section--empty .review-empty-stage {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: stretch;
    min-height: 238px;
    transition: grid-template-columns 0.25s ease;
}

.product-review-section--empty .review-empty-stage.is-form-open {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
}

.product-review-section--empty .review-empty-cta-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 238px;
    padding: 32px 24px;
    background: #fff;
    border: 1px solid var(--pr-border);
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    text-align: center;
    transition: min-height 0.25s ease, padding 0.25s ease;
}

.product-review-section--empty .review-empty-stage.is-form-open .review-empty-cta-panel {
    min-height: 238px;
    padding: 24px 18px;
}

.product-review-section--empty .review-empty-cta-text {
    margin: 0;
    max-width: 360px;
    color: var(--pr-muted);
    font-size: 14px;
    line-height: 1.7;
}

.product-review-section--empty .review-write-trigger--center {
    width: auto;
    min-width: 180px;
    padding: 0 24px;
}

.product-review-section--empty .review-form-card--empty-side {
    min-height: 238px;
}

.product-review-section--empty .review-form-card--empty-side[hidden] {
    display: none !important;
}

.product-review-section--empty .review-empty-stage.is-form-open .review-form-card--empty-side {
    display: block;
}

.product-review-section .review-rating-card {
    min-height: 238px;
    padding: 24px 18px;
    background: linear-gradient(180deg, #ffffff 0%, var(--pr-primary-soft-2) 100%);
    border: 1px solid var(--pr-border);
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-review-section .review-rating-score {
    margin-bottom: 10px;
    font-size: 52px;
    line-height: 1;
    font-weight: 800;
    color: var(--pr-primary);
}

.product-review-section .review-rating-stars {
    margin-bottom: 10px;
    color: var(--pr-star);
    font-size: 22px;
    letter-spacing: 2px;
    line-height: 1;
}

.product-review-section .review-rating-count {
    margin-bottom: 18px;
    font-size: 14px;
    color: var(--pr-muted);
}

.product-review-section .review-write-trigger,
.product-review-section .show-all-reviews-btn,
.product-review-section .back-to-reviews-btn,
.reviews-modal .back-to-reviews-btn {
    border: 0;
    border-radius: 14px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.product-review-section .review-write-trigger {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--pr-border-dark);
    background: var(--pr-primary-soft);
    color: var(--pr-primary-dark);
}

.product-review-section .review-write-trigger:hover,
.product-review-section .review-write-trigger.is-open {
    background: color-mix(in srgb, var(--pr-primary) 14%, #ffffff);
    transform: translateY(-1px);
}

.product-review-section .review-right-area {
    min-width: 0;
}

.product-review-section .review-card-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.product-review-section .single-review-card,
.product-review-section .review-form-card {
    min-height: 238px;
    background: #fff;
    border: 1px solid var(--pr-border);
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

.product-review-section .single-review-card {
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-review-section .single-review-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--pr-shadow-hover);
}

.product-review-section .single-review-card--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    grid-column: 1 / -1;
}

.product-review-section .single-review-card--empty p {
    margin: 0;
    color: var(--pr-muted);
    font-size: 14px;
    line-height: 1.6;
}

.product-review-section .review-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.product-review-section .review-avatar,
.reviews-modal .modal-review-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--pr-primary-soft);
    color: var(--pr-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
}

.product-review-section .review-user-info strong,
.reviews-modal .modal-review-user strong {
    display: block;
    font-size: 15px;
    line-height: 1.2;
    color: var(--pr-text);
}

.product-review-section .review-user-info span,
.reviews-modal .modal-review-user span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--pr-muted-2);
}

.product-review-section .review-stars,
.reviews-modal .modal-review-stars {
    margin-bottom: 12px;
    color: var(--pr-star);
    font-size: 16px;
    letter-spacing: 2px;
    line-height: 1;
}

.product-review-section .single-review-card p,
.reviews-modal .modal-review-card p {
    margin: 0;
    color: var(--pr-muted);
    font-size: 13.5px;
    line-height: 1.75;
}

.product-review-section .review-form-card {
    padding: 18px;
    background: linear-gradient(180deg, #ffffff 0%, var(--pr-primary-soft-2) 100%);
}

.product-review-section .review-form-card[hidden] {
    display: none !important;
}

.product-review-section .review-form-card h3,
.write-review-modal h3 {
    margin: 0 0 14px;
    font-size: 17px;
    line-height: 1.2;
    color: var(--pr-text);
}

.product-review-section .review-form-group,
.write-review-modal .review-form-group {
    margin-bottom: 11px;
}

.product-review-section .review-form-group label,
.write-review-modal .review-form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--pr-muted);
    font-size: 12px;
    font-weight: 600;
}

.product-review-section .review-form-card input,
.product-review-section .review-form-card textarea,
.write-review-modal input,
.write-review-modal textarea,
.product-review-form input[type="text"],
.product-review-form textarea {
    width: 100%;
    border: 1px solid #cfd6df;
    background: #fcfcfc;
    border-radius: 12px;
    padding: 11px 12px;
    color: var(--pr-text);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
}

.product-review-section .review-form-card input:focus,
.product-review-section .review-form-card textarea:focus,
.write-review-modal input:focus,
.write-review-modal textarea:focus,
.product-review-form input[type="text"]:focus,
.product-review-form textarea:focus {
    border-color: var(--pr-primary);
    background: #fff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pr-primary) 12%, transparent),
        inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.product-review-section .review-form-card input[type="text"],
.write-review-modal input[type="text"],
.product-review-form input[type="text"] {
    box-sizing: border-box;
    padding: 8px 12px;
    height: 45px;
    line-height: 1.35;
}

.product-review-section .review-form-card textarea,
.write-review-modal textarea {
    min-height: 70px;
    resize: vertical;
}

.product-review-section .review-form-stars,
.write-review-modal .review-form-stars {
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid #cfd6df;
    border-radius: 12px;
    background: #fcfcfc;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-review-section .product-review-star-btn,
.write-review-modal .product-review-star-btn {
    border: 0;
    background: transparent;
    color: #d5d0e0;
    font-size: 22px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
}

.product-review-section .product-review-star-btn.is-active,
.product-review-section .product-review-star-btn.is-hover,
.write-review-modal .product-review-star-btn.is-active,
.write-review-modal .product-review-star-btn.is-hover {
    color: var(--pr-star);
}

.product-review-section .product-review-star-btn.is-hover,
.write-review-modal .product-review-star-btn.is-hover {
    transform: scale(1.05);
}

.product-review-form-message {
    margin-bottom: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 600;
}

.product-review-form-message.is-success {
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.product-review-form-message.is-success::before {
    content: "✓ ";
    font-weight: 800;
}

.product-review-form-message.is-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.product-review-form-success-panel {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 14px;
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ecfdf3 0%, #f0fdf4 100%);
    border: 1px solid #bbf7d0;
    animation: productReviewSuccessIn 0.3s ease;
}

.product-review-form-success-panel[hidden] {
    display: none !important;
}

.product-review-form-success-panel__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--pr-primary, #3eae1e);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    flex-shrink: 0;
}

.product-review-form-success-panel strong {
    display: block;
    color: #166534;
    font-size: 15px;
    margin-bottom: 4px;
}

.product-review-form-success-panel__text {
    margin: 0;
    color: #15803d;
    font-size: 13px;
    line-height: 1.6;
}

@keyframes productReviewSuccessIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-review-form.is-submitted .review-form-group,
.product-review-form.is-submitted .review-submit-btn {
    display: none;
}

.product-review-form.is-submitted .product-review-form-message {
    display: none !important;
}

.product-review-section .review-submit-btn,
.write-review-modal .review-submit-btn {
    width: 100%;
    min-height: 43px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--pr-primary) 0%, var(--pr-primary-dark) 100%);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-review-section .review-submit-btn:hover,
.write-review-modal .review-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--pr-primary) 28%, transparent);
}

.product-review-section .review-actions {
    display: flex;
    justify-content: center;
    margin-top: 22px;
}

.product-review-section .show-all-reviews-btn {
    min-width: 240px;
    height: 46px;
    border: 1px solid var(--pr-border-dark);
    background: #fff;
    color: var(--pr-primary-dark);
}

.product-review-section .show-all-reviews-btn:hover {
    background: var(--pr-primary-soft);
    transform: translateY(-1px);
}

.reviews-modal,
.write-review-modal {
    --pr-primary: var(--pdt-btn-cart-hover-bg-color, var(--theme-default-color, #3eae1e));
    --pr-primary-dark: var(--pdt-btn-cart-hover-border-color, var(--theme-hover-color, #2d8a16));
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(18, 20, 27, 0.46);
    backdrop-filter: blur(8px);
}

.reviews-modal.is-open,
.write-review-modal.is-open {
    display: flex;
}

.reviews-modal[hidden],
.write-review-modal[hidden] {
    display: none !important;
}

.reviews-modal-box,
.write-review-modal-box {
    width: min(960px, 100%);
    max-height: 86vh;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--pr-border, #ece7fb);
    border-radius: 28px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
}

.write-review-modal-box {
    width: min(520px, 100%);
    max-height: 88vh;
}

.reviews-modal-head,
.write-review-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 26px;
    border-bottom: 1px solid var(--pr-border, #ece7fb);
    background: linear-gradient(180deg, #ffffff 0%, var(--pr-primary-soft-2, #fbf9ff) 100%);
    flex-shrink: 0;
}

.reviews-modal-head h3,
.write-review-modal-head h3 {
    margin: 0 0 5px;
    color: var(--pr-text, #2d2a4a);
    font-size: 24px;
    line-height: 1.2;
}

.reviews-modal-head p,
.write-review-modal-head p {
    margin: 0;
    color: var(--pr-muted, #7d7896);
    font-size: 14px;
    line-height: 1.6;
}

.reviews-modal-close,
.write-review-modal-close {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pr-primary) 0%, var(--pr-primary-dark) 100%);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.reviews-modal-close:hover,
.write-review-modal-close:hover {
    background: var(--pr-primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px color-mix(in srgb, var(--pr-primary) 28%, transparent);
}

.reviews-modal-content,
.write-review-modal-content {
    padding: 24px 26px 26px;
    overflow-y: auto;
}

.write-review-modal-content {
    padding: 24px;
}

.reviews-modal .modal-review-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.reviews-modal .modal-review-card {
    width: 100%;
    display: grid;
    grid-template-columns: 62px 1fr;
    gap: 16px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--pr-border, #ece7fb);
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

.reviews-modal .modal-review-content {
    min-width: 0;
}

.reviews-modal .modal-review-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.reviews-modal .modal-review-stars {
    white-space: nowrap;
    flex-shrink: 0;
}

.reviews-modal .modal-bottom-actions {
    display: flex;
    justify-content: center;
    margin-top: 22px;
}

.reviews-modal .back-to-reviews-btn {
    min-width: 240px;
    height: 48px;
    border: 0;
    background: linear-gradient(135deg, var(--pr-primary) 0%, var(--pr-primary-dark) 100%);
    color: #fff;
}

.reviews-modal .back-to-reviews-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--pr-primary) 28%, transparent);
}

@media (max-width: 991px) {
    .product-review-section {
        padding: 22px 16px;
        border-radius: 20px;
    }

    .product-review-section .review-content-row {
        grid-template-columns: 1fr;
    }

    .product-review-section--empty .review-empty-stage,
    .product-review-section--empty .review-empty-stage.is-form-open {
        grid-template-columns: 1fr;
    }

    .product-review-section--empty .review-form-card--empty-side {
        display: none !important;
    }

    .product-review-section .review-rating-card {
        min-height: auto;
    }

    .product-review-section .review-card-list {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 14px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 6px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .product-review-section .single-review-card,
    .product-review-section .review-form-card,
    .product-review-section .single-review-card--empty {
        min-width: 290px;
        max-width: 290px;
        width: 290px;
        flex: 0 0 290px;
        scroll-snap-align: start;
    }

    .product-review-section .single-review-card--empty {
        grid-column: auto;
    }

    .product-review-section .review-form-card {
        display: none !important;
    }

    .product-review-section .review-section-header h2 {
        font-size: 24px;
    }
}

@media (max-width: 575px) {
    .product-review-section {
        padding: 20px 14px;
    }

    .product-review-section .review-rating-score {
        font-size: 42px;
    }

    .product-review-section .single-review-card,
    .product-review-section .single-review-card--empty {
        min-width: 260px;
        max-width: 260px;
        width: 260px;
        flex: 0 0 260px;
        border-radius: 18px;
    }

    .reviews-modal,
    .write-review-modal {
        padding: 12px;
    }

    .reviews-modal-box,
    .write-review-modal-box {
        border-radius: 22px;
        max-height: 88vh;
    }

    .reviews-modal .modal-review-card {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
        border-radius: 18px;
    }

    .reviews-modal .modal-review-top {
        flex-direction: column;
        gap: 6px;
    }

    .product-review-section .show-all-reviews-btn,
    .reviews-modal .back-to-reviews-btn {
        width: 100%;
        min-width: 0;
    }
}
