/* WooCommerce Reviews Styles */
#reviews.woocommerce-Reviews {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-top: 40px;
}

/* Reviews Title */
.woocommerce-Reviews-title {
    font-size: 28px;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

/* No Reviews Message */
.woocommerce-noreviews {
    font-size: 16px;
    color: #666;
    padding: 30px;
    text-align: center;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 30px;
}

/* Review Form Wrapper */
#review_form_wrapper {
    margin-top: 30px;
}

#review_form {
    background: #f9fafb;
    padding: 30px;
    border-radius: 12px;
}

/* Comment Respond */
#respond {
    position: relative;
}

/* Reply Title */
.comment-reply-title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin-bottom: 25px;
    display: block;
}

.comment-reply-title small {
    font-size: 14px;
    font-weight: 400;
    margin-left: 10px;
}

.comment-reply-title small a {
    color: #ea580c;
    text-decoration: none;
    transition: color 0.3s;
}

.comment-reply-title small a:hover {
    color: #c2410c;
    text-decoration: underline;
}

/* Comment Form */
.comment-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Improved Star Rating Styles */
.comment-form-rating {
    margin-bottom: 20px;
}

.comment-form-rating label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.comment-form-rating .required {
    color: #ef4444;
}

/* Stars Container */
.comment-form-rating .stars {
    margin: 0;
    padding: 0;
}

.comment-form-rating .stars span[role="group"] {
    display: inline-flex;
    gap: 8px;
    padding: 10px 0;
}

/* Individual Star Links */
.comment-form-rating .stars a {
    font-size: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
}

/* Star Icon */
.comment-form-rating .stars a::before {
    content: '★';
    font-size: 36px;
    color: #d1d5db;
    transition: all 0.2s ease;
}

/* Selected/Active State */
.comment-form-rating .stars a[aria-checked="true"]::before {
    color: #f59e0b;
}

.comment-form-rating .stars a.filled::before {
    color: #f59e0b;
}


.comment-form-rating .stars a.active::before {
    animation: starPulse 0.25s ease;
}

/* Hover effect for all previous stars */
.comment-form-rating .stars:hover a::before {
    transform: scale(1.1);
}


/* Mobile styles */
@media (max-width: 576px) {
    .comment-form-rating .stars a {
        width: 36px;
        height: 36px;
    }

    .comment-form-rating .stars a::before {
        font-size: 32px;
    }

    .comment-form-rating .stars span[role="group"] {
        gap: 5px;
    }
}

/* Animation on selection */
@keyframes starPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.comment-form-rating .stars a.selected::before {
    animation: starPulse 0.3s ease;
}

/* Comment Textarea */
.comment-form-comment {
    margin-bottom: 10px;
}

.comment-form-comment label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.comment-form-comment .required {
    color: #ef4444;
}

.comment-form-comment textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s;
    background: white;
}

.comment-form-comment textarea:focus {
    outline: none;
    border-color: #1e40af;
}

/* Author Fields (якщо є) */
.comment-form-author,
.comment-form-email {
    margin-bottom: 10px;
}

.comment-form-author label,
.comment-form-email label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.comment-form-author input,
.comment-form-email input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.3s;
    background: white;
}

.comment-form-author input:focus,
.comment-form-email input:focus {
    outline: none;
    border-color: #1e40af;
}

/* Submit Button */
.form-submit {
    margin: 10px 0 0 0;
}

.form-submit input[type="submit"],
.form-submit .submit {
    padding: 15px 40px;
    background: #ea580c;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
}

.form-submit input[type="submit"]:hover,
.form-submit .submit:hover {
    background: #c2410c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
}

.form-submit input[type="submit"]:active,
.form-submit .submit:active {
    transform: translateY(0);
}

/* Comments List (якщо є відгуки) */
#comments .commentlist {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

#comments .comment {
    background: #f9fafb;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
}

#comments .comment-text {
    position: relative;
}

#comments .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

#comments .woocommerce-review__author {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

#comments .woocommerce-review__published-date {
    font-size: 13px;
    color: #999;
}

#comments .star-rating {
    display: inline-flex;
    gap: 3px;
    font-size: 16px;
    color: #f59e0b;
}

#comments .star-rating::before {
    content: '★★★★★';
    letter-spacing: 3px;
    color: #d1d5db;
}

#comments .description p {
    font-size: 15px;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

/* Clear */
.clear {
    clear: both;
}

/* Hidden Elements */
#rating {
    display: none;
}

/* Responsive */

@media (max-width: 768px) {
    #reviews.woocommerce-Reviews {
        padding: 0;
    }
}

/*
@media (max-width: 768px) {
    #reviews.woocommerce-Reviews {
        padding: 25px 20px;
    }

    .woocommerce-Reviews-title {
        font-size: 24px;
    }

    #review_form {
        padding: 20px;
    }

    .comment-reply-title {
        font-size: 18px;
    }

    .comment-form-rating .stars a {
        font-size: 28px;
    }

    .form-submit input[type="submit"],
    .form-submit .submit {
        width: 100%;
        padding: 14px;
    }

    #comments .comment {
        padding: 20px;
    }

    #comments .meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 576px) {
    #reviews.woocommerce-Reviews {
        padding: 20px 15px;
        border-radius: 8px;
    }

    .woocommerce-Reviews-title {
        font-size: 20px;
        padding-bottom: 15px;
    }

    #review_form {
        padding: 15px;
    }

    .comment-reply-title {
        font-size: 16px;
        line-height: 1.4;
    }

    .comment-form-rating .stars a {
        font-size: 24px;
        gap: 3px;
    }

    .comment-form-comment label,
    .comment-form-author label,
    .comment-form-email label {
        font-size: 14px;
    }

    .comment-form-comment textarea {
        padding: 12px;
        font-size: 14px;
    }
}
*/

/* Loading State */
.comment-form.processing {
    opacity: 0.6;
    pointer-events: none;
}

/* Success Message */
.woocommerce-message {
    background: #10b981;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 15px;
}

/* Error Message */
.woocommerce-error {
    background: #ef4444;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 15px;
}


.woocommerce-product-rating {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    font-size: 14px;
    color: #4a4a4a;
    line-height: 1;
    flex-wrap: wrap;
}

.star-rating {
    position: relative;
    display: inline-block;
    font-size: 1.05rem;
    height: 1em;
    line-height: 1;
    letter-spacing: .12em;
    color: #d7d7d7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.star-rating::before {
    content: "★★★★★";
    display: block;
    pointer-events: none;
}

.star-rating>span {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    display: block;
    height: 100%;
    white-space: nowrap;
    transition: width 300ms ease;
    color: #f6c342;
    /* цвет залитых звёзд */
}

.star-rating>span::before {
    content: "★★★★★";
    display: block;
    pointer-events: none;
}

.woocommerce-product-rating .rating {
    font-weight: 600;
    color: #222;
    margin-left: 0.25rem;
    display: inline-block;
}

.woocommerce-product-rating .star-rating+.rating,
.woocommerce-product-rating .star-rating span strong.rating {
    color: #222;
}

.woocommerce-review-link {
    color: #0b76ef;
    text-decoration: none;
    font-size: 0.95rem;
    margin-left: 0.25rem;
    transition: color 180ms ease, transform 120ms ease;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.woocommerce-review-link:hover,
.woocommerce-review-link:focus {
    color: #084db5;
    transform: translateY(-1px);
    text-decoration: underline;
}

.woocommerce-review-link .count {
    background: rgba(11, 118, 239, 0.08);
    color: #0b76ef;
    padding: 0.08rem 0.38rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1;
}

/* ----- Hover tooltip on stars (shows percentage) ----- */
.star-rating[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: -2.4rem;
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    color: #fff;
    font-size: 0.75rem;
    padding: 0.28rem 0.5rem;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(20, 30, 40, 0.18);
    opacity: 0.98;
    pointer-events: none;
}

/* ----- reduce the size on small screens ----- */
@media (max-width: 520px) {
    .woocommerce-product-rating {
        font-size: 13px;
        gap: 0.4rem;
    }

    .star-rating {
        font-size: 0.95rem;
    }

    .woocommerce-review-link {
        font-size: 0.9rem;
    }
}