/* =========================================================
   STORE HEADER SEARCH PANEL (all storefront pages)

   Same look/behaviour as the homepage hero search panel that
   lives in flair-fullscreen-hero.css, but scoped to
   `.store-site-header` so every store page gets the identical
   dropdown instead of the unstyled inline block it fell back to.

   Note: flair-fullscreen-hero.css is only loaded on the home
   page (route store.index), so its rules never reach the other
   pages - keep the two files visually in sync.
   ========================================================= */

.store-site-header .header-search-panel {
    position: fixed;

    /* header main row is 64px + 1px border on non-hero pages */
    top: 68px;
    left: 50%;

    z-index: 120;

    width: min(720px, calc(100vw - 32px));

    color: #111827;

    animation:
        header-search-drop-from-top
        0.34s
        cubic-bezier(0.22, 0.75, 0.25, 1)
        both;
}

@keyframes header-search-drop-from-top {
    from {
        opacity: 0;
        transform: translate(-50%, -72px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.store-site-header .header-search-surface {
    position: relative;

    width: 100%;

    padding: 7px;

    background: rgba(255, 255, 255, 0.985);

    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;

    box-shadow:
        0 22px 60px rgba(15, 23, 42, 0.2),
        0 4px 14px rgba(15, 23, 42, 0.08);
}

.store-site-header .header-search-input-wrap {
    position: relative;

    display: flex;
    align-items: center;

    width: 100%;
    height: 54px;

    background: #f8fafc;

    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.store-site-header .header-search-input-wrap:focus-within {
    background: #fff;

    border-color: #cbd5e1;

    box-shadow:
        0 0 0 3px rgba(15, 23, 42, 0.05);
}

.store-site-header .header-search-leading-icon {
    position: absolute;

    inset-inline-start: 17px;

    color: #64748b;

    pointer-events: none;
}

.store-site-header .header-search-input {
    display: block;

    width: 100%;
    height: 100%;

    padding-inline-start: 50px;
    padding-inline-end: 50px;

    border: 0 !important;
    outline: 0 !important;

    box-shadow: none !important;

    background: transparent !important;

    color: #111827 !important;

    font-size: 15px;
}

.store-site-header .header-search-input::placeholder {
    color: #94a3b8;
}

.store-site-header .header-search-close {
    position: absolute;

    inset-inline-end: 12px;
    top: 50%;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    padding: 0;

    transform: translateY(-50%);

    border: 0;
    border-radius: 6px;

    background: transparent;

    color: #64748b;

    cursor: pointer;
}

.store-site-header .header-search-close:hover {
    background: #eef2f7;
    color: #111827;
}

/* =========================================================
   SEARCH RESULTS
   ========================================================= */

.store-site-header .header-search-results {
    position: absolute;

    top: calc(100% + 9px);
    left: 0;
    right: 0;

    z-index: 130;

    max-height: 430px;

    overflow-y: auto;

    background: #fff;

    border: 1px solid #e5e7eb;
    border-radius: 10px;

    box-shadow:
        0 20px 50px rgba(15, 23, 42, 0.18),
        0 4px 12px rgba(15, 23, 42, 0.07);
}

.store-site-header .header-search-result-item {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 11px 14px;

    border-bottom: 1px solid #f1f5f9;
}

.store-site-header .header-search-result-item:last-child {
    border-bottom: 0;
}

.store-site-header .header-search-result-item:hover {
    background: #f8fafc;
}

.store-site-header .header-search-result-image {
    width: 48px;
    height: 48px;

    flex: 0 0 48px;

    object-fit: cover;

    background: #f1f5f9;

    border-radius: 6px;
}

/* =========================================================
   TABLET
   ========================================================= */

@media (min-width: 768px) and (max-width: 1023px) {

    .store-site-header .header-search-panel {
        top: 68px;

        width: calc(100vw - 24px);
    }

    .store-site-header .header-search-input-wrap {
        height: 50px;
    }

    .store-site-header .header-search-input {
        font-size: 14px;

        padding-inline-start: 44px;
        padding-inline-end: 44px;
    }

    .store-site-header .header-search-leading-icon {
        inset-inline-start: 13px;
    }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .store-site-header .header-search-panel {
        animation: none;

        /* the animation's fill-mode is what centres the panel */
        transform: translateX(-50%);
    }

    .store-site-header .header-search-panel,
    .store-site-header .header-search-surface {
        transition: none;
    }
}
