/* AfghanZone Verified Buyer Reviews - Public Card Rating Polish v1.0.1
   Narrow UI-only layer loaded after the existing public mobile/card styles. */

:root {
    --az-card-rating-gold: #f59e0b;
    --az-card-rating-gold-soft: #fff8e8;
    --az-card-rating-gold-line: #f6d9a4;
    --az-card-rating-muted-star: #d5dce6;
    --az-card-rating-muted-bg: #f8fafc;
    --az-card-rating-muted-line: #e8edf3;
    --az-card-rating-ink: #475467;
}

/* Always-visible rating row on every public product card. */
body.az-product-first-market .product-card .product-rating.az-card-rating {
    position: static;
    z-index: auto;
    display: inline-flex !important;
    width: max-content;
    max-width: 100%;
    min-height: 25px !important;
    align-items: center;
    justify-content: flex-start;
    gap: 6px !important;
    margin: 3px 0 6px !important;
    padding: 4px 8px;
    overflow: hidden;
    border: 1px solid var(--az-card-rating-gold-line);
    border-radius: 999px;
    background: linear-gradient(180deg, #fffdf8 0%, var(--az-card-rating-gold-soft) 100%);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .025);
    line-height: 1 !important;
    direction: ltr;
    unicode-bidi: isolate;
}

body.az-product-first-market .product-card .product-rating.az-card-rating.is-empty {
    border-color: var(--az-card-rating-muted-line);
    background: var(--az-card-rating-muted-bg);
    box-shadow: none;
}

body.az-product-first-market .product-card .az-card-rating .az-public-rating-stars {
    flex: 0 0 auto;
    margin: 0;
    font-size: 12px !important;
    line-height: 1 !important;
    letter-spacing: .35px !important;
}

body.az-product-first-market .product-card .az-card-rating .az-public-rating-stars__base {
    color: var(--az-card-rating-muted-star) !important;
}

body.az-product-first-market .product-card .az-card-rating .az-public-rating-stars__fill {
    color: var(--az-card-rating-gold) !important;
}

body.az-product-first-market .product-card .az-card-rating > small {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    min-width: 0;
    margin: 0;
    color: var(--az-card-rating-ink) !important;
    font: 800 9px/1 Arial, sans-serif !important;
    white-space: nowrap;
    direction: ltr;
    unicode-bidi: isolate;
}

body.az-product-first-market .product-card .az-card-rating > small b {
    color: #b86500;
    font: 900 10px/1 Arial, sans-serif;
}

body.az-product-first-market .product-card .az-card-rating.is-empty > small,
body.az-product-first-market .product-card .az-card-rating.is-empty > small b {
    color: #98a2b3 !important;
}

/* Detail-page rating stays inside the information card; never floats on gallery media. */
.product-detail-page .detail-info-card .detail-public-rating.az-detail-rating {
    position: static !important;
    inset: auto !important;
    z-index: auto !important;
    display: inline-flex !important;
    width: max-content;
    max-width: 100%;
    min-height: 32px;
    align-items: center;
    gap: 8px;
    margin: 5px 0 10px !important;
    padding: 6px 10px;
    border: 1px solid var(--az-card-rating-gold-line);
    border-radius: 999px;
    background: linear-gradient(180deg, #fffdf8 0%, var(--az-card-rating-gold-soft) 100%);
    direction: ltr;
    unicode-bidi: isolate;
}

.product-detail-page .detail-info-card .detail-public-rating.az-detail-rating.is-empty {
    border-color: var(--az-card-rating-muted-line);
    background: var(--az-card-rating-muted-bg);
}

.product-detail-page .detail-info-card .az-detail-rating > small {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--az-card-rating-ink);
    font: 850 11px/1 Arial, sans-serif;
    white-space: nowrap;
    direction: ltr;
}

.product-detail-page .detail-info-card .az-detail-rating > small b {
    color: #b86500;
    font: 900 12px/1 Arial, sans-serif;
}

.product-detail-page .detail-info-card .az-detail-rating.is-empty > small,
.product-detail-page .detail-info-card .az-detail-rating.is-empty > small b {
    color: #98a2b3;
}

html[data-theme="dark"] body.az-product-first-market .product-card .az-card-rating,
html[data-theme="dark"] .product-detail-page .detail-info-card .az-detail-rating {
    border-color: #664719;
    background: #241b0d;
}

html[data-theme="dark"] body.az-product-first-market .product-card .az-card-rating.is-empty,
html[data-theme="dark"] .product-detail-page .detail-info-card .az-detail-rating.is-empty {
    border-color: #334155;
    background: #172033;
}

/* Mobile: readable but compact in the protected two-column product grid. */
@media (max-width: 760px) {
    body.az-product-first-market .product-card .product-rating.az-card-rating {
        min-height: 22px !important;
        gap: 4px !important;
        margin: 2px 0 4px !important;
        padding: 3px 6px;
    }

    body.az-product-first-market .product-card .az-card-rating .az-public-rating-stars {
        font-size: 9.5px !important;
        letter-spacing: .12px !important;
    }

    body.az-product-first-market .product-card .az-card-rating > small {
        gap: 3px;
        font-size: 7.5px !important;
    }

    body.az-product-first-market .product-card .az-card-rating > small b {
        font-size: 8.5px !important;
    }

    .product-detail-page .detail-info-card .detail-public-rating.az-detail-rating {
        min-height: 30px;
        gap: 6px;
        margin: 4px 0 8px !important;
        padding: 5px 8px;
    }

    .product-detail-page .detail-info-card .az-public-rating-stars--detail {
        font-size: 13px !important;
    }

    .product-detail-page .detail-info-card .az-detail-rating > small {
        font-size: 10px;
    }
}

@media (max-width: 390px) {
    body.az-product-first-market .product-card .product-rating.az-card-rating {
        width: 100%;
        justify-content: center;
        padding-inline: 4px;
    }

    body.az-product-first-market .product-card .az-card-rating .az-public-rating-stars {
        font-size: 8.8px !important;
    }

    body.az-product-first-market .product-card .az-card-rating > small {
        font-size: 7px !important;
    }
}


/* __AZ_PUBLIC_CARD_RATING_DESKTOP_SYNC_V1_0_1__
   Desktop hardening after a verified mobile-success / desktop-stale presentation case.
   This is presentation-only: no rating calculation or review data logic lives here. */
@media (min-width: 761px) {
    body.az-product-first-market #all-product-grid .product-card .product-rating.az-card-rating,
    body.az-product-first-market #featured-product-grid .product-card .product-rating.az-card-rating,
    body.az-product-first-market #related-product-grid .product-card .product-rating.az-card-rating,
    body.az-product-first-market .product-grid .product-card .product-rating.az-card-rating {
        position: relative !important;
        inset: auto !important;
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
        clip: auto !important;
        clip-path: none !important;
        flex: 0 0 auto !important;
        align-self: flex-start !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        min-height: 28px !important;
        margin: 2px 0 7px !important;
        padding: 5px 9px !important;
        gap: 7px !important;
        overflow: visible !important;
        border: 1px solid #f1d49b !important;
        border-radius: 999px !important;
        background: linear-gradient(180deg, #fffdf8 0%, #fff7e7 100%) !important;
        box-shadow: 0 3px 10px rgba(245, 158, 11, .08) !important;
        isolation: isolate;
    }

    body.az-product-first-market .product-card .az-card-rating .az-public-rating-stars {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex: 0 0 auto !important;
        font-size: 13px !important;
        letter-spacing: .3px !important;
        line-height: 1 !important;
    }

    body.az-product-first-market .product-card .az-card-rating > small {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        align-items: center !important;
        gap: 4px !important;
        font-size: 9px !important;
        line-height: 1 !important;
    }

    body.az-product-first-market .product-card .az-card-rating > small b {
        font-size: 10.5px !important;
    }

    body.az-product-first-market .product-card .az-card-rating.is-empty {
        border-color: #e5e9ef !important;
        background: #f8fafc !important;
        box-shadow: none !important;
    }

    /* Make room for the rating line without changing card width or action layout. */
    body.az-product-first-market .product-card .product-card-body {
        min-height: 174px !important;
    }
}
