/**
 * Shared Rating Distribution Bars
 *
 * One visual design for the rating-distribution bars used across surfaces
 * (product rating summary, store summary, happy-customers widget). Each surface
 * keeps its own container-level layout + JS hook class + data attributes; this
 * file owns the shared bar look. Rendered via templates/partials/rating-distribution-bar.php.
 *
 * @package YayReviews
 */

/* Bars container */
.yayrev-rating-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Single bar (button when clickable, div when not) */
.yayrev-rating-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem 0.5rem;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
    width: 100%;
    text-align: left;
}

.yayrev-rating-bar:hover:not(.yayrev-rating-bar--empty),
.yayrev-rating-bar:focus-visible:not(.yayrev-rating-bar--empty) {
    background-color: #f0f1f2c1;
}

.yayrev-rating-bar:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.yayrev-rating-bar--active {
    background-color: #dbeafe;
}

.yayrev-rating-bar--active:hover {
    background-color: #bfdbfe;
}

.yayrev-rating-bar--empty {
    cursor: default;
    opacity: 0.6;
    pointer-events: none;
}

/* Non-clickable version (when filter disabled) */
div.yayrev-rating-bar {
    cursor: default;
}

div.yayrev-rating-bar:hover {
    background-color: transparent;
}

.yayrev-rating-bar__label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 2.5rem;
    flex-shrink: 0;
}

.yayrev-rating-bar__number {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    min-width: 0.75rem;
}

.yayrev-rating-bar__icon {
    font-size: 1rem;
    line-height: 1;
    width: 1rem;
    height: 1rem;
}

.yayrev-rating-bar__track {
    display: flex;
    flex: 1;
    height: 0.5rem;
    background-color: #e5e7eb;
    border-radius: 0.25rem;
    overflow: hidden;
}

.yayrev-rating-bar__fill {
    height: 100%;
    background-color: #fbbf24;
    border-radius: 0.25rem;
    transition: width 0.3s ease;
}

.yayrev-rating-bar__count {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    min-width: 2rem;
    text-align: right;
}

/* Responsive */
@media (max-width: 480px) {
    .yayrev-rating-bar {
        gap: 0.5rem;
        padding: 0.25rem;
    }

    .yayrev-rating-bar__label {
        min-width: 2rem;
    }

    .yayrev-rating-bar__number {
        font-size: 0.75rem;
    }

    .yayrev-rating-bar__icon {
        font-size: 0.875rem;
        width: 0.875rem;
        height: 0.875rem;
    }

    .yayrev-rating-bar__count {
        font-size: 0.75rem;
        min-width: 1.5rem;
    }
}
