/* Store & Product Reviews for WooCommerce - frontend styles */

.wspr-block {
    margin: 24px 0;
    max-width: 100%;
}

.wspr-stars {
    display: inline-flex;
    gap: 2px;
    line-height: 1;
    vertical-align: middle;
}

.wspr-star {
    font-size: var(--wspr-star-size, 18px);
    color: #d9d9d9;
}

.wspr-star-filled {
    color: var(--wspr-star-color, #f5a623);
}

.wspr-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8f8f8;
    border-radius: 6px;
    margin-bottom: 16px;
}

.wspr-summary-score {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wspr-average {
    font-size: 24px;
    font-weight: 700;
}

.wspr-scale {
    color: #777;
}

.wspr-count {
    color: #555;
    font-size: 13px;
}

.wspr-breakdown {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.wspr-breakdown a {
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #ddd;
    font-size: 13px;
}

.wspr-breakdown a.active {
    background: var(--wspr-star-color, #f5a623);
    border-color: var(--wspr-star-color, #f5a623);
    color: #fff;
}

.wspr-review-list {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.wspr-review-item {
    padding: 16px 0;
    border-bottom: 1px solid #eee;
}

.wspr-review-list.wspr-layout-grid {
    display: grid;
    grid-template-columns: repeat(var(--wspr-columns, 3), 1fr);
    gap: 20px;
}

.wspr-review-list.wspr-layout-grid .wspr-review-item {
    padding: 16px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #fff;
}

@media (max-width: 780px) {
    .wspr-review-list.wspr-layout-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .wspr-review-list.wspr-layout-grid {
        grid-template-columns: 1fr;
    }
}

.wspr-review-carousel .wspr-slider-item {
    flex-basis: calc((100% - 16px * (var(--wspr-columns, 3) - 1)) / var(--wspr-columns, 3));
}

@media (max-width: 780px) {
    .wspr-review-carousel .wspr-slider-item {
        flex-basis: calc((100% - 16px) / 2);
    }
}

@media (max-width: 480px) {
    .wspr-review-carousel .wspr-slider-item {
        flex-basis: 100%;
    }
}

.wspr-review-product a {
    font-weight: 600;
}

.wspr-review-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.wspr-review-title {
    font-size: 15px;
}

.wspr-review-meta {
    font-size: 12px;
    color: #888;
    display: flex;
    gap: 10px;
    margin-bottom: 6px;
}

.wspr-review-content {
    margin: 0;
}

.wspr-review-reply {
    margin-top: 10px;
    padding: 10px 14px;
    background: #f4f6f8;
    border-left: 3px solid #999;
    border-radius: 3px;
}

.wspr-review-reply p {
    margin: 4px 0 0;
}

.wspr-empty {
    color: #777;
    font-style: italic;
}

.wspr-pagination {
    display: flex;
    gap: 6px;
    margin: 16px 0;
}

.wspr-pagination a {
    padding: 4px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
}

.wspr-pagination a.active {
    background: var(--wspr-star-color, #f5a623);
    border-color: var(--wspr-star-color, #f5a623);
    color: #fff;
}

/* Review form */

.wspr-review-form {
    max-width: 520px;
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #eee;
    border-radius: 6px;
}

.wspr-field {
    margin-bottom: 14px;
}

.wspr-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.wspr-field input[type="text"],
.wspr-field input[type="email"],
.wspr-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.wspr-button {
    display: inline-block;
    padding: 10px 20px;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

.wspr-button:hover {
    opacity: 0.9;
    color: #fff;
}

.wspr-notice {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 14px;
}

.wspr-notice-success {
    background: #e7f7ec;
    color: #1e7e34;
    border: 1px solid #b6e6c4;
}

.wspr-notice-error {
    background: #fdecea;
    color: #a30000;
    border: 1px solid #f5c6c6;
}

.wspr-notice-error ul {
    margin: 0;
    padding-left: 18px;
}

.wspr-login-notice,
.wspr-verified-only-notice,
.wspr-already-reviewed {
    color: #555;
    font-style: italic;
}

/* Pure-CSS 1-5 star picker */

.wspr-star-input {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.wspr-star-input input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.wspr-star-input label {
    font-size: 26px;
    color: #d9d9d9;
    cursor: pointer;
    padding: 0 2px;
}

.wspr-star-input input:checked ~ label,
.wspr-star-input label:hover,
.wspr-star-input label:hover ~ label {
    color: var(--wspr-star-color, #f5a623);
}

/* Product loop mini rating */

.wspr-mini-rating {
    margin: 4px 0;
}

.wspr-mini-rating a {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wspr-mini-count {
    font-size: 12px;
    color: #888;
}

/* Floating widget */

.wspr-floating-widget {
    /* bottom/left/right come from an inline style built from the merchant's
       side + distance settings - see WSPR_Frontend::maybe_render_floating_widget(). */
    position: fixed;
    z-index: 9999;
}

.wspr-widget-badge {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--wspr-widget-bg, #222);
    color: var(--wspr-widget-text, #fff);
    padding: 10px 16px;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.wspr-widget-badge:hover {
    color: var(--wspr-widget-text, #fff);
    opacity: 0.9;
}

.wspr-widget-score {
    font-weight: 700;
}

.wspr-widget-count {
    font-size: 12px;
    opacity: 0.85;
}

/* Slider */

.wspr-slider {
    position: relative;
    overflow: hidden;
    padding: 0 40px;
}

.wspr-slider-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.wspr-slider-track::-webkit-scrollbar {
    display: none;
}

.wspr-slider-item {
    flex: 0 0 260px;
    padding: 16px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #fff;
}

.wspr-slider-prev,
.wspr-slider-next {
    /* Explicit resets (!important) because a theme's global button styles
       (padding, width, text-align, line-height) commonly have enough
       cascade weight to override a plain class selector here, which turns
       this into a tall, left-aligned pill instead of a small round button.
       Width/height are computed from these two custom properties (rather
       than left to aspect-ratio, which - combined with an absolutely
       positioned, shrink-to-fit inline-flex element and a glyph that isn't
       itself square - wasn't reliably producing a circle in practice), so
       the box is always exactly square regardless of the icon's own shape.
       The Carousel Arrows Style controls set these two variables directly:
       "Padding" is the space around the glyph, "Icon size" is the glyph. */
    --wspr-arrow-padding: 7px;
    --wspr-arrow-icon-size: 18px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: var(--wspr-arrow-padding) !important;
    width: calc(var(--wspr-arrow-icon-size) + (var(--wspr-arrow-padding) * 2)) !important;
    height: calc(var(--wspr-arrow-icon-size) + (var(--wspr-arrow-padding) * 2)) !important;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    font-size: var(--wspr-arrow-icon-size) !important;
    line-height: 1 !important;
    color: #333;
}

/* A Font Awesome icon sizes itself off font-size above like any other glyph,
   but a custom-uploaded SVG (Elementor's Icons_Manager renders those as an
   <img>) doesn't - sized here the same way instead, off the same variable. */
.wspr-slider-prev img,
.wspr-slider-next img {
    width: var(--wspr-arrow-icon-size, 18px);
    height: var(--wspr-arrow-icon-size, 18px);
    display: block;
}

/* Explicitly inherit the button's color rather than trust that by default -
   an <i> font icon and an inline <svg> icon both otherwise risk keeping
   whatever color the icon library's own CSS happens to set. */
.wspr-slider-prev i,
.wspr-slider-next i {
    color: inherit;
}

.wspr-slider-prev svg,
.wspr-slider-next svg {
    fill: currentColor;
}

.wspr-slider-prev { left: 0; }
.wspr-slider-next { right: 0; }

/* Order review page & My Account */

.wspr-page-wrap {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.wspr-order-product-item {
    padding: 14px 0;
    border-top: 1px solid #eee;
}

.wspr-order-product-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.wspr-order-product-header img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.wspr-order-product-name {
    font-weight: 600;
    margin: 0;
}

.wspr-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 20px;
}

.wspr-table th,
.wspr-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
}
