/* Shop S1: rifiniture trasversali, senza sostituire il design system BMS. */
:root {
    --bms-s1-focus: #f7c55a;
    --bms-s1-focus-shadow: rgba(247, 197, 90, .34);
    --bms-s1-success: #7ee2ab;
    --bms-s1-danger: #ff9ca5;
}

:where(a, button, input, select, textarea, [role="button"]):focus-visible {
    outline: 3px solid var(--bms-s1-focus) !important;
    outline-offset: 3px;
    box-shadow: 0 0 0 5px var(--bms-s1-focus-shadow) !important;
}

:where(button, .btn, [role="button"]) {
    min-height: 44px;
}

:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    min-height: 44px !important;
}

body.webapp :where(header a, footer a) {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px !important;
    align-items: center;
    justify-content: center;
}

/* FDN readability floor. We target only compact legacy text: a broad font-size
   override would shrink large CTAs and icon glyphs. Page CSS is loaded later,
   hence the explicit !important minimums on the affected components. */
body.webapp {
    font-weight: 500;
}

body.webapp.home-page :where(.small, small),
body.webapp.wa-page-catalogo :where(.small, small),
body.webapp.wa-page-auth :where(.small, small),
body.webapp.wa-page-diagnosi :where(.small, small),
body.webapp .cookie-banner :where(.small, small),
body.webapp .wa-cookie-consent-modal :where(.small, small) {
    font-size: 15px !important;
}

body.webapp :where(a[href], button, input, select, textarea, [role="button"]) {
    font-weight: 600;
}

body.webapp :where(.btn-sm),
body.webapp.wa-page-catalogo .wa-catalog-filter-form :where(.form-control, .form-select) {
    font-size: 15px !important;
}

body.webapp :where(
    .nav-link-webapp:not(.nav-link-cart),
    .btn-webapp-outline.btn-sm,
    .btn-webapp-primary.btn-sm,
    .wa-mobile-bottom-nav__label,
    .wa-catalog-mobile-cat-chip,
    .wa-catalog-actionbar__cta-label,
    .wa-catalog-actionbar__detail-label,
    .wa-catalog-mobile-filters-btn__label
) {
    font-size: 15px !important;
    font-weight: 600 !important;
}

body.webapp .wa-mobile-bottom-nav__item {
    font-size: 15px !important;
    font-weight: 600 !important;
}

body.webapp :is(
    .navbar-toggler,
    #waBottomVoiceBtn,
    .nav-link-webapp:not(.nav-link-cart),
    .nav-link-cart,
    .btn-webapp-outline,
    .btn-webapp-primary,
    .btn-outline-light,
    .btn-outline-secondary,
    .wa-home-hero-guide-link,
    .wa-home-cat-card,
    .wa-home-feature-card,
    .wa-catalog-mobile-cat-chip,
    .wa-catalog-m-strip__card,
    .wa-catalog-actionbar__detail,
    .wa-catalog-actionbar__wish,
    .wa-auth-help-link,
    .wa-auth-back-link
) {
    font-weight: 600 !important;
}

body.webapp.wa-page-catalogo .wa-catalog-desk-filters__title,
body.webapp.wa-page-catalogo .wa-catalog-actionbar__detail,
body.webapp.wa-page-catalogo .wa-catalog-actionbar__cta,
body.webapp.wa-page-catalogo .wa-catalog-actionbar__wish {
    font-size: 15px !important;
}

body.webapp :where(
    #waCatalogCountLine,
    .wa-catalog-card-meta,
    .wa-catalog-card-spec,
    .wa-catalog-desk-filters__title,
    .wa-catalog-m-hero__eyebrow,
    .wa-catalog-m-hero__lead,
    .wa-catalog-mobile-head__count,
    .wa-catalog-m-strip__name,
    .wa-home-feature-card__brand,
    .wa-home-feature-card__hint,
    .wa-home-feature-card__title,
    .wa-home-cat-card__meta,
    .wa-home-cat-card__chev
) {
    font-size: 15px !important;
}

body.webapp :where(
    .wa-catalog-m-strip__name,
    .wa-home-feature-card__title,
    .wa-home-cat-card__chev
) {
    font-weight: 600 !important;
}

body.webapp footer :where(p, span, strong, a, .footer-copy, .wa-vorrei-credit),
body.webapp .cookie-banner :where(p, a, button) {
    font-size: 15px !important;
}

body.webapp footer :where(p, span, .footer-copy, .wa-vorrei-credit),
body.webapp .cookie-banner p {
    font-weight: 500 !important;
}

body.webapp footer a,
body.webapp .cookie-banner :where(a, button) {
    font-weight: 600 !important;
}

body.webapp footer strong {
    font-weight: 700 !important;
}

body.webapp.wa-page-diagnosi :where(
    .wa-diag-hero__eyebrow,
    .wa-diag-chat__meta strong,
    .wa-diag-chat__meta span,
    .wa-diag-msg__bubble,
    .wa-diag-choices__label,
    .wa-diag-product__level,
    .wa-diag-product__price
) {
    font-size: 15px !important;
}

body.webapp.wa-page-diagnosi :where(.wa-diag-choice, .wa-diag-product__actions .btn) {
    min-height: 44px;
    font-size: 15px !important;
    font-weight: 600 !important;
}

/* The empty diagnosis state is still a useful navigation path. Its inline
   links remain sentence-like on desktop but become genuine touch targets. */
body.webapp.wa-page-diagnosi .alert a {
    display: inline-flex;
    min-height: 44px;
    padding-inline: .25rem;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

/* Bootstrap's translucent contextual helpers otherwise paint the stock text
   with the same green as its translucent background on the product page. */
#waStockBadge.bg-success {
    --bs-bg-opacity: 1;
    background-color: #14633f !important;
    border-color: #74d7a5 !important;
    color: #f4fff8 !important;
    -webkit-text-fill-color: #f4fff8 !important;
}

#waStockBadge.bg-warning {
    --bs-bg-opacity: 1;
    background-color: #6a4a00 !important;
    border-color: #e5bf55 !important;
    color: #fff8dc !important;
    -webkit-text-fill-color: #fff8dc !important;
}

#waStockBadge.bg-secondary {
    --bs-bg-opacity: 1;
    background-color: #41464b !important;
    border-color: #adb5bd !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

[aria-busy="true"] {
    cursor: progress;
}

.wa-vorrei-credit {
    width: 100%;
    margin: .75rem auto 0;
    color: var(--wa-text-muted, #d9d3cc);
    font-size: .9375rem;
    font-weight: 700;
    letter-spacing: .055em;
    line-height: 1.45;
}

.bms-s1-inline-status {
    min-height: 1.5em;
    color: var(--wa-text, #fff);
}

.bms-s1-inline-status[data-state="success"] { color: var(--bms-s1-success); }
.bms-s1-inline-status[data-state="error"] { color: var(--bms-s1-danger); }

@media (max-width: 480px) {
    :where(button, .btn, [role="button"], input, select) {
        min-height: 48px;
    }
    .wa-vorrei-credit {
        padding-inline: 1rem;
        font-size: .9375rem;
    }

    /* Complex product cards need a full thumb-width on compact phones. */
    .webapp.wa-page-catalogo .wa-catalog-product-grid > [class*="col-"] {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.webapp.wa-page-catalogo :where(.wa-catalog-card-title, .wa-catalog-card-price) {
        font-size: 15px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

