/* Live AJAX search — storefront */
.ls-form {
    position: relative;
    z-index: 40;
    min-width: 0;
    max-width: 100%;
}

.ls-form.is-open {
    z-index: 80;
}

.ls-panel {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 10px);
    z-index: 90;
    background: #fff;
    border: 1px solid #e8edf1;
    border-radius: 18px;
    box-shadow:
        0 4px 8px rgba(25, 35, 45, .04),
        0 18px 48px rgba(25, 35, 45, .14);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(.985);
    transform-origin: top center;
    transition: opacity .18s cubic-bezier(.2, .8, .2, 1), transform .18s cubic-bezier(.2, .8, .2, 1), visibility .18s;
    pointer-events: none;
    max-height: min(70vh, 520px);
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.ls-form.is-open .ls-panel,
.ls-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ls-panel[data-placement="header"] {
    top: calc(100% + 8px);
    border-radius: 16px;
}

.ls-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10040;
    background: rgba(18, 24, 32, .45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: .18s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.ls-backdrop.is-show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

html.ls-sheet-open {
    overflow: hidden;
}

html.ls-sheet-open .rt-cta-trio,
html.ls-sheet-open .rt-catboxes,
html.ls-sheet-open .rt-block {
    pointer-events: none;
}

.ls-panel.is-fixed {
    position: fixed !important;
    inset-inline: auto;
    z-index: 10050 !important;
    width: auto;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none;
    border-radius: 16px;
}

.ls-panel.is-fixed.is-sheet {
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 40px rgba(18, 24, 32, .2);
    animation: ls-sheet-up .22s cubic-bezier(.2, .8, .2, 1);
}

.ls-panel.is-fixed.is-sheet::before {
    content: "";
    display: block;
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: #d7dde3;
    margin: .55rem auto .15rem;
    flex: 0 0 auto;
}

@keyframes ls-sheet-up {
    from { transform: translateY(18px); opacity: .6; }
    to { transform: translateY(0); opacity: 1; }
}

.ls-scroll {
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    max-height: inherit;
    flex: 1 1 auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: #c9d4c0 transparent;
}

.ls-panel.is-fixed .ls-scroll {
    max-height: 100%;
}

.ls-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1rem .55rem;
    border-bottom: 1px solid #f0f3f6;
    position: sticky;
    top: 0;
    background: linear-gradient(#fff, #fff 70%, rgba(255, 255, 255, .92));
    z-index: 2;
}

.ls-head strong {
    font-size: .82rem;
    font-weight: 800;
    color: #2b2f33;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ls-head span {
    font-size: .75rem;
    color: #8a9198;
    font-weight: 600;
    flex: 0 0 auto;
}

.ls-section {
    padding: .55rem .65rem .75rem;
}

.ls-section + .ls-section {
    border-top: 1px solid #f0f3f6;
}

.ls-label {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .45rem .55rem;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .02em;
    color: #8a9198;
}

.ls-label svg {
    width: 14px;
    height: 14px;
    opacity: .7;
    flex: 0 0 auto;
}

.ls-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding: 0 .35rem .2rem;
}

.ls-chip {
    appearance: none;
    border: 1px solid #e7ecef;
    background: #f7f9fa;
    color: #3a4148;
    border-radius: 999px;
    padding: .38rem .75rem;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: .15s ease;
    max-width: 100%;
}

.ls-chip:hover,
.ls-chip.is-active {
    background: #eef8e6;
    border-color: #d4ebc0;
    color: #2f6512;
}

.ls-item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: center;
    width: 100%;
    padding: .55rem;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: inherit;
    text-align: right;
    cursor: pointer;
    text-decoration: none;
    transition: background .12s ease;
    box-sizing: border-box;
}

.ls-item:hover,
.ls-item.is-active {
    background: #f4faf0;
}

.ls-item.is-active {
    outline: 1px solid #d7ebc4;
}

.ls-thumb {
    width: 56px;
    height: 42px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #eef8e6, #f3f5f7);
    border: 1px solid #e8edf1;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.ls-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ls-thumb-fallback {
    width: 22px;
    height: 22px;
    color: #8ed557;
    opacity: .85;
}

.ls-meta {
    min-width: 0;
}

.ls-title {
    display: block;
    font-size: .9rem;
    font-weight: 800;
    color: #222;
    line-height: 1.45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ls-title mark {
    background: linear-gradient(transparent 60%, rgba(142, 213, 87, .45) 60%);
    color: inherit;
    font-weight: 800;
    padding: 0;
}

.ls-sub {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .55rem;
    margin-top: .15rem;
    font-size: .74rem;
    color: #8a9198;
    font-weight: 600;
}

.ls-badge {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    padding: .1rem .4rem;
    border-radius: 6px;
    background: #f0f3f6;
    color: #5c646c;
    font-size: .68rem;
    font-weight: 800;
}

.ls-badge.sale {
    background: #fff3e0;
    color: #c45f00;
}

.ls-badge.feat {
    background: #eef8e6;
    color: #2f6512;
}

.ls-price {
    text-align: left;
    white-space: nowrap;
    padding-inline-start: .25rem;
}

.ls-price strong {
    display: block;
    font-size: .86rem;
    font-weight: 800;
    color: #2f6512;
    direction: ltr;
}

.ls-price s {
    display: block;
    font-size: .72rem;
    color: #a0a7ae;
    font-weight: 600;
    direction: ltr;
}

.ls-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    width: 100%;
    padding: .65rem .7rem;
    border-radius: 12px;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background .12s ease;
    box-sizing: border-box;
}

.ls-cat-item:hover,
.ls-cat-item.is-active {
    background: #f7f9fa;
}

.ls-cat-item .name {
    font-size: .88rem;
    font-weight: 800;
    color: #2b2f33;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ls-cat-item .count {
    font-size: .75rem;
    font-weight: 700;
    color: #8a9198;
    background: #f0f3f6;
    padding: .2rem .5rem;
    border-radius: 999px;
    flex: 0 0 auto;
}

.ls-empty,
.ls-loading {
    padding: 1.4rem 1rem;
    text-align: center;
    color: #8a9198;
}

.ls-empty strong {
    display: block;
    color: #2b2f33;
    font-size: .95rem;
    margin-bottom: .25rem;
}

.ls-skel {
    display: grid;
    gap: .55rem;
    padding: .65rem;
}

.ls-skel-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 70px;
    gap: .75rem;
    align-items: center;
}

.ls-skel-row > span {
    display: block;
    height: 12px;
    border-radius: 8px;
    background: linear-gradient(90deg, #f0f3f6 25%, #f8fafb 50%, #f0f3f6 75%);
    background-size: 200% 100%;
    animation: ls-shimmer 1.1s ease infinite;
}

.ls-skel-row > span:first-child {
    height: 42px;
    border-radius: 10px;
}

.ls-skel-row > span:last-child {
    height: 14px;
}

@keyframes ls-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.ls-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem 1rem;
    border-top: 1px solid #f0f3f6;
    background: #fbfcfd;
    position: sticky;
    bottom: 0;
}

.ls-foot a {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .86rem;
    font-weight: 800;
    color: #2f6512;
    min-width: 0;
}

.ls-foot a:hover { color: #24500e; }

.ls-foot kbd {
    font-family: inherit;
    font-size: .68rem;
    font-weight: 700;
    color: #9aa3ab;
    background: #fff;
    border: 1px solid #e7ecef;
    border-radius: 6px;
    padding: .15rem .4rem;
}

.ls-hint {
    display: none;
    gap: .35rem;
    align-items: center;
    color: #a0a7ae;
    font-size: .72rem;
    font-weight: 600;
    flex: 0 0 auto;
}

@media (min-width: 901px) {
    .ls-hint { display: inline-flex; }
    .ls-backdrop { display: none !important; }
}

/* Hero search */
.rt-search.ls-form {
    overflow: visible;
    width: 100%;
}

.rt-search.ls-form .ls-panel {
    inset-inline: 0;
}

/* Header search */
.rh-search.ls-form {
    position: relative;
}

.rh-drawer-body .rh-search.ls-form {
    z-index: 5;
    overflow: visible;
}

.rh-drawer-body .rh-search.ls-form.is-open {
    z-index: 40;
}

.rh-drawer-body .rh-search.ls-form .ls-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    max-height: min(55vh, 420px);
    z-index: 30;
}

.ls-sheet-search {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .75rem .9rem .55rem;
    border-bottom: 1px solid #f0f3f6;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 3;
    flex: 0 0 auto;
}

.ls-sheet-search svg {
    flex: 0 0 auto;
    color: #9aa3ab;
}

.ls-sheet-input {
    flex: 1;
    min-width: 0;
    border: 0 !important;
    outline: 0;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: .45rem 0 !important;
    font-size: .95rem;
    color: #2b2f33;
}

@media (max-width: 1100px) {
    .ls-panel {
        border-radius: 16px;
        max-height: min(68vh, 480px);
    }
}

@media (max-width: 900px) {
    .ls-panel:not(.is-fixed) {
        max-height: min(58vh, 420px);
    }

    .ls-item {
        grid-template-columns: 48px minmax(0, 1fr) auto;
        gap: .55rem;
        padding: .5rem;
        border-radius: 12px;
    }

    .ls-thumb {
        width: 48px;
        height: 38px;
        border-radius: 9px;
    }

    .ls-title { font-size: .86rem; }
    .ls-price strong { font-size: .8rem; }
    .ls-section { padding: .45rem .5rem .65rem; }
    .ls-head { padding: .7rem .85rem .45rem; }
    .ls-foot { padding: .7rem .85rem; flex-wrap: wrap; }
    .ls-hint { display: none !important; }

    .ls-skel-row {
        grid-template-columns: 48px minmax(0, 1fr) 56px;
    }
}

@media (max-width: 640px) {
    .ls-item {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: .55rem;
    }

    .ls-price {
        grid-column: 2;
        text-align: right;
        padding: 0;
        margin-top: -.1rem;
    }

    .ls-price strong { font-size: .78rem; }
    .ls-price s { font-size: .68rem; }

    .ls-thumb {
        width: 44px;
        height: 36px;
    }

    .ls-title {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.4;
    }

    .ls-chip {
        padding: .34rem .65rem;
        font-size: .76rem;
    }

    .ls-cat-item {
        padding: .55rem .5rem;
        gap: .5rem;
    }

    .ls-cat-item .count {
        font-size: .7rem;
        padding: .15rem .4rem;
    }

    .ls-skel-row {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .ls-skel-row > span:last-child { display: none; }
}

@media (max-width: 420px) {
    .ls-panel.is-fixed {
        border-radius: 14px;
    }

    .ls-foot a { font-size: .82rem; }
    .ls-sub { gap: .25rem .4rem; }
    .ls-badge { font-size: .64rem; }
}
