/* filepath: c:\Users\dekhoos\Documents\localSource and Projects\DBot-Landing-Page\Github repo\deltaemealandingpage\styles\site-search-overrides.css */
/* styles/site-search-overrides.css
   Overrides and enhancements for the site search UI.
   Implements:
   - smooth slide-down animation from under the nav
   - no-border search input, font stack, white input text
   - adjusted input padding-top and slightly smaller height
   - thicker faded bottom border for the search panel
   - modern scrollbar for results and main page
   - padding between scrollbar and results boxes
   - smooth/slow scrolling behavior preserved
   - hover transitions for result boxes
   - centers the search icon in the main nav
*/
:root {
    --search-font: 'DeltaSans', Inter, sans-serif, Arial;
    --search-accent: #0076bf;
}

/* Ensure font & stacking context */
.site-search-inner {
    font-family: var(--search-font), sans-serif !important
}

/* Panel open/closed animation: slide from top (completely hidden) into place */
.site-search-panel {
    /* overlay fixed to viewport, sits under nav by top computed in JS */
    position: fixed !important;
    left: 0;
    right: 0;
    width: 100%;
    /* Always dock just below the navbar */
    top: var(--nav-height-desktop); /* desktop/sticky height */
    /* keep previous animation-related props */
    transition: transform .78s cubic-bezier(0.16, 0.84, 0.24, 1), opacity .48s ease, visibility .48s ease;
    will-change: transform, opacity;
    /* start fully above the panel's final position (off-screen) so it slides down into view */
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    /* single-panel background: solid at top, fading to transparent at the bottom */
    background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.08) 35%, rgba(255, 255, 255, 0.00) 100%);
    background-repeat: no-repeat;
    /* Ensure search panel stays below nav dropdowns (12000) and scroll nav (11000) */
    z-index: 10000 !important; /* below nav + dropdowns (set at 11000/12000) */
}

.site-search-panel.open {
    /* Open state: slide into place (slow) */
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Remove the extra heavy bottom border effect: keep only the panel background fade to transparent */
.site-search-panel::after {
    display: none;
    content: none
}

/* Search inner layout tweaks (user requested values kept) */
.site-search-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 35px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-family: var(--search-font), sans-serif
}

/* Search bar: smaller height, more top padding for input, remove border */
.site-search-bar {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
    width: 100%
}

.site-search-input {
    flex: 1 1 auto;
    width: 100%;
    height: 40px; /* a bit smaller */
    line-height: 40px; /* vertically center single-line input text */
    padding: 0 64px 0 42px; /* reduced right padding (submit button removed) */
    border-radius: 12px;
    border: none !important; /* user requested no border */
    background: rgba(255, 255, 255, 0.06) !important; /* subtle translucent */
    color: #ffffff !important; /* final request: white text */
    outline: none !important;
    font-size: 1.02rem;
    font-weight: 600;
    box-sizing: border-box;
    font-family: var(--search-font), sans-serif !important;
    backdrop-filter: blur(4px);
}

.site-search-input::placeholder {
    color: rgba(255, 255, 255, 0.72);
    opacity: 1;
    font-weight: 500
}

.site-search-input:focus {
    background: rgba(255, 255, 255, 0.08)
}

/* Close and submit buttons: compact, right-aligned, close is circular icon */
.site-search-close {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: transparent;
    color: inherit;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 60;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    border-radius: 50%
}

.site-search-close {
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06)
}

.site-search-close:hover {
    background: rgba(255, 255, 255, 0.12)
}

/* Hide textual button content if present and ensure icon sizing */
.site-search-close > span {
    display: none
}

.site-search-close svg {
    width: 18px;
    height: 18px;
    display: block
}

/* Results container: modern scrollbar, padding to avoid overlap */
.site-search-results {
    list-style: none;
    margin: 0;
    padding: 8px 18px 12px 0;
    display: grid;
    grid-template-columns:1fr;
    gap: 12px;
    max-height: 45vh;
    overflow: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain
}

/* Add a little inner padding so scrollbar doesn't hug items */
.site-search-results li {
    padding-right: 6px
}

/* Modern scrollbar look */
.site-search-results::-webkit-scrollbar {
    width: 12px
}

.site-search-results::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 12px;
    margin: 6px 0
}

.site-search-results::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(2, 20, 54, 0.65), rgba(2, 20, 54, 0.35));
    border-radius: 12px;
    border: 3px solid rgba(0, 0, 0, 0);
    background-clip: padding-box
}

.site-search-results::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(2, 20, 54, 0.8), rgba(2, 20, 54, 0.5))
}

/* Firefox modern thumb */
.site-search-results {
    scrollbar-color: rgba(2, 20, 54, 0.45) transparent;
    scrollbar-width: thin
}

/* Result item appearance and hover animations */
.site-search-item {
    background: transparent;
    border: none !important; /* ensure no borders on result boxes */
    border-radius: 12px;
    padding: 14px 16px;
    color: #ffffff;
    text-decoration: none;
    display: block;

    transition: transform 560ms cubic-bezier(.2, .9, .25, 1), box-shadow 560ms cubic-bezier(.2, .9, .25, 1), background-color 360ms ease;
    will-change: transform, box-shadow;
}

.site-search-item:hover {
    transform: translateY(-6px) scale(1.01);

    background: transparent;
}

/* Accessible keyboard focus state */
.site-search-item:focus-visible {
    outline: none;
    transform: translateY(-6px) scale(1.01);
    background: transparent;
}

.site-search-item:active {
    transform: translateY(-1px) scale(0.997)
}

.site-search-title {
    font-weight: 700;
    margin: 0 0 6px;
    font-size: 1rem;
    color: #ffffff
}

.site-search-snippet {
    font-size: .95rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.88)
}

.site-search-snippet mark {
    background: #fffa9c;
    color: inherit;
    padding: 0 .1em;
    border-radius: 3px
}

/* Ensure the nav search icon is vertically centered with nav buttons */
.nav-block .site-search-toggle {
    align-self: center !important;
    margin: 0 !important
}

.nav-block .site-search-toggle svg {
    display: block;
    vertical-align: middle
}

/* Make search button background transparent on desktop */
@media (min-width: 1100px) {
    .site-search-toggle {
        background: transparent !important;
    }

    .site-search-toggle:hover {
        background: transparent !important;
    }

    .site-search-toggle:active {
        background: transparent !important;
    }
}

/* Force transparent search toggle without shadows in all states */
.site-search-toggle,
.site-search-toggle:hover,
.site-search-toggle:active,
.site-search-toggle:focus {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* Increase specificity within navbar contexts */
.nav-block .site-search-toggle,
.nav-block .site-search-toggle:hover,
.nav-block .site-search-toggle:active,
.nav-block .site-search-toggle:focus {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

@media (max-width: 1099px) {
    .nav-block .site-search-toggle,
    .nav-block .site-search-toggle:hover,
    .nav-block .site-search-toggle:active,
    .nav-block .site-search-toggle:focus {
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }
}

/* Remove any background/box-shadow from the wrapper around the search toggle */
.nav-item.site-search-item,
.nav-item.site-search-item:hover,
.nav-block .nav-item.site-search-item,
.nav-block .nav-item.site-search-item:hover,
.nav-block .nav-item.site-search-item:active,
.nav-block .nav-item.site-search-item:focus {
    background: transparent !important;
    box-shadow: none !important;
    filter: none !important;
}

/* Also ensure no shadows on any direct child icons */
.nav-item.site-search-item * {
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Main page scrollbar to match results, and remove unwanted left gutter */
html {
    scrollbar-width: thin;
    scrollbar-color: rgba(2, 20, 54, 0.45) transparent;
}

html::-webkit-scrollbar {
    width: 12px;
    height: 12px
}

html::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 12px
}

html::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(2, 20, 54, 0.65), rgba(2, 20, 54, 0.35));
    border-radius: 12px;
    border: 3px solid rgba(0, 0, 0, 0);
    background-clip: padding-box
}

html::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(2, 20, 54, 0.8), rgba(2, 20, 54, 0.5))
}

/* Prevent page from reserving a permanent left gutter (fix white vertical bar) */
html, body {
    min-height: 100%;
    margin: 0;
    padding: 0
}

/* Remove any global forced two-edge gutter that can cause an empty stripe */
html {
    scrollbar-gutter: auto !important
}

/* Respect reduced motion preference (but keep gentle hover animation per user request) */
@media (prefers-reduced-motion: reduce) {
    /* Keep small transitions so the panel doesn't get stuck and interactions feel responsive */
    .site-search-panel {
        transition: transform .24s ease, opacity .24s ease, visibility .24s ease !important
    }

    .site-search-results {
        scroll-behavior: auto
    }

    /* Re-enable a gentle, slower transition so hover still animates */
    .site-search-item {
        transition: transform 360ms cubic-bezier(.2, .9, .25, 1), box-shadow 360ms cubic-bezier(.2, .9, .25, 1), background-color 240ms ease !important;
    }

    /* Do not suppress hover/focus transforms to ensure visible feedback */
}

/* Mobile tweaks */
@media (max-width: 1099px) {
    /* On mobile/tablet, style the search button to be very close to hamburger menu with transparent background */
    .nav-block .site-search-toggle {
        margin-top: 15px !important;
        margin-right: 1px !important;
        width: 40px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: transparent !important;
        border-radius: 4px !important;
        box-shadow: none !important;
        float: right !important;
        position: relative !important;
        z-index: 10003 !important;
    }

    .nav-block .site-search-toggle:hover {
        background: transparent !important;
    }

    .nav-block .site-search-toggle:active {
        background: transparent !important;
    }

    .nav-block .site-search-toggle svg {
        width: 22px !important;
        height: 22px !important;
    }
}

@media (max-width: 560px) {
    .site-search-input {
        height: 44px;
        line-height: 44px;
        padding: 0 64px 0 42px
    }

    .site-search-close {
        right: 12px;
        width: 32px;
        height: 32px
    }

    .site-search-panel {
        top: var(--nav-height-mobile);
    }
}

/* Safety: if a page defines a different nav height token, prefer it */
@supports (top: var(--nav-height)) {
    .site-search-panel {
        top: var(--nav-height);
    }
}

/* Keyframe animations (robust fallback for slide open/close) */
@keyframes site-search-slide-down {
    from {
        transform: translateY(-100%);
        opacity: 0
    }
    to {
        transform: translateY(0);
        opacity: 1
    }
}

@keyframes site-search-slide-up {
    from {
        transform: translateY(0);
        opacity: 1
    }
    to {
        transform: translateY(-100%);
        opacity: 0
    }
}

/* Utility classes to trigger animations (JS will apply these) */
.site-search-animating {
    animation-duration: .78s;
    animation-timing-function: cubic-bezier(0.16, 0.84, 0.24, 1);
    animation-fill-mode: forwards
}

.site-search-slide-down {
    animation-name: site-search-slide-down
}

.site-search-slide-up {
    animation-name: site-search-slide-up
}
