/* ── Mobile full-screen search (app-like) — desktop unchanged ── */
.tb-msearch { display: none; }

@media (max-width: 767px) {
    body.tb-msearch-open {
        overflow: hidden !important;
        touch-action: none;
        overscroll-behavior: none;
    }

    .tb-msearch {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 100120;
        flex-direction: column;
        background: #f3f4f6;
        transform: translate3d(0, 100%, 0);
        transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
        padding-bottom: env(safe-area-inset-bottom, 0);
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    }

    .tb-msearch.is-open {
        display: flex;
        transform: translate3d(0, 0, 0);
    }

    .tb-msearch__bar {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
        padding: 12px 14px 8px;
        padding-top: max(12px, env(safe-area-inset-top, 0px));
        background: rgba(255, 255, 255, 0.96);
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .tb-msearch__back {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        border: none;
        border-radius: 12px;
        background: #f3f4f6;
        color: #111827;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .tb-msearch__back:active { transform: scale(0.96); }

    .tb-msearch__back svg {
        width: 20px;
        height: 20px;
        display: block;
        pointer-events: none;
    }

    .tb-msearch__field {
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 2px;
        height: 48px;
        padding: 0 6px 0 14px;
        border: 1.5px solid #e5e7eb;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }

    .tb-msearch__field:focus-within {
        border-color: #c92127;
        box-shadow: 0 0 0 3px rgba(201, 33, 39, 0.14);
    }

    .tb-msearch__field.is-listening {
        border-color: #c92127;
        background: #fff8f8;
    }

    .tb-msearch__field.is-requesting {
        border-color: #f59e0b;
        background: #fffbeb;
    }

    .tb-msearch__field.is-voice-error {
        border-color: #ef4444;
    }

    .tb-msearch__input {
        flex: 1;
        min-width: 0;
        height: 46px;
        border: none !important;
        outline: none !important;
        background: transparent !important;
        box-shadow: none !important;
        font-size: 16px !important;
        font-weight: 500;
        color: #111827;
        -webkit-appearance: none;
        appearance: none;
    }

    .tb-msearch__input::-webkit-search-decoration,
    .tb-msearch__input::-webkit-search-cancel-button,
    .tb-msearch__input::-webkit-search-results-button,
    .tb-msearch__input::-webkit-search-results-decoration {
        -webkit-appearance: none !important;
        appearance: none !important;
        display: none !important;
    }

    .tb-msearch__mic,
    .tb-msearch__clear,
    .tb-msearch__lang {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        border: none;
        border-radius: 12px;
        background: transparent;
        color: #6b7280;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        font-size: 12px;
        font-weight: 800;
        letter-spacing: 0.04em;
    }

    .tb-msearch__lang {
        color: #374151;
        background: #f3f4f6;
        width: 40px;
        flex-basis: 40px;
    }

    .tb-msearch__mic svg,
    .tb-msearch__clear svg {
        width: 20px;
        height: 20px;
        display: block;
        pointer-events: none;
    }

    .tb-msearch__mic.is-listening {
        color: #fff;
        background: #c92127;
        animation: tb-msearch-pulse 1.1s ease-in-out infinite;
    }

    .tb-msearch__mic.is-requesting {
        color: #b45309;
        background: #fef3c7;
    }

    .tb-msearch__mic[hidden],
    .tb-msearch__clear[hidden] {
        display: none !important;
    }

    @keyframes tb-msearch-pulse {
        0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(201, 33, 39, 0.35); }
        50% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(201, 33, 39, 0); }
    }

    .tb-msearch__tools {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
        padding: 8px 14px 10px;
        background: rgba(255, 255, 255, 0.96);
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .tb-msearch__filters {
        display: flex;
        gap: 6px;
        flex: 1;
        min-width: 0;
    }

    .tb-msearch__filters button {
        flex: 1;
        min-height: 36px;
        border: 1px solid #e5e7eb;
        border-radius: 999px;
        background: #fff;
        color: #4b5563;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .tb-msearch__filters button.is-active {
        background: #111827;
        border-color: #111827;
        color: #fff;
    }

    .tb-msearch__filters button:active { transform: scale(0.97); }

    .tb-msearch__listen {
        display: none;
        margin: 0;
        padding: 8px 16px 0;
        font-size: 13px;
        font-weight: 600;
        color: #c92127;
    }

    .tb-msearch__listen.is-on { display: block; }

    .tb-msearch__live {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .tb-msearch__body {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px 14px calc(28px + env(safe-area-inset-bottom, 0px));
    }

    .tb-msearch__offline {
        margin: 0 0 12px;
        padding: 10px 12px;
        border-radius: 12px;
        background: #fff7ed;
        border: 1px solid #fed7aa;
        color: #9a3412;
        font-size: 13px;
        font-weight: 600;
    }

    .tb-msearch__group + .tb-msearch__group { margin-top: 18px; }

    .tb-msearch__label-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 10px;
    }

    .tb-msearch__label-row .tb-msearch__label { margin-bottom: 0; }

    .tb-msearch__clear-recent {
        border: none;
        background: transparent;
        color: #c92127;
        font-size: 12px;
        font-weight: 700;
        padding: 6px 8px;
        min-height: 36px;
        cursor: pointer;
        touch-action: manipulation;
    }

    .tb-msearch__label {
        margin: 0 4px 10px;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #9ca3af;
    }

    .tb-msearch__label--sticky {
        position: sticky;
        top: 0;
        z-index: 2;
        background: linear-gradient(#f3f4f6 70%, rgba(243, 244, 246, 0));
        padding: 4px 4px 8px;
        margin-left: 0;
        margin-right: 0;
    }

    .tb-msearch__chips {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .tb-msearch__chips::-webkit-scrollbar { display: none; }

    .tb-msearch__chips a {
        display: inline-flex;
        align-items: center;
        flex: 0 0 auto;
        padding: 10px 14px;
        min-height: 40px;
        border-radius: 999px;
        border: 1px solid #e5e7eb;
        background: #fff;
        color: #1f2937 !important;
        font-size: 13px;
        font-weight: 600;
        text-decoration: none !important;
        line-height: 1.2;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
        touch-action: manipulation;
        cursor: pointer;
    }

    .tb-msearch__chips a:active { transform: scale(0.97); }

    .tb-msearch__chips--cats a {
        background: #111827;
        border-color: #111827;
        color: #fff !important;
    }

    .tb-msearch__chips--brands a {
        background: #fff;
        border-color: #d1d5db;
        color: #111827 !important;
        font-weight: 700;
    }

    .tb-msearch__list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .tb-msearch__list a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        border-radius: 14px;
        background: #fff;
        border: 1px solid #eceff3;
        box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
        color: #111827 !important;
        text-decoration: none !important;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        cursor: pointer;
        transition: transform 0.08s ease, background 0.08s ease;
    }

    .tb-msearch__list a:active {
        background: #f3f4f6;
        transform: scale(0.985);
    }

    .tb-msearch__list a.is-active {
        border-color: #c92127;
        box-shadow: 0 0 0 2px rgba(201, 33, 39, 0.18);
    }

    .tb-msearch__thumb {
        flex: 0 0 56px;
        width: 56px;
        height: 42px;
        border-radius: 10px;
        background: #f3f4f6;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .tb-msearch__thumb.is-empty::after {
        content: "";
        width: 22px;
        height: 14px;
        border-radius: 3px;
        background: #e5e7eb;
    }

    .tb-msearch__thumb img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
    }

    .tb-msearch__meta { flex: 1; min-width: 0; }

    .tb-msearch__title {
        display: block;
        font-size: 15px;
        font-weight: 650;
        line-height: 1.3;
        color: #111827;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tb-msearch__title mark {
        background: #fef3c7;
        color: inherit;
        padding: 0 1px;
        border-radius: 2px;
    }

    .tb-msearch__sub {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin-top: 4px;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: #9ca3af;
    }

    .tb-msearch__facts {
        display: block;
        margin-top: 3px;
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0;
        text-transform: none;
        color: #6b7280;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tb-msearch__badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
        padding: 0;
        border-radius: 6px;
        background: #ecfdf5;
        color: #047857;
        flex: 0 0 auto;
    }

    .tb-msearch__badge--used {
        background: #eff6ff;
        color: #1d4ed8;
    }

    .tb-msearch__badge-ico {
        display: block;
        width: 12px;
        height: 12px;
    }

    .tb-msearch__chev {
        flex: 0 0 16px;
        color: #d1d5db;
        font-size: 18px;
        line-height: 1;
    }

    .tb-msearch__empty {
        padding: 28px 16px;
        text-align: center;
        color: #6b7280;
        font-size: 14px;
        background: #fff;
        border-radius: 16px;
        border: 1px solid #eceff3;
    }

    .tb-msearch__dym {
        margin-top: 12px;
        text-align: center;
        font-size: 14px;
        color: #374151;
        font-weight: 600;
    }

    .tb-msearch__dym-btn {
        border: none;
        background: transparent;
        color: #c92127;
        font: inherit;
        font-weight: 800;
        text-decoration: underline;
        cursor: pointer;
        padding: 4px;
        min-height: 36px;
    }

    .tb-msearch__seeall {
        margin-top: 16px;
    }

    .tb-msearch__seeall a {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 48px;
        padding: 12px 14px;
        border-radius: 14px;
        background: #fff;
        border: 1.5px dashed #d1d5db;
        color: #111827 !important;
        font-size: 14px;
        font-weight: 700;
        text-decoration: none !important;
        text-align: center;
        touch-action: manipulation;
    }

    .tb-msearch__seeall a:active { transform: scale(0.985); }

    .tb-msearch__skel {
        height: 62px;
        border-radius: 14px;
        background: linear-gradient(90deg, #eceff3 25%, #f8fafc 37%, #eceff3 63%);
        background-size: 400% 100%;
        animation: tb-msearch-skel 1.2s ease infinite;
        margin-bottom: 8px;
    }

    @keyframes tb-msearch-skel {
        0% { background-position: 100% 0; }
        100% { background-position: 0 0; }
    }
}
