/* ==========================================================================
   Bazaarvoice Container-Level CSS Overrides
   Only targets OUR wrapper elements — safe per BV Risk Matrix
   ========================================================================== */

/* --- PDP: Rating Summary --- */
.bv-rating-summary-wrapper {
    margin: 10px 0;
    min-height: 25px;
}

/* Star spacing — BV-recommended CSS for adjustable gap between stars */
[data-bv-show="rating_summary"] .bv_main_container .bv_stars_component_container svg:not(:last-child) {
    margin-right: 1px !important;
}

/* Star spacing — Reviews section (per-review card stars + overall rating) */
[data-bv-show="reviews"] [role="img"] svg:not(:last-child),
[data-bv-show="reviews"] .bv-reviews-product-rating-star svg:not(:last-child),
[data-bv-show="reviews"] .bv-rnr__reme6t-0 svg:not(:last-child) {
    margin-right: 1px !important;
}

/* Star spacing — Inline ratings (PLP / search / favorites) */
[data-bv-show="inline_rating"] .bv_stars_svg_no_wrap svg:not(:last-child) {
    margin-right: 1px !important;
}

/* Baseline alignment — all inline ratings (PLP / search / favorites) */
[data-bv-show="inline_rating"] .bv_main_container .bv_text {
    position: relative !important;
    top: 2px !important;
}

/* Star size & text — Search overlay: match reviews section */
.search-overlay__products [data-bv-show="inline_rating"] .bv_stars_svg_no_wrap svg {
    width: 10.5px !important;
    height: 10.5px !important;
    margin-right: 0 !important;
    padding: 0 !important;
}

.search-overlay__products [data-bv-show="inline_rating"] .bv_stars_component_container {
    height: auto !important;
    display: flex !important;
    align-items: center !important;
}

.search-overlay__products [data-bv-show="inline_rating"] .bv_inline_rating_div_stars_ratings_and_chevron,
.search-overlay__products [data-bv-show="inline_rating"] .bv_main_container {
    align-items: center !important;
    flex-wrap: nowrap !important;
}

.search-overlay__products [data-bv-show="inline_rating"] .bv_main_container .bv_text {
    font-size: 10px !important;
    line-height: 10.5px !important;
}

/* Reviews search icon — vertically center magnifying glass relative to input */
[data-bv-show="reviews"] .bv-rnr__sc-5jc2zu-4 {
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
}

/* Reviews: show reviewer name column at all breakpoints —
   BV sets display:none on .bv-rnr__sc-16dr7i1-2 at narrow viewports */
[data-bv-show="reviews"] .bv-rnr__sc-16dr7i1-2 {
    display: block !important;
}

/* Reviews: hide the mobile-only duplicate reviewer name + chevron ("Name >") BV
   renders on iOS/Safari inside the right content column (.bv-rnr__sc-16dr7i1-26).
   Structure: .bv-rnr__sc-16dr7i1-33 wraps two BUTTONs — the reviewer name action-bar
   (.bv-rnr__sc-16dr7i1-6 .bv-rnr-action-bar) AND a separate chevron button
   (.bv-rnr__sc-16dr7i1-34). Hiding the wrapper removes both at once and keeps the
   date ("a year ago") visible. Scoped strictly to the right column so the left
   nameCol action-bar button remains visible. */
[data-bv-show="reviews"] .bv-rnr__sc-16dr7i1-26 .bv-rnr__sc-16dr7i1-33 {
    display: none !important;
}

/* Reviews: lighten reviewer name (700 → 400) */
[data-bv-show="reviews"] .bv-rnr__sc-1r4hv38-0 {
    font-weight: 400 !important;
}

.overlay .bv-rating-summary-wrapper,
.wrap-content-popup .bv-rating-summary-wrapper {
    display: none !important;
}

.bv-rating-summary-wrapper + .woocommerce-product-rating {
    display: none;
}

.product__desc .bv-rating-summary-wrapper {
    margin: 6px 0 -7px;
}

/* --- PDP: Hide WC/Theme native reviews when BV is active --- */
.woocommerce-Reviews,
.royce-single-product-reviews,
.royce-cr-single-product-reviews,
#reviews.review-product-block {
    display: none !important;
}

/* --- PDP: Reviews Section Layout --- */
/* Horizontal margins are handled by the .container.container-correction classes already on
   the wrapper element — no overrides needed. Only vertical spacing and clear are set here. */
.bv-reviews-section-wrapper {
    margin-top: 30px !important;
    margin-bottom: 30px !important;
    clear: both;
}

.bv-favorites-divider {
    display: none;
}

/* --- PLP: Inline Rating --- */
.bv-inline-rating-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    margin: 5px 0;
}

.bv-inline-rating-wrapper [data-bv-show="inline_rating"] {
    display: inline-flex;
    align-items: center;
}

.bv-inline-rating-wrapper:empty {
    display: none;
}

.products__list__product .bv-inline-rating-wrapper {
    justify-content: flex-start;
    margin: 0;
}

/* Search overlay: tighter whitespace above stars per design review,
   5px visible below stars. The min-height + margin values compensate three
   surrounding factors to control the visible whitespace:
   - min-height collapses from 20px to the star height (10.5px) so flex-center
     no longer leaves ~4.75px of dead space above/below the stars
   - margin-top 8px produces roughly 8px visible gap between title text and
     stars (adjacent-margin collapse with title's margin-bottom: -1px)
   - margin-bottom 2px plus the theme price's padding-top: 3px sums to 5 */
.search-overlay__products .bv-inline-rating-wrapper {
    min-height: 10.5px !important;
    margin: 4px 0 2px !important;
}

.wrap-favorites .products__list__product .bv-inline-rating-wrapper {
    margin-block: 3px;
}

/* --- PDP: Submission Form --- */
.bv-submission-wrapper {
    display: none;
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.bv-submission-wrapper.bv-submission-visible {
    display: block;
}

.bv-write-review-btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #000;
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin: 20px 0;
}

.bv-write-review-btn:hover {
    background-color: #333;
    color: #fff;
}

.bv-write-review-btn.bv-btn-active {
    background-color: #666;
}

.bv-submission-close {
    display: block;
    text-align: right;
    margin-bottom: 10px;
}

.bv-submission-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 5px 10px;
}

.bv-submission-close-btn:hover {
    color: #000;
}

/* --- BV Submission Form: Fix thick/heavy text --- */

/* Base: use lighter font for the entire modal */
.bv-ips-modal-window {
    font-family: GillSans-Light, "Gill Sans", GillSans, Arial, sans-serif !important;
    font-weight: 300 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Prevent browser from faking bold when no bold variant exists */
.bv-ips-modal-window * {
    font-synthesis: none !important;
}

/* Labels — normal weight, not light */
.bv-ips-modal-window label {
    font-weight: 400 !important;
}

/* Headings — keep them readable but not heavy */
.bv-ips-modal-window h2,
.bv-ips-modal-window h3 {
    font-weight: 400 !important;
}

/* Submit button — normal weight, not light */
.bv-ips-modal-window button {
    font-weight: 400 !important;
}

/* --- BV IPS Submission Form: Step status badge ("In progress", "Complete") --- */
/* Keep BV's default pill background; override text to white for legibility. */
.bv-ips-modal-window [class*="ips__sc-emgfje-"] {
    color: #fff !important;
}

/* --- BV IPS Submission Form: Validation error messages — red color --- */
/* Error containers have type="error" attribute — use it to scope to errors only.
   Without this, [class*="ips__sc-1nj9nk7-"] span also matches section titles. */
.bv-ips-modal-window [class*="ips__sc-1geln5a-"],
.bv-ips-modal-window [class*="ips__sc-1nj9nk7-"][type="error"] span {
    color: #c0392b !important;
}

/* Warning icon SVG — scoped to error containers only */
.bv-ips-modal-window [class*="ips__sc-1nj9nk7-"][type="error"] svg path {
    fill: #c0392b !important;
}


/* --- PDP: Rating header — single-column stacked layout --- */

/* Stack overall rating and write-review vertically (left-aligned) */
[data-bv-show="reviews"] .bv-rnr__sc-10ra6n1-0 {
    display: block !important;
}

[data-bv-show="reviews"] .bv_rating_content2,
[data-bv-show="reviews"] .bv_rating_content3 {
    width: 100% !important;
}

/* Overall Rating block: BV puts padding-left: 5px on the inner .bv-rnr__rpifwc-1
   wrapper, pushing BOTH the stars+rating number AND the "X out of Y reviewers
   recommend this product" line 5px right of the "Overall Rating" heading above.
   Zero the padding here so everything aligns at the section's left edge.

   Scoped to #bv-reviews-overall-ratings-container because a SECOND .bv-rnr__rpifwc-1
   instance exists under "Review this Product" where BV intentionally relies on the
   5px padding and compensates it with margin-left: -4.5px on an inner child. Zeroing
   padding there would misalign the write-review star buttons. */
#bv-reviews-overall-ratings-container .bv-rnr__rpifwc-1 {
    padding-left: 0 !important;
}

/* --- PDP: Write-review star buttons — alignment + hover effect --- */
/* BV adds margin-left: 5px on the stars section wrapper and padding-left: 4.5px on the button
   container, offsetting stars ~10px right of the "Review this Product" label above them.
   Same 5px ML + 5px PL on .bv-rnr__sc-2kyvjj-5 misaligns the email disclaimer below. */
[data-bv-show="reviews"] .bv-rnr__rpifwc-1 {
    margin-left: 0 !important;
}

[data-bv-show="reviews"] .bv-rnr__sc-2kyvjj-2 {
    padding-left: 0 !important;
}

[data-bv-show="reviews"] .bv-rnr__sc-2kyvjj-5 {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* SVG star has fill="#FFFFFF" stroke="#000"; flipping box to black makes a filled-star look on hover */
[data-bv-show="reviews"] .bv-rnr__sc-2kyvjj-4 {
    transition: background-color 0.15s ease, border-color 0.15s ease !important;
    cursor: pointer !important;
}

[data-bv-show="reviews"] .bv-rnr__sc-2kyvjj-4:hover {
    background-color: #000 !important;
    border-color: #000 !important;
}

/* --- PDP: Filter panel — hidden per site owner requirement.
   IMPORTANT: .bv-rnr__sc-16dr7i1-23 is also used on every review card root.
   Adjacent sibling selector scopes this to ONLY the filter panel, which is the
   direct next sibling of .bv-rnr__sc-10ra6n1-1 (Overall Rating section). */
[data-bv-show="reviews"] .bv-rnr__sc-10ra6n1-1 + .bv-rnr__sc-16dr7i1-23 {
    display: none !important;
}

/* --- PDP: Sort dropdown (desktop/Chrome) — hidden per site owner requirement.
   On Chrome: .bv-rnr__wnep33-0 contains Sort + Relevancy Info. */
[data-bv-show="reviews"] .bv-rnr__wnep33-0 {
    display: none !important;
}

/* --- PDP: Filters trigger + Relevancy Info (iOS/Safari) — hidden per site owner
   requirement. On iOS BV renders these as a completely separate component family
   (.bv-rnr__sc-107gs2s-*) outside .bv-rnr__wnep33-0. This rule catches both the
   Filters button and the Relevancy Info link on iOS. */
[data-bv-show="reviews"] [class*="bv-rnr__sc-107gs2s"] {
    display: none !important;
}

/* --- Small tablet (768px–1024px) --- */
/* Mirror the theme's review-product-block / favorite-products rule for this range */
@media (min-width: 768px) and (max-width: 1024px) {
    .page-pdp .bv-reviews-section-wrapper {
        max-width: none !important;
        padding-right: 30px !important;
        padding-left: 30px !important;
    }
}

/* --- Mobile --- */
@media (max-width: 767px) {
    .bv-inline-rating-wrapper {
        min-height: 12px;
    }

    .product__desc .bv-rating-summary-wrapper {
        margin: 19px 0 -7px;
    }

    /* Rating summary: BV's [data-bv-show="rating_summary"] resets text-align to start;
       override to center the inline-flex .bv_main_container on mobile */
    .bv-rating-summary-wrapper [data-bv-show="rating_summary"] {
        text-align: center !important;
    }

    /* Home (anniversary) product sliders — Popular Products + Classics Collection.
       Goal: card text reads at the same scale as PLP cards at ≤767px instead
       of the theme's aggressive slider-compression (title 9px, price 10px
       per royce-wp/css/home.css ~L1468-L1474).

       Per design direction this fix lives entirely in the BV plugin — the
       theme submodule is intentionally not touched — so we override the theme
       selectors here with matching specificity + !important. BV CSS loads
       after theme CSS in the cascade, so same-specificity !important wins.

       Scoped strictly to `.amw-home-anniversary__products` @media ≤767px so
       PLP, search overlay, favorites, PDP, and every other surface (BV and
       theme alike) are untouched. */
    .amw-home-anniversary__products .products__list__product__details .title,
    .amw-home-anniversary__products .products__list__product__details a {
        font-size: 12px !important;
        line-height: 16px !important;
    }

    .amw-home-anniversary__products .products__list__product__details .royce-price {
        font-size: 12px !important;
    }

    /* BV inline rating — match PLP geometry (the site owner's reference).

       Measured on PLP at ≤767px: 4.75px visual gap between the product
       title's last line bottom and the stars' visible top (= 2.75px space
       above the stars inside a 19.5px-tall .bv-inline-rating-wrapper plus
       the 2px gap between title bottom and wrapper top).

       Inside the anniversary slider cards, .bv_sub_container otherwise
       inherits line-height ~16px from the theme, shrinking the rating line
       and pulling the stars flush to the wrapper top (measured gap: 2.00px,
       ~2.75px too tight).

       Fix: explicitly set line-height: 19.5px on the sub_container tree so
       the BV rating line renders at the same height it does on PLP. The
       global `.bv_text { top: 2px }` baseline correction at the top of this
       file handles count/stars alignment, matching PLP exactly. No other
       BV overrides needed — remove the align-items:baseline / nowrap /
       top:-3px hacks from earlier versions. */
    .amw-home-anniversary__products [data-bv-show="inline_rating"] .bv_main_container {
        align-items: center !important;
        flex-wrap: wrap !important;
    }

    .amw-home-anniversary__products [data-bv-show="inline_rating"] .bv_sub_container,
    .amw-home-anniversary__products [data-bv-show="inline_rating"] .bv_averageRating_component_container,
    .amw-home-anniversary__products [data-bv-show="inline_rating"] .bv_numReviews_component_container,
    .amw-home-anniversary__products [data-bv-show="inline_rating"] .bv_main_container .bv_text {
        line-height: 19.5px !important;
    }

    /* .bv-reviews-section-wrapper horizontal spacing is handled by .container.container-correction */
}

/* v2.3.1 — hide the per-review "Helpful? / thumbs up / thumbs down / Report" row.
   Scoped to [data-bv-show="reviews"] so the submission flow and other BV widgets
   keep their own interactive controls. */
[data-bv-show="reviews"] .bv-feedback-container {
    display: none !important;
}
