/* SF_SITE_CONSISTENCY_V1_20261202
 * Shared typography, spacing and touch-target corrections for the live Site shell.
 * The rules are intentionally scoped to existing Sarafanovo components.
 */

:root {
    --sf-font-ui: "onest-nd", sans-serif;
    --sf-focus: #6d237d;
    --sf-focus-soft: rgba(109, 35, 125, .18);
}

/* SF_MOBILE_REGION_INTRO_HIDE_V1: omit the repeated regional delivery line. */
@media (max-width: 767px) {
    .sf-home-category .sf-category-region-intro {
        display: none !important;
    }
}

/* SF_CARD_BONUS_VISIBILITY_V1: keep the earned amount beside the price on
 * desktop and give it a calm, separate line in narrow product tiles. */
html body .products__item-bonus {
    color: #7d248d;
    white-space: nowrap;
}

html body .products__item-bonus > span {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 3px 8px;
    border: 1px solid #e9d8ef;
    border-radius: 999px;
    background: #faf3fc;
    color: #7d248d;
    font-size: 12px !important;
    font-weight: 650;
    line-height: 1.3;
}

@media (max-width: 767px) {
    html body :is(#product-list,#sf-mc-recs-1,#sf-mc-recs-2,#sf-mc-recs-3,#sfhc-track-1,#sfhc-track-2,#sfhc-track-3).sf-mc-scope.sf-mc-scope .products__item-bonus,
    html body .sf-home-category.sf-home-view-grid #product-list .products__item-bonus {
        display: flex !important;
        flex-basis: 100%;
        width: 100%;
        margin: 4px 0 0 !important;
        padding: 0;
        line-height: 1.3;
    }
}

/* SF_MOBILE_CARD_TARGETS_V1: keep list purchase actions tappable and above
 * the expanded group-progress panel on category and search pages. */
@media (max-width: 767px) {
    html body.sf-unified .sf-home-category.sf-home-view-list #product-list
    .products__item-buy .theme-btn.btn-primary {
        min-height: 44px !important;
    }

    html body.sf-unified .sf-home-category.sf-home-view-list #product-list
    .sf-mc-group-toggle {
        position: relative !important;
        z-index: 31 !important;
        width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
    }
}

/* The installed variable face is registered as onest-nd. Some editorial
 * components used non-existent family names and silently fell back to Segoe UI. */
.sf-info-v1,
.sf-info-nav-v3 .pages__menu-link,
.sf-info-nav-v4__title,
.sf-info-nav-v4__summary,
.sf-info-nav-v4 .pages__menu-link {
    font-family: var(--sf-font-ui);
}

/* Keep grouped information navigation readable and tappable at every width. */
.sf-info-nav-v4 .pages__menu-link {
    min-height: 44px;
    font-size: 14px;
    line-height: 1.35;
}

body.sf-unified :where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid var(--sf-focus);
    outline-offset: 3px;
    box-shadow: 0 0 0 5px var(--sf-focus-soft);
}

body.sf-unified ::selection {
    background: #ead9ee;
    color: #27072f;
}

/* The error page is part of the storefront journey, not an unstyled dead end. */
.error-inner > p {
    max-width: 72ch;
    font-size: 15px;
    line-height: 1.55;
}

.page-error__search :is(input, button),
.page-error__actions > a {
    min-height: 44px;
    font-size: 14px;
    line-height: 1.25;
}

/* SF_HOME_HOVER_CLEANUP_V1_20261202
 * The legacy input hover painted a 54 px rectangle inside a 48 px search
 * shell, so the highlight stopped before the camera and submit controls.
 * Keep the input aligned to the shell and paint interaction state on the
 * complete field container instead. */
.sfh-home .sfh-search-host .searchpro__field-container,
.sfh-home .sfh-search-host .searchpro__field-input-container,
.sfh-home .sfh-search-host .searchpro__field-button-container {
    height: 48px !important;
    min-height: 48px !important;
}

.sfh-home .sfh-search-host .searchpro__field-container {
    border-radius: 8px;
    transition: box-shadow .18s ease;
}

.sfh-home .sfh-search-host .searchpro__field-input {
    height: 48px !important;
    min-height: 48px !important;
    background: transparent !important;
    border-radius: 8px 0 0 8px !important;
}

.sfh-home .sfh-search-host .searchpro__field-input:hover,
.sfh-home .sfh-search-host .searchpro__field-input:focus,
.sfh-home .sfh-search-host .searchpro__field-input:focus-visible {
    background: transparent !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.sfh-home .sfh-search-host .searchpro__field-container:hover {
    box-shadow:
        inset 0 0 0 1px rgba(144, 5, 180, .32),
        0 4px 14px rgba(52, 23, 56, .12);
}

.sfh-home .sfh-search-host .searchpro__field-container:focus-within {
    box-shadow:
        inset 0 0 0 2px #9005b4,
        0 0 0 3px rgba(144, 5, 180, .16),
        0 5px 16px rgba(52, 23, 56, .14);
}

/* The compact desktop card clips its purchase row when the pointer leaves.
 * A descendant button still transitions visibility for 300 ms and its top
 * edge can remain painted as a purple stripe. Hide the complete expandable
 * subtree immediately while keeping hover and keyboard focus behavior. */
@media (hover: hover) and (pointer: fine) {
    .sfh-home .sfhc-products .sfhc-compact-ready .products__item-buy,
    .sfh-home .sfhc-products .sfhc-compact-ready .products__item-buy *,
    .sfh-home .sfhc-products .sfhc-compact-ready .products__item-cutting,
    .sfh-home .sfhc-products .sfhc-compact-ready .products__item-cutting *,
    .sfh-home .sfhc-products .sfhc-compact-ready .products__item-fullprice,
    .sfh-home .sfhc-products .sfhc-compact-ready .products__item-fullprice *,
    .sfh-home .sfhc-products .sfhc-compact-ready .wc-card-progress[data-wc-card-progress],
    .sfh-home .sfhc-products .sfhc-compact-ready .wc-card-progress[data-wc-card-progress] * {
        transition-property:
            background-color,
            color,
            border-color,
            box-shadow,
            transform,
            filter !important;
    }

    .sfh-home .sfhc-products .sfhc-compact-ready:not(:hover):not(:focus-within) .products__item-buy,
    .sfh-home .sfhc-products .sfhc-compact-ready:not(:hover):not(:focus-within) .products__item-buy *,
    .sfh-home .sfhc-products .sfhc-compact-ready:not(:hover):not(:focus-within) .products__item-cutting,
    .sfh-home .sfhc-products .sfhc-compact-ready:not(:hover):not(:focus-within) .products__item-cutting *,
    .sfh-home .sfhc-products .sfhc-compact-ready:not(:hover):not(:focus-within) .products__item-fullprice,
    .sfh-home .sfhc-products .sfhc-compact-ready:not(:hover):not(:focus-within) .products__item-fullprice *,
    .sfh-home .sfhc-products .sfhc-compact-ready:not(:hover):not(:focus-within) .wc-card-progress[data-wc-card-progress],
    .sfh-home .sfhc-products .sfhc-compact-ready:not(:hover):not(:focus-within) .wc-card-progress[data-wc-card-progress] * {
        visibility: hidden !important;
        transition: none !important;
        pointer-events: none !important;
    }

    /* The image-gallery hit zones keep their active bullet after the pointer
     * moves away. Preserve the hit zones, but paint their bottom indicator
     * only on the card that is currently hovered or keyboard-focused. */
    .sfh-home .sfhc-products .sfhc-compact-ready:not(:hover):not(:focus-within) .products__item-pagination {
        opacity: 0 !important;
        transition: none !important;
    }

    .sfh-home .sfhc-products .sfhc-compact-ready:hover .products__item-pagination,
    .sfh-home .sfhc-products .sfhc-compact-ready:focus-within .products__item-pagination {
        opacity: 1 !important;
    }
}

@media (max-width: 991px) {
    /* Mobile search controls previously mixed 36, 40 and 42 px targets. */
    body.sf-unified .searchpro__field-input {
        min-height: 44px !important;
    }

    body.sf-unified .sf-imagesearch-camera,
    body.sf-unified .searchpro__field-button {
        width: 44px !important;
        min-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
    }

    /* Category landing and product cards: preserve the compact layout while
     * expanding the real hit areas to the mobile accessibility floor. */
    .sf-home-category__definition-link,
    .sf-home-category__button,
    .sf-home-category .sf-quicklinks a,
    .products__item .products__actions-link,
    .products__item .theme-btn.btn-primary,
    .products__item-name > a,
    .sf-mc-group-toggle,
    .subscribe__socials-link {
        min-height: 44px !important;
    }

    .sf-home-category__definition-link,
    .sf-home-category__button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 13px !important;
        line-height: 1.3;
    }

    /* Shop-Script loads a high-specificity 38 px card rule after the shared
     * shell. Match its scope so the primary purchase target keeps the floor. */
    html body.sf-unified .sf-home-category.sf-home-view-grid #product-list
    .products__item-buy .theme-btn.btn-primary {
        min-height: 44px !important;
        font-size: 13px !important;
    }

    .products__item .products__actions-link,
    .sf-mc-group-toggle,
    .subscribe__socials-link {
        min-width: 44px !important;
    }

    .sf-home-category .sf-quicklinks a {
        display: inline-flex;
        align-items: center;
    }
}

@media (max-width: 767px) {
    /* The legacy fixed 400 px hero centered 429 px of content, clipping both
     * the heading and the second recovery action at 390 px. */
    body.sf-unified .error-header {
        height: auto !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    body.sf-unified .error-inner {
        height: auto !important;
        min-height: 0 !important;
        padding: 24px 20px !important;
        justify-content: flex-start !important;
    }

    body.sf-unified .error-inner .page-name {
        margin: 0 0 16px !important;
        font-size: clamp(30px, 9vw, 36px) !important;
        line-height: 1.08 !important;
    }

    body.sf-unified .error-inner > p {
        margin-bottom: 16px !important;
        font-size: 15px !important;
        line-height: 1.5 !important;
    }

    body.sf-unified .page-error__search {
        margin-bottom: 16px !important;
    }

    .page-error__search-row,
    .page-error__actions {
        gap: 8px;
    }

    body.sf-unified .page-error__search :is(input, button),
    body.sf-unified .page-error__actions > a {
        min-height: 44px !important;
        padding-block: 12px !important;
    }
}

/* SF_PRODUCT_DETAIL_SPECS_SINGLE_V1: use the available width when a product
 * has specifications but no separate description alongside them. */
#js-product-page.product.sf-product-v4 .sf-product-details > .product__features:only-child,
#js-product-page.product.sf-product-v4 .sf-product-info-grid > .product__features:only-child {
    grid-column: 1 / -1;
}

/* SF_PRODUCT_DETAIL_MIDWIDTH_V1: the five purchase-benefit tiles and the
 * 40px price crowd one another before the product layout stacks at 979px. */
@media (min-width: 980px) and (max-width: 1199px) {
    /* SF_PRODUCT_DETAIL_TITLE_BALANCE_V1: keep the unit with the title line
     * instead of leaving only the superscript on a third line. */
    #js-product-page.product.sf-product-v4 .sf-product-title {
        font-size: 25px;
        overflow-wrap: break-word;
        text-wrap: balance;
    }

    #js-product-page.product.sf-product-v4 .product__add2cart.js-top {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    #js-product-page.product.sf-product-v4 .product__pr-price-new .price-wrapper {
        white-space: nowrap;
    }

    #js-product-page.product.sf-product-v4 .sf-product-bonus-note {
        grid-template-columns: minmax(0, 1fr) 44px;
        justify-self: start;
        max-width: 240px;
        min-width: 190px;
        width: 100%;
    }

    #js-product-page.product.sf-product-v4 .addons__list {
        align-items: stretch;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    #js-product-page.product.sf-product-v4 .addons__list-item {
        min-height: 88px;
    }
}

/* SF_PRODUCT_DETAIL_MOBILE_BENEFITS_V1: give the benefit title enough room
 * for the price and currency sign on compact phones. */
@media (max-width: 420px) {
    #js-product-page.product.sf-product-v4 .addon__item,
    #js-product-page.product.sf-product-v4 .sf-benefit-details--card > summary.addon__item {
        gap: 6px;
        padding: 9px 25px 9px 8px;
    }

    #js-product-page.product.sf-product-v4 .addon__item-icon {
        flex-basis: 32px;
        height: 32px;
        width: 32px;
    }

    #js-product-page.product.sf-product-v4 .sf-benefit-details--card > summary.addon__item::after {
        right: 10px;
    }
}

/* SF_PRODUCT_DETAIL_NARROW_BENEFITS_V1: on very narrow phones each purchase
 * condition needs the full row for readable text and a clear tap target. */
@media (max-width: 370px) {
    #js-product-page.product.sf-product-v4 .addons__list {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}
