/* Polski Smak — header mega-search with popular products. */

.ps-mega-search,
.ps-mega-search *,
.ps-mega-search *::before,
.ps-mega-search *::after {
    box-sizing: border-box;
}

.ps-mega-search {
    --ps-red: #e31e24;
    --ps-red-dark: #c7181d;
    --ps-wine: #a70d12;
    --ps-wine-dark: #7d080d;
    --ps-cream: #fff8ec;
    --ps-page-cream: #f8edd8;
    --ps-border: #ead6c3;
    --ps-text: #2f241f;
    --ps-muted: #766b64;
    --ps-mega-top: 92px;
    position: fixed;
    inset: 0;
    z-index: 100100;
}

.ps-mega-search[hidden] {
    display: none !important;
}

.ps-mega-search__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(35, 24, 19, .06);
}

.ps-mega-search__panel {
    position: fixed;
    top: var(--ps-mega-top);
    left: 50%;
    width: calc(100vw - 40px);
    max-width: 1440px;
    max-height: calc(100dvh - var(--ps-mega-top) - 14px);
    margin: 0;
    padding: 24px 46px 22px;
    overflow-x: hidden;
    overflow-y: auto;
    transform: translateX(-50%);
    color: var(--ps-text);
    background: #fff;
    border: 1px solid rgba(234, 214, 195, .72);
    border-radius: 18px;
    box-shadow: 0 18px 42px rgba(73, 40, 20, .18);
    overscroll-behavior: contain;
}

.ps-mega-search__close {
    position: absolute;
    z-index: 5;
    top: 7px;
    right: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-height: 34px;
    margin: 0;
    padding: 0 0 2px;
    color: var(--ps-wine);
    background: var(--ps-cream);
    border: 1px solid rgba(167, 13, 18, .22);
    border-radius: 50%;
    box-shadow: none;
    font: 700 24px/1 Arial, Helvetica, sans-serif;
    cursor: pointer;
}

.ps-mega-search__close:hover,
.ps-mega-search__close:focus-visible {
    color: var(--ps-wine-dark);
    background: #fff;
}

/* The shop code's final authoritative radius: 10px field, 8px button. */
.ps-mega-search__form {
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: minmax(155px, 220px) minmax(0, 1fr) auto;
    width: 100%;
    min-height: 58px;
    margin: 0 0 22px;
    overflow: visible;
    background: #fff;
    border: 1px solid #dedede;
    border-radius: 10px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.ps-mega-search__form:focus-within {
    border-color: var(--ps-red);
    box-shadow: 0 0 0 3px rgba(227, 30, 36, .08);
}

.ps-mega-search__select-wrap {
    position: relative;
    min-width: 0;
    border-right: 1px solid #dedede;
}

.ps-mega-search__select-wrap::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 18px;
    width: 8px;
    height: 8px;
    border-right: 2px solid #353535;
    border-bottom: 2px solid #353535;
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

.ps-mega-search__select,
.ps-mega-search__field {
    width: 100%;
    height: 56px;
    min-height: 56px;
    margin: 0 !important;
    padding: 0 20px !important;
    color: #222 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    outline: 0 !important;
    font: 400 16px/1.2 Arial, Helvetica, sans-serif !important;
}

.ps-mega-search__select {
    padding-right: 42px !important;
    appearance: none;
    cursor: pointer;
}

.ps-mega-search__field::placeholder {
    color: #999;
    opacity: 1;
}

.ps-mega-search__submit {
    align-self: center;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 50px;
    min-height: 50px;
    margin: 3px !important;
    padding: 0 24px !important;
    color: #fff !important;
    background: var(--ps-red) !important;
    border: 0 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    font: 700 16px/1 Arial, Helvetica, sans-serif !important;
    text-transform: none !important;
    cursor: pointer;
}

.ps-mega-search__submit:hover,
.ps-mega-search__submit:focus-visible {
    background: var(--ps-red-dark) !important;
}

.ps-mega-search__submit svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.ps-mega-search__form > .live-search-results {
    position: absolute;
    z-index: 20;
    top: calc(100% + 5px);
    right: 0;
    left: 0;
    width: 100%;
}

.ps-mega-search__form > .live-search-results .autocomplete-suggestions {
    width: 100% !important;
    max-height: min(420px, 55vh) !important;
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dedede;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .16);
}

.ps-mega-search__heading-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 12px;
}

.ps-mega-search__heading-row h2 {
    margin: 0 !important;
    color: var(--ps-text);
    font: 900 20px/1.1 Arial, Helvetica, sans-serif;
    text-transform: none;
}

.ps-mega-search__heading-row a {
    color: var(--ps-wine);
    font: 800 13px/1 Arial, Helvetica, sans-serif;
    letter-spacing: .025em;
    text-decoration: none;
    text-transform: uppercase;
}

.ps-mega-search__strip {
    position: relative;
    width: 100%;
}

.ps-mega-search__strip::before,
.ps-mega-search__strip::after {
    content: "";
    position: absolute;
    top: 0;
    z-index: 3;
    width: 24px;
    height: calc(100% - 16px);
    pointer-events: none;
}

.ps-mega-search__strip::before {
    left: -1px;
    background: linear-gradient(to left, rgba(255, 255, 255, 0), rgba(255, 255, 255, .84) 90%);
}

.ps-mega-search__strip::after {
    right: -1px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, .84) 90%);
}

.ps-mega-search__scroller {
    width: 100%;
    padding: 0 0 16px;
    overflow-x: auto;
    overflow-y: hidden;
    background: #fff;
    scrollbar-color: var(--ps-wine) var(--ps-border);
    scrollbar-width: thin;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

.ps-mega-search__scroller::-webkit-scrollbar {
    display: block;
    height: 8px;
}

.ps-mega-search__scroller::-webkit-scrollbar-track {
    background: var(--ps-border);
    border-radius: 999px;
}

.ps-mega-search__scroller::-webkit-scrollbar-thumb {
    background: var(--ps-wine);
    border: 1px solid var(--ps-border);
    border-radius: 999px;
}

.ps-mega-search__scroller::-webkit-scrollbar-thumb:hover {
    background: var(--ps-wine-dark);
}

.ps-mega-search__grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max(205px, calc(20% - clamp(9.6px, 1.12vw, 17.6px)));
    gap: clamp(12px, 1.4vw, 22px);
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Product cards mirror the final mobile Shop card: 10px corners,
   square image, uppercase category, Georgia title, price and full red action. */
.ps-mega-search__product {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    color: var(--ps-text);
    background: var(--ps-cream);
    border: 1px solid var(--ps-border);
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(80, 20, 0, .10);
    scroll-snap-align: start;
    transition: top .22s ease, box-shadow .22s ease;
}

.ps-mega-search__product:hover {
    top: -3px;
    box-shadow: 0 13px 24px rgba(80, 20, 0, .15);
}

.ps-mega-search__image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 10px;
    overflow: hidden;
    background: #f3f3f1;
    border-radius: 10px 10px 0 0;
}

.ps-mega-search__product-image {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: contain;
    object-position: center;
}

.ps-mega-search__product-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 152px;
    padding: 8px 9px 9px;
    text-align: center;
    background: var(--ps-cream);
    border-radius: 0 0 10px 10px;
}

.ps-mega-search__category {
    margin: 0 0 3px;
    overflow: hidden;
    color: var(--ps-muted);
    font: 700 13px/1.1 Arial, Helvetica, sans-serif;
    letter-spacing: .035em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.ps-mega-search__product-title {
    display: -webkit-box;
    min-height: calc(2.36em + 2px);
    max-height: calc(2.36em + 2px);
    margin: 0 !important;
    padding: 0 0 2px;
    overflow: hidden;
    color: #241b17;
    font: 400 16px/1.18 Georgia, "Times New Roman", serif;
    text-transform: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.ps-mega-search__product-title a {
    color: inherit;
    text-decoration: none;
}

.ps-mega-search__price {
    min-height: 25px;
    margin: auto 0 5px;
    color: #241b17;
    font: 700 20px/1.15 Arial, Helvetica, sans-serif;
}

.ps-mega-search__price del {
    margin-right: 3px;
    color: #8a817c;
    font-size: .78em;
}

.ps-mega-search__price ins {
    color: var(--ps-red-dark);
    text-decoration: none;
}

.ps-mega-search__add.button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 38px;
    min-height: 38px;
    margin: 0 !important;
    padding: 0 9px !important;
    color: #fff !important;
    background: var(--ps-red) !important;
    border: 0 !important;
    border-radius: 8px !important;
    box-shadow: inset 0 -12px 0 rgba(199, 24, 29, .22) !important;
    font: 800 13px/1 Arial, Helvetica, sans-serif !important;
    letter-spacing: 0 !important;
    text-transform: uppercase !important;
}

.ps-mega-search__add.button:hover,
.ps-mega-search__add.button:focus-visible {
    background: var(--ps-red-dark) !important;
}

/* Exact Our Collection chevron treatment. */
.ps-mega-search__arrow {
    position: absolute !important;
    top: 50% !important;
    z-index: 6 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    margin: 0 !important;
    padding: 0 0 2px !important;
    color: var(--ps-wine) !important;
    background: var(--ps-cream) !important;
    border: 1px solid rgba(167, 13, 18, .22) !important;
    border-radius: 50% !important;
    box-shadow: 0 10px 22px rgba(73, 40, 20, .12) !important;
    transform: translateY(-50%) !important;
    appearance: none !important;
    font: 700 24px/1 Arial, Helvetica, sans-serif !important;
    cursor: pointer !important;
    touch-action: manipulation;
    transition: color .2s ease, background .2s ease, opacity .2s ease, transform .2s ease !important;
}

.ps-mega-search__arrow.left { left: -17px !important; }
.ps-mega-search__arrow.right { right: -17px !important; }

.ps-mega-search__arrow:hover,
.ps-mega-search__arrow:focus-visible {
    color: var(--ps-wine-dark) !important;
    background: #fff !important;
}

.ps-mega-search__arrow:focus-visible {
    outline: 3px solid var(--ps-wine) !important;
    outline-offset: 3px !important;
}

.ps-mega-search__arrow:active {
    transform: translateY(-50%) scale(.94) !important;
}

.ps-mega-search__arrow:disabled {
    opacity: .38 !important;
    cursor: default !important;
}

body.ps-mega-search-open {
    overflow: hidden;
}

/* Stop Flatsome's old dropdown appearing behind the replacement. */
body.ps-mega-search-enabled .header-search .nav-dropdown,
body.ps-mega-search-enabled .header-search-dropdown .nav-dropdown {
    display: none !important;
}

@media (max-width: 900px) {
    .ps-mega-search__panel {
        width: calc(100vw - 24px);
        padding: 20px 14px 18px;
        border-radius: 15px;
    }

    .ps-mega-search__heading-row {
        padding: 0 2px;
    }

    .ps-mega-search__scroller {
        padding-right: 34px;
        padding-bottom: 8px;
        scrollbar-width: none;
    }

    .ps-mega-search__scroller::-webkit-scrollbar {
        display: none;
    }

    .ps-mega-search__grid {
        display: flex;
        width: max-content;
        gap: 14px;
    }

    .ps-mega-search__product {
        flex: 0 0 215px;
        width: 215px;
        min-width: 215px;
    }

    .ps-mega-search__arrow {
        display: none !important;
    }
}

@media (max-width: 600px) {
    .ps-mega-search__panel {
        padding: 16px 10px 15px;
        border-radius: 12px;
    }

    .ps-mega-search__close {
        top: 5px;
        right: 5px;
    }

    .ps-mega-search__form {
        grid-template-columns: 1fr auto;
        margin-top: 30px;
        margin-bottom: 16px;
    }

    .ps-mega-search__select-wrap {
        display: none;
    }

    .ps-mega-search__field {
        padding-left: 14px !important;
    }

    .ps-mega-search__submit {
        width: 50px;
        padding: 0 !important;
    }

    .ps-mega-search__submit span {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .ps-mega-search__heading-row h2 {
        font-size: 18px;
    }

    .ps-mega-search__scroller {
        padding-right: 50px;
    }

    .ps-mega-search__product {
        flex-basis: 205px;
        width: 205px;
        min-width: 205px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ps-mega-search__scroller {
        scroll-behavior: auto;
    }

    .ps-mega-search__product,
    .ps-mega-search__arrow {
        transition: none !important;
    }
}
