/* AGAFORT Mobile Storefront Visual Foundation V1
   Presentation overlay only. Consumes existing --ag-* / --ag-dh-* / --ag-hs-* tokens.
   Does not fork Header, Product Card, Homepage V2, or Flash Sale architecture.
   Accessibility fallback below 320px is documented in the 319.98px block. */

@media (max-width: 991.98px) {
    /* —— Seller CTA: keep markup (desktop + footer phase), hide from mobile chrome —— */
    .ag-dh-topbar--utility .ag-dh-topbar-start [data-header-seller],
    .ag-dh-topbar--utility .ag-dh-topbar-start {
        display: none !important;
    }

    .ag-dh-topbar.ag-dh-topbar--utility {
        min-height: 28px !important;
        padding-block: 2px !important;
    }

    .ag-dh-topbar--utility .ag-dh-topbar-inner {
        min-height: 28px !important;
        gap: 8px !important;
        justify-content: flex-end !important;
    }

    .ag-dh-topbar--utility .ag-dh-topbar-end {
        margin-inline-start: auto;
        gap: 8px;
    }

    .ag-locale-switcher,
    .ag-dh-locale {
        --ag-locale-flag-size: 16px;
        --ag-locale-gap: 6px;
        font-size: 0.75rem;
    }

    /* —— Top promotional strip: keep Admin content, cap height —— */
    .ag-enterprise-top-banner {
        min-height: 0;
        max-height: 28px;
        line-height: 1.2;
        overflow: hidden;
    }

    .ag-enterprise-top-banner__text,
    .ag-enterprise-top-banner__html {
        padding-block: 4px !important;
        font-size: 0.75rem;
    }

    /* —— Header row 1 + full-width search row 2 —— */
    .ag-dh-header {
        --ag-dh-header-row-h: 40px;
        --ag-dh-header-pad-y: 4px;
        --ag-dh-header-main-gap: 6px;
        --ag-dh-header-action-gap: 0px;
        --ag-sf-logo-max-width: 96px;
        --ag-sf-logo-height: 26px;
        min-height: 0 !important;
    }

    .ag-dh-header-main {
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 6px !important;
        padding-block: 4px !important;
        padding-inline: 8px !important;
        min-height: 0 !important;
        height: auto !important;
    }

    .ag-dh-header--mobile-category-nav .ag-dh-mobile-cat-trigger {
        width: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        height: 40px !important;
    }

    .ag-dh-header--mobile-category-nav .ag-dh-logo {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .ag-dh-logo-img,
    .ag-dh-logo-picture {
        max-width: 96px !important;
        max-height: 26px !important;
        height: 26px !important;
        width: auto !important;
    }

    .ag-dh-header-actions {
        gap: 0 !important;
        min-height: 40px !important;
        height: 40px !important;
        max-height: 40px !important;
    }

    .ag-dh-header-actions > .ag-dh-account,
    .ag-dh-header-actions > .ag-dh-action,
    .ag-dh-header-actions a.ag-dh-action,
    .ag-dh-header-actions a.ag-dh-counter-action,
    .ag-dh-header-actions .ag-dh-account-toggle {
        width: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
        min-height: 40px !important;
        height: 40px !important;
        max-height: 40px !important;
        padding: 0 !important;
        gap: 0 !important;
    }

    .ag-dh-header-actions .ag-dh-account-name,
    .ag-dh-header-actions .ag-dh-action-label,
    .ag-dh-header-actions .ag-dh-account-caret,
    .ag-dh-header-actions .ag-dh-account-toggle > span:not(.ag-dh-avatar),
    .ag-dh-header-actions .ag-dh-action > span:not(.ag-dh-action-icon):not(.ag-dh-action-badge) {
        display: none !important;
    }

    .ag-dh-header-actions .ag-dh-action:focus-visible,
    .ag-dh-header-actions .ag-dh-account-toggle:focus-visible,
    .ag-dh-header--mobile-category-nav .ag-dh-mobile-cat-trigger:focus-visible {
        outline: 2px solid var(--ag-dh-accent, #f68b1e);
        outline-offset: 2px;
    }

    /* Search: second row, no clip, 360px-safe */
    .ag-dh-search.ag-hs-v1,
    form.ag-dh-search.ag-hs-v1[data-ag-header-search-v1],
    .ag-dh-search {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        order: 3;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        --ag-hs-bar-height: 40px;
        --ag-hs-camera-hit: 32px;
        --ag-hs-btn-width: 36px;
        overflow: hidden;
    }

    .ag-dh-search.ag-hs-v1 input[type="search"],
    form.ag-dh-search.ag-hs-v1[data-ag-header-search-v1] input[type="search"] {
        min-width: 0 !important;
        width: auto !important;
        font-size: 0.8125rem !important;
        text-align: start;
    }

    .ag-dh-search.ag-hs-v1 input[type="search"]::placeholder {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 767.98px) {
    :root {
        --ag-scs-pad-inline: 8px;
        --ag-scs-pad-block-start: 8px;
        --ag-scs-pad-block-end: 10px;
        --ag-scs-col-gap: 8px;
        --ag-scs-row-gap: 8px;
        --ag-dh-section-gap: 0.75rem;
        --ag-dh-slider-h: 180px;
        --ag-category-columns-mobile: 4;
        --ag-shortcuts-mobile-columns: 4;
        --ag-product-mobile-columns: 2;
        --ag-pc-columns-mobile: 2;
        --ag-ql-mobile-cols: 4;
        --ag-ad-mobile-columns: 4;
        --ag-product-card-max-width: none;
    }

    .ag-dh-page {
        gap: 0.75rem;
    }

    .ag-dh-block,
    .ag-dh-wrap.ag-dh-block,
    .ag-hp2-section,
    .ag-rp-section,
    .ag-fs-section {
        margin-block: 0 0.75rem;
        padding-block: 0;
    }

    .ag-dh-section-header,
    .ag-cl-section__head,
    .ag-rp-header,
    .ag-ush {
        min-height: 40px !important;
        margin-bottom: 0 !important;
        padding-block: 8px !important;
        padding-inline: 8px !important;
        gap: 8px !important;
    }

    .ag-dh-section-header-title,
    .ag-ush-title,
    .ag-rp-header-title {
        font-size: 1rem !important;
        line-height: 1.3 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* —— Hero: ratio over empty min-height —— */
    html.ag-hero-design-on .ag-dh-slider,
    html.ag-hero-design-on .ag-hp2-hero-zone--slider .ag-dh-slider,
    .ag-dh-slider {
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        aspect-ratio: 16 / 9;
    }

    .ag-dh-slide,
    html.ag-hero-design-on .ag-dh-slide {
        min-height: 0 !important;
        padding: 0.75rem !important;
    }

    .ag-dh-slider-dots button {
        min-width: 10px;
        min-height: 10px;
        width: 10px;
        height: 10px;
    }

    /* —— Quick cards / shortcuts: 4 per row —— */
    html.ag-ql-design-on .ag-dh-shortcuts,
    html.ag-ql-design-on .ag-hp2-shortcuts,
    .ag-dh-shortcuts,
    .ag-hp2-shortcuts,
    .ag-dh-shortcuts-carousel [data-rp-track],
    .ag-dh-shortcuts-carousel [data-rp-track]:not(:has(> [data-hp-page])),
    .ag-dh-shortcuts-carousel [data-rp-track]:has(> [data-hp-page]) {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 8px !important;
        overflow: visible !important;
        flex-wrap: unset !important;
        padding: 8px !important;
    }

    .ag-dh-shortcuts-carousel [data-hp-page] {
        display: contents !important;
    }

    .ag-dh-shortcuts-carousel .ag-rp-nav,
    .ag-dh-shortcuts-carousel-host .ag-rp-nav {
        display: none !important;
    }

    .ag-dh-shortcut,
    .ag-dh-shortcut-premium,
    html.ag-ql-design-on .ag-dh-shortcut {
        min-height: 0 !important;
        padding: 6px 4px !important;
        gap: 4px !important;
    }

    html.ag-ql-design-on .ag-dh-shortcut-media,
    .ag-dh-shortcut-media,
    .ag-dh-shortcut > span:first-child {
        width: 44px !important;
        height: 44px !important;
    }

    html.ag-ql-design-on .ag-dh-shortcut-copy small,
    .ag-dh-shortcut small {
        font-size: 0.625rem !important;
        line-height: 1.2 !important;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .ag-dh-shortcut-desc,
    html.ag-ql-design-on .ag-dh-shortcut-desc {
        display: none !important;
    }

    /* —— Categories: 4 per row (beats CMS --ag-category-columns-mobile: 2) —— */
    .ag-dh-category-grid,
    .ag-dh-essentials-v1__grid,
    .ag-dh-essentials-v1__grid > [data-hp-page],
    .ag-categories-widget .row {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .ag-categories-widget .row > [class*="col-"] {
        width: auto !important;
        max-width: none !important;
        flex: unset !important;
        padding: 0;
    }

    .ag-dh-category-tile {
        min-width: 0;
    }

    .ag-dh-category-tile img,
    .ag-dh-essentials-v1__media-wrap {
        aspect-ratio: 1 / 1;
        width: 100%;
        object-fit: cover;
    }

    .ag-dh-category-tile-overlay strong,
    .ag-dh-essentials-v1__label,
    .ag-category-card strong {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
        font-size: 0.6875rem;
        line-height: 1.2;
        font-weight: 700;
    }

    .ag-dh-category-tile-overlay span {
        display: none;
    }

    /* —— Product grids: 2 per row, fill width, no 220px dead space —— */
    .ag-pc-density {
        --ag-pc-columns: 2 !important;
        --ag-pc-max-card: none;
    }

    .ag-dh-product-rail-grid,
    .ag-catalog-grid,
    .ag-catalog-grid.ag-pc-density,
    .ag-pc-density[data-ag-pc-presentation="grid"],
    [data-ag-deals-product-grid] .ag-pc-density,
    [data-ag-hsd="recently_viewed"] .ag-pc-density,
    [data-ag-hsd="featured_products"] .ag-dh-product-rail-grid,
    [data-ag-hsd="new_arrivals"] .ag-dh-product-rail-grid,
    [data-ag-hsd="best_sellers"] .ag-dh-product-rail-grid,
    [data-ag-cl] .ag-cl-products.ag-pc-density {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        justify-content: stretch !important;
        justify-items: stretch !important;
        gap: 8px !important;
        overflow: visible !important;
        grid-auto-rows: auto !important;
    }

    .ag-dh-product-rail-grid > *,
    .ag-catalog-grid > *,
    .ag-pc-density[data-ag-pc-presentation="grid"] > *,
    [data-ag-cl] .ag-cl-products.ag-pc-density > [role="listitem"],
    [data-ag-cl] .ag-cl-products.ag-pc-density > * {
        width: auto !important;
        max-width: none !important;
        max-inline-size: none !important;
        inline-size: auto !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    /* —— Recommendations: 2-col grid (membership/query untouched) ——
       Specificity must beat ag-product-card-density.css rail:
       .ag-rp-section .ag-rp-carousel:has(> .ag-pc-density) > .ag-pc-density.ag-rp-track.ag-dh-product-rail-carousel
       Do not match .ag-fs-section / .ag-fs-track. */
    .ag-rp-section .ag-rp-carousel,
    .ag-dh-block-recommended .ag-rp-carousel {
        padding-inline: 8px !important;
        padding-block-start: 8px !important;
    }

    .ag-rp-section .ag-rp-track,
    .ag-rp-section .ag-pc-density,
    .ag-rp-carousel:has(> .ag-pc-density) > .ag-pc-density,
    .ag-rp-section .ag-rp-carousel:has(> .ag-pc-density) > .ag-pc-density.ag-rp-track,
    .ag-rp-section .ag-rp-carousel:has(> .ag-pc-density) > .ag-pc-density.ag-rp-track.ag-dh-product-rail-carousel,
    .ag-rp-section .ag-rp-carousel:has(> .ag-pc-density) > .ag-pc-density.ag-rp-track.ag-dh-product-rail-carousel.ag-dh-product-rail,
    .ag-rp-section .ag-rp-carousel:has(> .ag-pc-density) > .ag-pc-density.ag-rp-track.ag-dh-product-rail-carousel.ag-dh-product-cards,
    [data-ag-recommended-products] .ag-rp-carousel:has(> .ag-pc-density) > .ag-pc-density.ag-rp-track,
    [data-ag-recommended-products] .ag-rp-carousel:has(> .ag-pc-density) > .ag-pc-density.ag-rp-track.ag-dh-product-rail-carousel,
    .ag-dh-block-recommended .ag-pc-density,
    [data-ag-hsd="recommended_products"] .ag-pc-density,
    [data-ag-hsd="recently_viewed"] .ag-rp-track {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-auto-flow: row !important;
        grid-auto-columns: unset !important;
        overflow: visible !important;
        gap: 8px !important;
        flex-wrap: unset !important;
        justify-content: stretch !important;
    }

    .ag-rp-section .ag-rp-track > *,
    .ag-rp-section .ag-pc-density > *,
    .ag-rp-carousel:has(> .ag-pc-density) > .ag-pc-density > *,
    .ag-rp-section .ag-rp-carousel:has(> .ag-pc-density) > .ag-pc-density > *,
    .ag-rp-section .ag-rp-carousel:has(> .ag-pc-density) > .ag-pc-density.ag-rp-track > *,
    .ag-rp-section .ag-rp-carousel:has(> .ag-pc-density) > .ag-pc-density[data-ag-pc-short="1"] > *,
    [data-ag-recommended-products] .ag-rp-carousel:has(> .ag-pc-density) > .ag-pc-density > *,
    .ag-dh-block-recommended .ag-pc-density > * {
        width: auto !important;
        inline-size: auto !important;
        max-width: none !important;
        max-inline-size: none !important;
        flex: unset !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    .ag-rp-section .ag-rp-carousel [data-hp-page],
    .ag-rp-section .ag-rp-carousel:has(> .ag-pc-density) > .ag-pc-density > [data-hp-page] {
        display: contents !important;
        flex: unset !important;
        width: auto !important;
        min-width: 0 !important;
        inline-size: auto !important;
    }

    .ag-rp-section .ag-rp-nav,
    .ag-dh-block-recommended .ag-rp-nav {
        display: none !important;
    }

    .ag-rp-section .ag-dh-product-card--compact .ag-dh-product-media,
    .ag-rp-section .ag-dh-product-card--compact .ag-dh-product-media-wrap {
        max-width: none;
        margin-inline: 0;
        width: 100%;
    }

    /* Flash Sales: keep carousel architecture; compact chrome only */
    .ag-fs-section {
        padding: 8px !important;
    }

    .ag-fs-section .ag-fs-carousel {
        padding-inline: 4px !important;
    }

    /* Homepage trust in main only — do not restyle frozen footer */
    .ag-dh-main .ag-dh-trust-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .ag-dh-main .ag-dh-trust-item {
        padding: 8px !important;
        min-height: 0 !important;
        font-size: 0.75rem;
    }

    /* Overflow safety — do not clip sticky header dropdowns/drawer */
    .ag-dh-main,
    .ag-dh-page,
    .ag-hp2-page,
    .ag-dh-category-grid,
    .ag-rp-section,
    .ag-dh-shortcuts {
        max-width: 100%;
        overflow-x: clip;
    }

    .ag-dh-product-card,
    .ag-product-card {
        min-width: 0;
        max-width: 100%;
    }

    /* —— Canonical product card: collapse reserved empty slots and flex dead space.
       Do not apply to Flash (.ag-fs-section) — carousel architecture stays frozen. —— */
    .ag-catalog-grid .ag-dh-product-card--fixed,
    .ag-pdp-rail .ag-dh-product-card--fixed,
    .ag-rp-section .ag-dh-product-card--fixed:not(.ag-pc-present-homepage-flash-compact),
    [data-ag-hsd="recently_viewed"] .ag-dh-product-card--fixed,
    [data-ag-hsd="recommended_products"] .ag-dh-product-card--fixed,
    .ag-dh-product-rail-grid .ag-dh-product-card--fixed:not(.ag-pc-present-homepage-flash-compact) {
        height: auto !important;
    }

    .ag-catalog-grid > *,
    .ag-pdp-rail .ag-pc-density__track > *,
    .ag-rp-section .ag-pc-density > *:not(.ag-pc-present-homepage-flash-compact),
    .ag-dh-product-rail-grid > *:has(.ag-dh-product-card--fixed:not(.ag-pc-present-homepage-flash-compact)) {
        height: auto !important;
    }

    .ag-catalog-grid .ag-dh-product-card--fixed .ag-dh-product-body,
    .ag-catalog-grid .ag-dh-product-card--fixed .ag-dh-product-body-main,
    .ag-pdp-rail .ag-dh-product-card--fixed .ag-dh-product-body,
    .ag-pdp-rail .ag-dh-product-card--fixed .ag-dh-product-body-main,
    .ag-rp-section .ag-dh-product-card--fixed:not(.ag-pc-present-homepage-flash-compact) .ag-dh-product-body,
    .ag-rp-section .ag-dh-product-card--fixed:not(.ag-pc-present-homepage-flash-compact) .ag-dh-product-body-main,
    .ag-dh-product-rail-grid .ag-dh-product-card--fixed:not(.ag-pc-present-homepage-flash-compact) .ag-dh-product-body,
    .ag-dh-product-rail-grid .ag-dh-product-card--fixed:not(.ag-pc-present-homepage-flash-compact) .ag-dh-product-body-main {
        flex: 0 1 auto !important;
    }

    .ag-catalog-grid .ag-dh-product-card--fixed .ag-dh-product-footer,
    .ag-pdp-rail .ag-dh-product-card--fixed .ag-dh-product-footer,
    .ag-rp-section .ag-dh-product-card--fixed:not(.ag-pc-present-homepage-flash-compact) .ag-dh-product-footer,
    .ag-dh-product-rail-grid .ag-dh-product-card--fixed:not(.ag-pc-present-homepage-flash-compact) .ag-dh-product-footer {
        margin-top: 0.35rem !important;
        padding-top: 0.35rem !important;
    }

    .ag-catalog-grid .ag-dh-product-card--fixed .ag-dh-product-stock-slot,
    .ag-pdp-rail .ag-dh-product-card--fixed .ag-dh-product-stock-slot,
    .ag-rp-section .ag-dh-product-card--fixed:not(.ag-pc-present-homepage-flash-compact) .ag-dh-product-stock-slot,
    .ag-dh-product-rail-grid .ag-dh-product-card--fixed:not(.ag-pc-present-homepage-flash-compact) .ag-dh-product-stock-slot {
        margin-top: 0.2rem !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
    }

    .ag-dh-product-card--fixed:not(.ag-pc-present-homepage-flash-compact) .ag-dh-rating.is-empty,
    .ag-dh-product-card--fixed:not(.ag-pc-present-homepage-flash-compact) .ag-dh-product-cat.is-empty,
    .ag-dh-product-card--fixed:not(.ag-pc-present-homepage-flash-compact) .ag-dh-product-seller.is-empty,
    .ag-dh-product-card--fixed:not(.ag-pc-present-homepage-flash-compact) .ag-dh-product-shipping.is-empty,
    .ag-dh-product-card--fixed:not(.ag-pc-present-homepage-flash-compact) .ag-dh-product-stock-label.is-empty,
    .ag-dh-product-card--fixed:not(.ag-pc-present-homepage-flash-compact) .ag-dh-price-compare.is-empty,
    .ag-dh-product-card--fixed:not(.ag-pc-present-homepage-flash-compact) .ag-dh-product-stock-slot.is-empty {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    .ag-dh-product-card--fixed:not(.ag-dh-product-card--compact) .ag-dh-product-meta {
        min-height: 0 !important;
    }

    .ag-catalog-grid .ag-dh-product-cat,
    .ag-catalog-grid .ag-dh-product-seller,
    .ag-catalog-grid .ag-dh-product-shipping,
    .ag-pdp-rail .ag-dh-product-cat,
    .ag-pdp-rail .ag-dh-product-seller,
    .ag-pdp-rail .ag-dh-product-shipping,
    .ag-rp-section .ag-dh-product-cat,
    .ag-rp-section .ag-dh-product-seller,
    .ag-rp-section .ag-dh-product-shipping,
    .ag-dh-product-rail-grid .ag-dh-product-cat,
    .ag-dh-product-rail-grid .ag-dh-product-seller {
        display: none !important;
    }

    .ag-catalog-grid .ag-dh-product-stock-label.is-in,
    .ag-pdp-rail .ag-dh-product-stock-label.is-in,
    .ag-rp-section .ag-dh-product-stock-label.is-in,
    .ag-dh-product-rail-grid .ag-dh-product-stock-label.is-in {
        display: none !important;
    }

    .ag-catalog-grid .ag-dh-product-card--fixed .ag-dh-product-title,
    .ag-pdp-rail .ag-dh-product-card--fixed .ag-dh-product-title,
    .ag-rp-section .ag-dh-product-card--fixed .ag-dh-product-title,
    .ag-dh-product-rail-grid .ag-dh-product-card--fixed .ag-dh-product-title {
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 2 !important;
        line-clamp: 2;
        height: auto !important;
        min-height: 0 !important;
        max-height: 2.6em !important;
        white-space: normal !important;
        overflow: hidden !important;
        line-height: 1.3 !important;
    }

    .ag-dh-product-card--fixed .ag-dh-rating:not(.is-empty) {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin-block: 0.1rem;
    }

    .ag-dh-cart-btn[disabled],
    .ag-dh-cart-btn[aria-disabled="true"] {
        opacity: 0.55;
        cursor: not-allowed;
        pointer-events: none;
    }

    a.ag-dh-cart-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        text-decoration: none;
        box-sizing: border-box;
    }
}

/* 360px-safe search/header tightening */
@media (max-width: 359.98px) {
    .ag-dh-search.ag-hs-v1 input[type="search"],
    form.ag-dh-search.ag-hs-v1[data-ag-header-search-v1] input[type="search"] {
        font-size: 0.75rem !important;
    }

    .ag-dh-logo-img,
    .ag-dh-logo-picture {
        max-width: 84px !important;
    }
}

/* Narrow accessibility fallback (<320px): 2 category columns to keep labels readable.
   Standard mobile 360–430px stays 4 columns. */
@media (max-width: 319.98px) {
    .ag-dh-category-grid,
    .ag-dh-essentials-v1__grid,
    .ag-dh-essentials-v1__grid > [data-hp-page],
    .ag-categories-widget .row,
    html.ag-ql-design-on .ag-dh-shortcuts,
    .ag-dh-shortcuts-carousel [data-rp-track] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* RTL: logical properties only — do not mirror brand/media assets */
[dir="rtl"] .ag-dh-search.ag-hs-v1 input[type="search"] {
    text-align: start;
}

@media (max-width: 991.98px) {
    [dir="rtl"] .ag-dh-topbar--utility .ag-dh-topbar-end {
        margin-inline-end: 0;
        margin-inline-start: auto;
    }
}

/* Desktop regression: this overlay must not change >=992 layout */
@media (min-width: 992px) {
    .ag-mobile-storefront-visual-foundation-v1-desktop-noop {
        display: none;
    }
}

/* Variant-required listing CTA reuses cart-button chrome as a PDP link (all breakpoints). */
a.ag-dh-cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-decoration: none;
    box-sizing: border-box;
}

/* Recommended/deals may show a trusted rating row; Flash remains rating-hidden. */
.ag-pc-present-homepage-recommended-compact .ag-dh-rating:not(.is-empty),
.ag-pc-present-homepage-deals-grid .ag-dh-rating:not(.is-empty) {
    display: flex !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}
