/* Mobile header controls share the existing Megango typography and colour tokens. */
@media (max-width: 991px) {
    header.header { --megango-mobile-header-edge: 60px; }
    header.header.sticky { --megango-mobile-header-edge: 63px; }
    header.header .header-top { display: none !important; }
    header.header .header-panel-wrapper {
        height: 0;
        min-height: 0;
        padding: 0;
        margin: 0;
    }
    header.header .header-search-container { position: static; }
    header.header .block-search.block {
        position: fixed !important;
        top: var(--megango-mobile-header-edge) !important;
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        height: auto;
        margin: 0;
        padding: 12px 60px 12px 15px;
        border: 0;
        border-bottom: 1px solid var(--megango-border, #e5e5e5);
        background: #fff;
        box-shadow: 0 6px 12px rgb(25 25 25 / 8%);
        z-index: 110;
        box-sizing: border-box;
    }
    header.header #minisearch-form-top-search {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: stretch;
        position: static;
        width: 100%;
        height: auto;
        margin: 0;
    }
    header.header #minisearch-form-top-search .field.search,
    header.header #minisearch-form-top-search .control {
        position: static;
        width: 100%;
        min-width: 0;
        height: auto;
        margin: 0;
        padding: 0;
        border: 0;
    }
    header.header #minisearch-form-top-search .label { display: none; }
    header.header #minisearch-input-top-search {
        position: static;
        left: auto;
        display: block;
        width: 100%;
        min-width: 0;
        height: 44px;
        min-height: 44px;
        margin: 0;
        padding: 10px;
        border: 1px solid var(--megango-border, #e5e5e5);
        border-radius: 5px 0 0 5px;
        box-sizing: border-box;
        font: inherit;
        font-size: 16px;
    }
    header.header #minisearch-form-top-search .actions { display: flex; position: static; }
    header.header #minisearch-form-top-search .action.search {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: static;
        width: auto;
        min-width: 60px;
        height: 44px;
        min-height: 44px;
        margin: 0;
        padding: 10px;
        border: 1px solid var(--megango-orange, #ea5455);
        border-radius: 0 5px 5px 0;
        background: var(--megango-orange, #ea5455);
        color: #fff;
        opacity: 1;
        font: inherit;
        font-size: 13px;
        font-weight: 600;
        line-height: 1.3;
    }
    header.header #minisearch-form-top-search .action.search::before { display: none; }
    header.header #minisearch-form-top-search .action.search > span {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        clip: auto;
        overflow: visible;
    }
    header.header #minisearch-form-top-search .action.search:disabled {
        background: #f3f3f3;
        border-color: var(--megango-border, #e5e5e5);
        color: #666;
        opacity: 1;
    }
    header.header #minisearch-form-top-search .action.search:enabled:is(:hover, :focus-visible) {
        background: var(--megango-near-black, #191919);
        border-color: var(--megango-near-black, #191919);
    }
    header.header .block-search .search-autocomplete {
        top: 100%;
        left: 15px;
        right: 15px;
        width: auto !important;
        max-height: calc(100dvh - 150px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    header.header #mobile-search-close-btn {
        position: fixed;
        top: calc(var(--megango-mobile-header-edge) + 12px);
        right: 8px;
        width: 44px;
        height: 44px;
        border-radius: 5px;
        color: var(--megango-near-black, #191919);
        background: #fff;
        z-index: 112;
    }
    header.header:has(#mobile-search[aria-expanded="true"]) #mobile-search-close-btn { display: block !important; }
    header.header #mobile-search-close-btn::after {
        content: "×";
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: absolute;
        inset: 0 !important;
        width: 44px !important;
        height: 44px !important;
        margin: 0;
        background: none;
        font: 28px/1 sans-serif;
        color: inherit;
    }
    header.header .mobile_header > .close-menu {
        position: fixed;
        z-index: 1000;
        top: 12px;
        right: 8px;
        left: auto;
        width: 44px;
        height: 44px;
    }
    header.header .mobile_header > .close-menu svg { width: 44px; height: 44px; }
    .header-navigation :is(.account-links, .contact-links) a {
        display: flex;
        width: 100%;
        align-items: center;
        min-height: 44px;
    }
    body.side_menu_active .megango-contact-widget,
    body:has(#mobile-search[aria-expanded="true"]) .megango-contact-widget { visibility: hidden; }
}

@media (max-width: 767px) {
    .megango-gifts .gift-banner .gift-banner-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .megango-gifts .gift-banner .gift-banner-actions:has(> a:only-child) { grid-template-columns: 1fr; }
    .megango-gifts .gift-banner .gift-banner-actions a {
        min-width: 0;
        min-height: 44px;
        padding: 8px 6px;
        font-size: 12px;
        line-height: 1.3;
        text-align: center;
        white-space: normal;
    }
    .megango-gifts .gift-budgets .gift-budget { min-height: 44px; }
    .megango-gifts .gift-active-filters a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }
}

@media (min-width: 360px) and (max-width: 399px) {
    .megango-gifts .gift-banner h1 { font-size: 21px; padding-right: 68px; }
    .megango-gifts .gift-banner .gift-banner-products { width: 64px; }
}

@media (max-width: 359px) {
    .megango-gifts .gift-banner h1 { font-size: 20px; padding-right: 58px; }
    .megango-gifts .gift-banner .gift-banner-products { width: 54px; }
}

/* Preserve content header borders for visitors with an older cached base stylesheet. */
.megango-gifts .gift-banner.sticky { border-bottom: 1px solid #f0e4de; }
.megango-gifts :is(.gift-intro, .gift-products-heading).sticky { border-bottom: 0; }
