/* ============================================================
 *  SEARCH OVERLAY — DIM & SHEET
 * ============================================================ */

body.search-overlay-open {
    overflow: hidden !important;
}

.search-overlay-dim {
    position: fixed;
    inset: 0;
    background: rgba(20, 24, 38, 0.45);
    z-index: 998;
}

.search-overlay-sheet {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: #fff;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
    padding: 16px 18px 20px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}

@media (min-width: 1025px) {
    .search-overlay-sheet {
        left: 6%;
        right: 6%;
        top: 12px;
        border-radius: 14px;
        padding: 20px 26px;
    }
}

/* ============================================================
 *  SEARCH INPUT BOX (makieta: .sbox + .close)
 * ============================================================ */

.search-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.search-input-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1.8px solid #ED7A4F;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 15px;
    color: #333;
    background: #fff;
}

    .search-input-box .search-icon {
        color: #999;
        font-size: 15px;
        flex-shrink: 0;
    }

    .search-input-box .ui-textinput {
        flex: 1;
    }

    .search-input-box .search-input {
        flex: 1;
        border: none;
        outline: none;
        font-size: 15px;
        color: #333;
        background: transparent;
        padding: 0;

    }

        .search-input-box .search-input::placeholder {
            color: #999;
        }

    .search-input-box .search-clear {
        margin-left: auto;
        color: #bbb;
        font-size: 13px;
        cursor: pointer;
        flex-shrink: 0;
        white-space: nowrap;
        user-select: none;
    }

        .search-input-box .search-clear:hover {
            color: #888;
        }

.search-close-btn {
    width: 38px;
    height: 38px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: #444;
    cursor: pointer;
    flex: none;
    background: #fff;
    user-select: none;
    transition: opacity 0.15s;
}

    .search-close-btn:hover {
        opacity: 0.7;
    }


/* ============================================================
 *  SEARCH HINT
 * ============================================================ */

.search-hint {
    display: block;
    font-size: 11.5px;
    color: #8a8781;
    margin: 2px 2px 0;
    width: 100%;
}

/* ============================================================
 *  DEPRECATED: old search container & input (keep for non-overlay pages)
 * ============================================================ */

.search-container {
    background-color: #ffffff;
    padding: 2rem 0rem;
    position: absolute;
    max-width: 100%;
    margin-top: 1px;
    z-index: 999;
    min-height: 776px;
}

.search-input-container {
    width: 100%;
    position: relative;
}

/* old standalone input — keep for non-overlay contexts */
.search-input-standalone {
    width: 100%;
    border-radius: 10px;
    border: 1.8px solid #ED7A4F;
    color: black;
    padding: 11px 14px;
    font-size: 15px;
    outline: none;
}

    .search-input-standalone:focus,
    .search-input-standalone:active {
        border-color: #ED7A4F !important;
    }

#header-search .search-input-standalone {
    width: calc(100% - 2rem);
}

/*#header-search {
    width: 100%;
}
*/
.search-input-container .search-loupe {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* ============================================================
 *  PRODUCT CARDS (makieta: .card)
 * ============================================================ */

.search-products-grid {
    display: grid;
    gap: 11px;
    margin-top: 8px;
}

/* Desktop: 5 kolumn */
@media (min-width: 601px) {
    .search-products-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Mobile: 2 kolumny */
@media (max-width: 600px) {
    .search-products-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.search-card {
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: box-shadow 0.15s;
}

    .search-card:hover {
        box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    }

.search-card-img {
    width: 100%;
    aspect-ratio: 1 / 1.08;
    object-fit: cover;
    display: block;
    background: #f4f3f0;
}

.search-card-name {
    font-weight: 700;
    font-size: 12px;
    color: #1a1a1a;
    margin: 6px 8px 1px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-card-rating {
    font-size: 10.5px;
    color: #ED7A4F;
    margin: 0 8px;
    line-height: 1;
}

.search-card-price {
    font-size: 11px;
    color: #555;
    margin: 1px 9px;
    line-height: 1;
}

/* ============================================================
 *  DEPRECATED: old search-result (keep for compatibility)
 * ============================================================ */

.search-products-container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
}

.search-result {
    max-width: calc(20% - 1rem);
    margin: 0 0.49rem;
}

    .search-result .score {
        font-size: 16px;
        line-height: 26px;
        font-family: RoobertR;
        color: #000;
    }

    .search-result img {
        max-width: 100%;
    }

.search-products-container a span:not(.customizable) {
    font-size: 16px !important;
    line-height: 20px !important;
}

.search-top-results, .store-suggestion {
    font-size: 14px;
    display: block;
    width: calc(100% - 1rem);
    text-align: center;
    background-color: #FDE3DA;
    border-radius: 5px;
    border: 1px solid #facbbb;
    text-align: left;
    padding: 0.5rem;
}

#results-phrase {
    color: #F77147;
    font-weight: 600;
}
/* ============================================================
 *  DID YOU MEAN BOX
 * ============================================================ */
.search-dym {
    background: #fdf3ee;
    border: 1px solid #f4d5c6;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    color: #333;
    margin: 10px 0 2px;
}

    .search-dym b {
        color: #c2410c;
    }

/* ============================================================
 *  ZERO RESULT INFO
 * ============================================================ */

.search-zero-result-info {
    font-size: 13.5px;
    color: #333;
    margin: 12px 0 0;
}

/* ============================================================
 *  CS SECTION (Help/FAQ links)
 * ============================================================ */

.search-cs-section {
    background: #f5f7fa;
    border: 1px solid #e0e4e9;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 13px;
}

    .search-cs-section p {
        margin: 0 0 6px !important;
        font-weight: 600;
        color: #1a1a1a;
    }

    .search-cs-section ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .search-cs-section li {
        margin-bottom: 4px;
    }

    .search-cs-section a {
        color: #ED7A4F;
        text-decoration: none;
        font-weight: 500;
    }

/* ============================================================
 *  CHIPS SECTION
 * ============================================================ */

.search-chips-section h2,
.search-bestsellers-section h2,
.search-section-title {
    font-size: 14px;
    margin: 14px 0 8px;
    color: #1a1a1a;
}

    .search-chips-section h2 small,
    .search-bestsellers-section h2 small {
        color: #888;
        font-weight: 400;
    }

.search-chips-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.search-chip,
.search-chip-ghost {
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-style: none;
    transition: opacity 0.15s;
}

.search-chip {
    background: #ED7A4F;
    color: #fff;
    border: 1.5px solid #ED7A4F;
}

.search-chip-ghost {
    background: #fff;
    color: #ED7A4F;
    border: 1.5px solid #ED7A4F;
}

    .search-chip:hover,
    .search-chip-ghost:hover {
        opacity: 0.85;
    }

/* ============================================================
 *  BESTSELLERS GRID (zero-result fallback)
 * ============================================================ */

.search-bestsellers-grid {
    display: grid;
    gap: 11px;
    margin-top: 8px;
}

/* Desktop: 5 kolumn */
@media (min-width: 601px) {
    .search-bestsellers-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Mobile: 2 kolumny */
@media (max-width: 600px) {
    .search-bestsellers-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================================
 *  CONTACT LINK
 * ============================================================ */

.search-contact-link {
    font-size: 11.5px;
    color: #8a8781;
    margin: 12px 0 0;
    text-align: left;
    display: block;
    width: 100%;
}

    .search-contact-link a {
        color: #ED7A4F;
        font-weight: 600;
        text-decoration: none;
    }

/* ============================================================
 *  SORRY FALLBACK (deprecated, kept for compatibility)
 * ============================================================ */

.search-sorry {
    width: 100%;
    text-align: center;
}

    .search-sorry span {
        font-size: 14px;
        letter-spacing: 0.8px;
        line-height: 14px;
        display: block;
    }

.search-suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.95rem;
}

.search-suggestion {
    padding: 6px 14px;
    border-radius: 10px;
    background-color: #F77147;
    color: #fff;
    max-height: 48px;
    border-style: none !important;
    font-size: 14px;
    margin: 0 0.25rem;
    cursor: pointer;
}

.search-chips-section {
    width: 100%;
}

.search-card-details-c {
    padding-bottom: 0.5rem;
}
/* ============================================================
 *  RESPONSIVE
 * ============================================================ */
@media (max-width: 600px) {
    .search-suggestion {
        margin-top: 0.2rem;
        margin-bottom: 0.2rem;
    }

    .search-result {
        max-width: calc(50% - 1rem);
        margin: 0 0.49rem;
    }

        .search-result:nth-child(n+3) {
            margin-top: 0.5rem;
        }

        .search-result:nth-child(n+5) {
            display: none;
        }

    .search-container:not(.onpage) {
        padding: 0rem 0rem 1rem 0;
        height: calc(100vh - 121px);
        overflow: scroll !important;
    }

    .search-input-container {
        display: flex;
    }

    .search-input-standalone {
        width: unset !important;
        flex: 1;
    }

    .search-sorry {
        text-align: left !important;
    }

    @supports (-webkit-overflow-scrolling: touch) {
        .search-container:not(.onpage) {
            height: calc(100vh - 200px) !important;
            max-height: -webkit-fill-available;
        }
    }

    #header-search .search-bestsellers-grid {
        display: flex;
        width: 100%;
        overflow-x: auto;
        padding: 0.35rem 0;
    }

        #header-search .search-bestsellers-grid .search-card {
            min-width: 42%;
        }

    #header-search .show-more-widget {
        margin-top: 0.5rem !important;
    }
}

.search-page .search-products-c {
    margin-top: 1rem;
}

.search-top-results .results-phrase {
    font-weight: 600;
    color: #F77147;
}

.store-suggestion button {
    display: inline;
    margin-left: 0.5rem;
    padding: 5px 10px;
    font-size: 14px;
}

.store-suggestion {
    width: 100%;
    margin-right: auto;
    margin-bottom: 2px;
}
