:root {
    --apps-navy: #082e60;
    --apps-indigo: #263777;
    --apps-ink: #071f47;
    --apps-muted: #6b7890;
    --apps-line: #e5eaf2;
    --apps-white: #fff;
}

.apps-search, .apps-search * { box-sizing: border-box; }
.apps-search { display: inline-flex; font-family: inherit; line-height: 1.4; }
.apps-search__trigger {
    width: 48px; height: 48px; display: inline-grid; place-items: center; padding: 0;
    color: var(--apps-white); background: var(--apps-indigo); border: 0; border-radius: 50%;
    cursor: pointer; box-shadow: 0 10px 26px rgba(38, 55, 119, .24); transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.apps-search__trigger:hover { transform: translateY(-2px); background: var(--apps-navy); box-shadow: 0 14px 32px rgba(8, 46, 96, .3); }
.apps-search__trigger:focus-visible, .apps-search__close:focus-visible, .apps-search__input:focus-visible { outline: 3px solid rgba(38, 55, 119, .25); outline-offset: 3px; }
.apps-search svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
body.apps-search-open { overflow: hidden; }

.apps-search__overlay { position: fixed; inset: 0; z-index: 999999; visibility: hidden; opacity: 0; transition: opacity .28s ease, visibility .28s ease; }
.apps-search__overlay.is-open { visibility: visible; opacity: 1; }
.apps-search__backdrop { position: absolute; inset: 0; background: rgba(2, 17, 42, .66); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.apps-search__panel {
    position: relative; width: min(920px, calc(100% - 40px)); max-height: calc(100vh - 64px); overflow-y: auto;
    margin: 32px auto; padding: clamp(28px, 5vw, 56px); background: rgba(255, 255, 255, .98);
    border: 1px solid rgba(255,255,255,.7); border-radius: 26px; box-shadow: 0 30px 90px rgba(0, 18, 51, .28);
    transform: translateY(-18px) scale(.985); transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.apps-search__overlay.is-open .apps-search__panel { transform: translateY(0) scale(1); }
.apps-search__close { position: absolute; top: 22px; right: 22px; width: 42px; height: 42px; padding: 0; border: 1px solid var(--apps-line); border-radius: 50%; background: #f7f9fc; cursor: pointer; }
.apps-search__close span { position: absolute; top: 20px; left: 12px; width: 17px; height: 1.5px; background: var(--apps-navy); transform: rotate(45deg); }
.apps-search__close span:last-child { transform: rotate(-45deg); }
.apps-search__heading { padding-right: 52px; margin-bottom: 28px; }
.apps-search__eyebrow { display: block; margin-bottom: 8px; color: var(--apps-indigo); font-size: 12px; font-weight: 700; letter-spacing: .18em; }
.apps-search__heading h2 { margin: 0; color: var(--apps-ink); font-size: clamp(26px, 4vw, 42px); line-height: 1.12; font-weight: 700; letter-spacing: -.035em; }
.apps-search__form { position: relative; display: flex; align-items: center; }
.apps-search__input {
    width: 100%; height: 66px; padding: 0 106px 0 62px !important; color: var(--apps-ink) !important; background: #f7f9fc !important;
    border: 1px solid var(--apps-line) !important; border-radius: 16px !important; box-shadow: none !important; font: inherit; font-size: 17px !important; transition: border-color .2s, box-shadow .2s, background .2s;
}
.apps-search__input:focus { background: var(--apps-white) !important; border-color: var(--apps-indigo) !important; box-shadow: 0 0 0 4px rgba(38,55,119,.08) !important; outline: none; }
.apps-search__field-icon { position: absolute; left: 22px; z-index: 1; display: flex; color: var(--apps-indigo); pointer-events: none; }
.apps-search__field-icon svg { width: 24px; height: 24px; }
.apps-search__clear { position: absolute; right: 52px; display: none; width: 32px; height: 32px; padding: 0; color: var(--apps-muted); background: transparent; border: 0; font-size: 25px; line-height: 1; cursor: pointer; }
.apps-search__clear.is-visible { display: block; }
.apps-search__loader { position: absolute; right: 20px; display: none; width: 19px; height: 19px; border: 2px solid #d6dce8; border-top-color: var(--apps-indigo); border-radius: 50%; animation: apps-spin .7s linear infinite; }
.apps-search__form.is-loading .apps-search__loader { display: block; }
.apps-search__hint { margin: 10px 3px 22px; color: var(--apps-muted); font-size: 13px; }
.apps-search__results { display: grid; gap: 10px; }
.apps-search__product {
    display: grid; grid-template-columns: 72px minmax(0, 1fr) auto 30px; gap: 17px; align-items: center; padding: 12px;
    color: inherit !important; text-decoration: none !important; border: 1px solid var(--apps-line); border-radius: 16px; background: var(--apps-white);
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.apps-search__product:hover { transform: translateY(-2px); border-color: #cbd4e4; box-shadow: 0 12px 28px rgba(8,46,96,.09); }
.apps-search__product-image { width: 72px; height: 72px; overflow: hidden; display: block; border-radius: 12px; background: #f4f7fb; }
.apps-search__product-image img { width: 100%; height: 100%; object-fit: contain; display: block; }
.apps-search__product-info { min-width: 0; display: block; }
.apps-search__product-info strong { display: block; margin-bottom: 4px; color: var(--apps-ink); font-size: 16px; line-height: 1.3; }
.apps-search__product-info small { display: -webkit-box; overflow: hidden; color: var(--apps-muted); font-size: 13px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.apps-search__price { color: var(--apps-navy); font-weight: 700; white-space: nowrap; }
.apps-search__price del { opacity: .55; font-weight: 400; }
.apps-search__arrow { color: var(--apps-indigo); font-size: 20px; }
.apps-search__empty { padding: 34px 18px; text-align: center; color: var(--apps-muted); border: 1px dashed #d4dbea; border-radius: 16px; background: #fafbfd; }
.apps-search__empty span { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 10px; color: var(--apps-indigo); background: #edf0f9; border-radius: 50%; font-weight: 700; }
.apps-search__empty p { margin: 0; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@keyframes apps-spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
    .apps-search__trigger { width: 44px; height: 44px; }
    .apps-search__trigger svg { width: 23px; height: 23px; }
    .apps-search__panel { width: calc(100% - 20px); max-height: calc(100vh - 20px); margin: 10px auto; padding: 64px 18px 24px; border-radius: 20px; }
    .apps-search__close { top: 15px; right: 15px; }
    .apps-search__heading { padding-right: 0; margin-bottom: 22px; }
    .apps-search__input { height: 58px; padding-left: 52px !important; font-size: 16px !important; }
    .apps-search__field-icon { left: 17px; }
    .apps-search__hint { margin-bottom: 17px; }
    .apps-search__product { grid-template-columns: 60px minmax(0, 1fr) auto; gap: 12px; padding: 10px; }
    .apps-search__product-image { width: 60px; height: 60px; }
    .apps-search__product-info small { display: none; }
    .apps-search__price { grid-column: 2; font-size: 13px; }
    .apps-search__arrow { grid-column: 3; grid-row: 1 / span 2; }
}

@media (prefers-reduced-motion: reduce) {
    .apps-search__overlay, .apps-search__panel, .apps-search__trigger, .apps-search__product { transition: none; }
}

