/**
 * Simply Desserts Trust Badges — heritage-confectioner aesthetic.
 *
 * All selectors scoped under .sdtb / .sdtb-hero / .sdtb-strip so it can't
 * bleed into unrelated UI. Disable by removing the enqueue line in
 * SDTB_Render::enqueue_assets().
 */

.sdtb {
    --sd-brown: #492f23;
    --sd-brown-soft: #6d4f3f;
    --sd-cream: #fffaf3;
    --sd-cream-warm: #fbf2e3;
    --sd-rule: #d9c7af;
    --sd-rule-soft: #ead8be;
    --sd-charcoal: #2d2520;
    --sd-mute: #8a6f63;
    --sd-gold: #c89b3c;

    --sdtb-serif: "Poppins", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --sdtb-sans:  "Poppins", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

    color: var(--sd-charcoal);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.sdtb * { box-sizing: border-box; }

.sdtb-stars {
    display: inline-flex;
    gap: 3px;
    color: var(--sd-gold);
    font-size: 18px;
    line-height: 1;
    letter-spacing: 0.04em;
}

.sdtb-stars--sm { font-size: 14px; }
.sdtb-stars--lg { font-size: 26px; gap: 5px; }

/* =====================================================
   HERO BLOCK
   ===================================================== */
.sdtb-hero {
    background: #ffffff;
    padding: 64px clamp(24px, 6vw, 96px) 56px;
    position: relative;
    font-family: var(--sdtb-sans);
    border: 1px solid var(--sd-rule);
    border-radius: 18px;
    overflow: hidden;
}

.sdtb-hero__eyebrow {
    text-align: center;
    font-family: var(--sdtb-sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--sd-brown-soft);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.sdtb-hero__eyebrow::before,
.sdtb-hero__eyebrow::after {
    content: "";
    flex: 0 0 48px;
    height: 1px;
    background: var(--sd-rule);
}

.sdtb-hero__numeral {
    font-family: var(--sdtb-serif);
    font-weight: 600;
    font-size: clamp(80px, 12vw, 160px);
    line-height: 0.95;
    color: var(--sd-brown);
    text-align: center;
    letter-spacing: -0.04em;
    margin: 4px 0 8px;
}

.sdtb-hero__sub {
    text-align: center;
    font-family: var(--sdtb-serif);
    font-weight: 400;
    font-size: 15px;
    color: var(--sd-brown-soft);
    margin-bottom: 28px;
    letter-spacing: 0.01em;
}

.sdtb-hero__stars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto 6px;
    font-family: var(--sdtb-sans);
    font-size: 14px;
    color: var(--sd-brown);
    letter-spacing: 0.04em;
}

.sdtb-hero__sources {
    display: flex;
    align-items: stretch;
    margin-top: 44px;
    border-top: 1px solid var(--sd-rule-soft);
}

.sdtb-source {
    flex: 1 1 0;
    min-width: 0;
    padding: 28px 24px;
    text-align: center;
    border-right: 1px solid var(--sd-rule-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: inherit;
    transition: background 200ms ease;
    cursor: pointer;
}
.sdtb-source:last-child { border-right: none; }

.sdtb-source:hover { background: var(--sd-cream-warm); }

.sdtb-source__brand {
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.sdtb-source__brand svg,
.sdtb-source__brand img {
    height: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    max-width: 100%;
    display: block;
    object-fit: contain;
}

/* Per-brand visual balance:
   - Amazon wordmark + smile: wide horizontal mark, mid weight at 30px
   - Google wordmark: similar visual presence at 30px
   - Simply Desserts: two-line stacked mark, needs more vertical room */
.sdtb-source__brand--amazon { height: 30px; }
.sdtb-source__brand--google { height: 30px; }
.sdtb-source__brand--native { height: 30px; }

.sdtb-source__rating {
    font-family: var(--sdtb-serif);
    font-weight: 500;
    font-size: 32px;
    color: var(--sd-brown);
    line-height: 1;
    margin: 8px 0 4px;
    letter-spacing: -0.02em;
}

.sdtb-source__count {
    font-family: var(--sdtb-sans);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--sd-brown-soft);
    margin-bottom: 4px;
}

.sdtb-source__cta {
    font-family: var(--sdtb-sans);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--sd-brown-soft);
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0.7;
    transition: opacity 200ms ease, gap 200ms ease, color 200ms ease;
}
.sdtb-source:hover .sdtb-source__cta {
    opacity: 1;
    gap: 10px;
    color: var(--sd-brown);
}
.sdtb-source__cta svg {
    width: 10px; height: 10px;
    transition: transform 200ms ease;
}
.sdtb-source:hover .sdtb-source__cta svg {
    transform: translate(2px, -2px);
}

/* ---- Empty / "Be the first to review" state ---- */
.sdtb-source__rating--empty {
    color: var(--sd-rule);
    font-size: 32px;
    line-height: 1;
    letter-spacing: 0;
}
.sdtb-source__cta--empty {
    color: var(--sd-brown);
    opacity: 0.95;
    font-weight: 600;
}
.sdtb-source--empty:hover .sdtb-source__cta--empty {
    color: var(--sd-brown);
}

.sdtb-hero__refresh {
    text-align: center;
    margin-top: 32px;
    font-family: var(--sdtb-sans);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sd-mute);
}
.sdtb-hero__refresh::before {
    content: "✦";
    margin-right: 10px;
    color: var(--sd-rule);
}

/* =====================================================
   INLINE SUMMARY — sits under the product title.
   "★★★★½ 6,587 reviews" inline, count clickable to scroll
   to the full reviews block.
   ===================================================== */
.sdtb-summary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--sdtb-sans);
    line-height: 1;
    vertical-align: middle;
}

.sdtb-summary .sdtb-stars {
    color: #492f23;
    font-size: 22px;
    letter-spacing: 0.04em;
    line-height: 1;
}

.sdtb-summary__count,
.sdtb-summary__count:visited {
    color: #492f23;
    font-size: 15px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 150ms ease;
}
.sdtb-summary__count:hover,
.sdtb-summary__count:focus {
    color: #6d4f3f;
    text-decoration: underline;
}

.sdtb-summary__sep {
    margin: 0 4px;
    color: var(--sd-mute);
    opacity: 0.7;
    font-weight: 400;
    text-decoration: none;
}
.sdtb-summary__rating {
    text-decoration: none;
}

/* =====================================================
   COMPACT STRIP
   ===================================================== */
.sdtb-strip {
    background: #ffffff;
    border: 1px solid var(--sd-rule);
    border-radius: 18px;
    padding: 12px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    column-gap: 0;
    row-gap: 12px;
    flex-wrap: wrap;
    font-family: var(--sdtb-sans);
}

.sdtb-strip__lead {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1 1 auto;
    min-width: 0;
}
/* Spread the three lead items (stars · numeral · leadtext) evenly across
   the lead area so the row aligns with the equal-width sources block. No
   dividers here — keeps the lead visually distinct from the logo row. */
.sdtb-strip__lead > .sdtb-stars,
.sdtb-strip__lead > .sdtb-strip__numeral {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    min-width: 0;
}
/* Give the text column a little more room than the stars/numeral columns
   so "customer reviews" stays on one line without overflowing. */
.sdtb-strip__lead > .sdtb-strip__leadtext {
    flex: 1.4 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    min-width: 0;
    text-align: center;
}

.sdtb-strip__lead {
    /* keep existing flex behaviour; the children are now: stars · numeral · leadtext */
    align-items: center;
}

.sdtb-strip__numeral {
    font-family: var(--sdtb-serif);
    font-weight: 600;
    font-size: 30px;
    color: var(--sd-brown);
    line-height: 1;
    letter-spacing: -0.02em;
}

.sdtb-strip__leadtext {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.sdtb-strip__noun {
    font-family: var(--sdtb-sans);
    font-weight: 600;
    font-size: 14px;
    color: var(--sd-brown);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.sdtb-strip__caption {
    font-family: var(--sdtb-sans);
    font-size: 12px;
    color: var(--sd-brown-soft);
    letter-spacing: 0.01em;
}
.sdtb-strip__caption strong {
    color: var(--sd-brown);
    font-weight: 600;
}

.sdtb-strip__sources {
    display: flex;
    align-items: stretch;
    gap: 0;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    justify-content: stretch;
    min-width: 0;
}

.sdtb-strip__source {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    padding: 2px 12px;
    transition: opacity 180ms ease;
    white-space: nowrap;
    flex: 1 1 0;
    min-width: 0;
    border-left: 1px solid var(--sd-rule-soft);
}
.sdtb-strip__source:first-child {
    border-left: none;
}
.sdtb-strip__source:hover { opacity: 0.7; }

.sdtb-strip__brand {
    height: 22px;
    display: inline-flex;
    align-items: center;
}
.sdtb-strip__brand svg,
.sdtb-strip__brand img {
    height: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    display: block;
    object-fit: contain;
}

/* Per-brand visual balance (matches the hero proportions). */
.sdtb-strip__brand--amazon { height: 22px; }
.sdtb-strip__brand--google { height: 22px; }
.sdtb-strip__brand--native { height: 30px; }

.sdtb-strip__data {
    font-family: var(--sdtb-sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--sd-brown);
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.sdtb-strip__data .star {
    color: var(--sd-gold);
    margin-right: 3px;
    font-size: 16px;
    vertical-align: -1px;
}
.sdtb-strip__data .count {
    color: var(--sd-mute);
}

/* =====================================================
   Mobile
   ===================================================== */
@media (max-width: 720px) {
    .sdtb-hero {
        padding: 48px 20px 40px;
    }

    .sdtb-hero__numeral {
        font-size: 88px;
    }

    /* Stack each source as a full-width row card — logo on top, then
       rating / count / CTA centred below, mirroring the desktop column
       layout one source at a time. */
    .sdtb-hero__sources {
        flex-direction: column;
        margin-top: 32px;
    }

    .sdtb-source {
        flex: 0 0 auto;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 28px 16px;
        border-right: none;
        border-bottom: 1px solid var(--sd-rule-soft);
    }
    .sdtb-source:last-child { border-bottom: none; }

    .sdtb-source__brand {
        height: 34px;
        margin-bottom: 16px;
    }
    .sdtb-source__brand--amazon,
    .sdtb-source__brand--google,
    .sdtb-source__brand--native { height: 34px; }

    /* -----------------------------------------------------------------
       SUMMARY (inline rating + count under the product title)
       Stack vertically and centre everything so it sits tidily on mobile
       widths instead of trying to fit on one cramped line.
       ----------------------------------------------------------------- */
    .sdtb-summary {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        text-align: center;
    }
    .sdtb-summary__count {
        text-align: center;
    }

    /* -----------------------------------------------------------------
       STRIP — full-card mobile layout
       Lead block stacks (stars · big numeral · text), each centred and
       full-width. Source pills stack as full-width rows with horizontal
       dividers between them (the desktop vertical dividers become top
       borders because the flex direction flipped).
       ----------------------------------------------------------------- */
    /* Force-stretch the Elementor wrapper(s) on mobile so the strip card
       isn't pinched in by inherited column/widget max-widths or alignment.
       Elementor wraps each shortcode in:
         .elementor-widget-shortcode > .elementor-widget-container > .elementor-shortcode > .sdtb-strip
       Any of these can shrink-to-fit if their own rules say so, so we
       hammer every layer back to 100% width. */
    .elementor-widget-shortcode,
    .elementor-widget-shortcode .elementor-widget-container,
    .elementor-widget-shortcode .elementor-shortcode,
    .elementor-widget-shortcode .sdtb-strip,
    .elementor-widget-container .sdtb-strip {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        align-self: stretch !important;
        display: block;
    }
    /* But the strip itself needs to keep its flex behaviour after the
       wrapper override forces display:block — restore it explicitly. */
    .sdtb-strip {
        display: flex !important;
    }

    .sdtb-strip {
        flex-direction: column;
        align-items: stretch;
        column-gap: 0;
        row-gap: 16px;
        padding: 16px;
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }

    .sdtb-strip__lead {
        flex-direction: column;
        align-items: center;
        gap: 6px;
        width: 100%;
        text-align: center;
    }
    .sdtb-strip__lead > .sdtb-stars,
    .sdtb-strip__lead > .sdtb-strip__numeral,
    .sdtb-strip__lead > .sdtb-strip__leadtext {
        flex: 0 0 auto;
        width: auto;
        padding: 0;
        justify-content: center;
        text-align: center;
    }
    .sdtb-strip__lead > .sdtb-strip__leadtext {
        align-items: center;
    }

    .sdtb-strip__sources {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0;
    }
    .sdtb-strip__source {
        flex: 0 0 auto;
        width: 100%;
        flex-direction: column;
        padding: 14px 0;
        border-left: none;
        border-top: 1px solid var(--sd-rule-soft);
    }
    .sdtb-strip__source:first-child {
        border-top: none;
        padding-top: 6px;
    }
}
