/* ── 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: #eef1f4;
        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: #c92127;
        border-color: #c92127;
        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(#eef1f4 72%, rgba(238, 241, 244, 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: #1a1f2c;
        border-color: #1a1f2c;
        color: #fff !important;
    }

    .tb-msearch__chips--brands a {
        background: #fff;
        border-color: transparent;
        color: #111827 !important;
        font-weight: 700;
        box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
    }

    .tb-msearch__list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .tb-msearch__card {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 12px;
        border-radius: 18px;
        background: #fff;
        border: 1px solid rgba(16, 24, 40, 0.05);
        box-shadow:
            0 1px 2px rgba(16, 24, 40, 0.04),
            0 8px 20px 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.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
        position: relative;
        overflow: hidden;
    }

    .tb-msearch__card::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, rgba(201, 33, 39, 0.035), transparent 42%);
        pointer-events: none;
    }

    .tb-msearch__card:active {
        transform: scale(0.985);
        box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
    }

    .tb-msearch__card.is-active {
        border-color: rgba(201, 33, 39, 0.45);
        box-shadow: 0 0 0 3px rgba(201, 33, 39, 0.14), 0 8px 20px rgba(16, 24, 40, 0.06);
    }

    .tb-msearch__media {
        position: relative;
        flex: 0 0 88px;
        width: 88px;
        height: 68px;
        border-radius: 14px;
        background:
            radial-gradient(circle at 30% 20%, #ffffff 0%, transparent 55%),
            linear-gradient(160deg, #f4f6f8 0%, #e8ecf1 100%);
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1;
    }

    .tb-msearch__media.is-empty::after {
        content: "";
        width: 36px;
        height: 22px;
        border-radius: 6px;
        background: linear-gradient(135deg, #d1d5db, #e5e7eb);
        opacity: 0.7;
    }

    .tb-msearch__media img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
        padding: 4px;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
    }

    .tb-msearch__meta {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 3px;
        z-index: 1;
    }

    .tb-msearch__brand {
        display: block;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #9aa3af;
        line-height: 1.2;
    }

    .tb-msearch__title {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.28;
        color: #111827;
        letter-spacing: -0.01em;
    }

    .tb-msearch__title mark {
        background: linear-gradient(180deg, transparent 55%, #fde68a 55%);
        color: inherit;
        padding: 0;
        border-radius: 0;
    }

    .tb-msearch__facts {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
        margin-top: 4px;
    }

    .tb-msearch__price {
        font-size: 13px;
        font-weight: 800;
        color: #c92127;
        letter-spacing: -0.01em;
    }

    .tb-msearch__pills {
        display: inline-flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .tb-msearch__pill {
        display: inline-flex;
        align-items: center;
        padding: 2px 8px;
        border-radius: 999px;
        background: #f3f4f6;
        color: #4b5563;
        font-size: 11px;
        font-weight: 650;
        line-height: 1.4;
    }

    .tb-msearch__badge {
        position: absolute;
        top: 6px;
        left: 6px;
        z-index: 2;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        height: 18px;
        padding: 0 7px;
        border-radius: 999px;
        background: rgba(6, 95, 70, 0.92);
        color: #fff;
        font-size: 9px;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        line-height: 1;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    }

    .tb-msearch__badge--used {
        background: rgba(30, 64, 175, 0.92);
        color: #fff;
    }

    .tb-msearch__go {
        flex: 0 0 32px;
        width: 32px;
        height: 32px;
        border-radius: 999px;
        background: #f3f4f6;
        color: #6b7280;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        z-index: 1;
    }

    .tb-msearch__card:active .tb-msearch__go,
    .tb-msearch__card.is-active .tb-msearch__go {
        background: #c92127;
        color: #fff;
    }

    .tb-msearch__go svg {
        display: block;
    }

    /* legacy aliases kept for any residual markup */
    .tb-msearch__list a:not(.tb-msearch__card) {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        border-radius: 14px;
        background: #fff;
        color: #111827 !important;
        text-decoration: none !important;
    }

    .tb-msearch__thumb { display: none; }
    .tb-msearch__sub { display: none; }
    .tb-msearch__chev { display: none; }
    .tb-msearch__badge-ico { display: none; }

    .tb-msearch__empty {
        padding: 32px 18px;
        text-align: center;
        color: #6b7280;
        font-size: 14px;
        background: #fff;
        border-radius: 18px;
        border: 1px solid rgba(16, 24, 40, 0.05);
        box-shadow: 0 8px 20px rgba(16, 24, 40, 0.04);
    }

    .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: 52px;
        padding: 12px 14px;
        border-radius: 16px;
        background: linear-gradient(180deg, #fff, #f8fafc);
        border: 1px solid rgba(16, 24, 40, 0.08);
        color: #111827 !important;
        font-size: 14px;
        font-weight: 750;
        text-decoration: none !important;
        text-align: center;
        touch-action: manipulation;
        box-shadow: 0 4px 12px rgba(16, 24, 40, 0.04);
    }

    .tb-msearch__seeall a:active { transform: scale(0.985); }

    .tb-msearch__skel {
        height: 92px;
        border-radius: 18px;
        background: linear-gradient(90deg, #e5e9ef 25%, #f7f9fb 37%, #e5e9ef 63%);
        background-size: 400% 100%;
        animation: tb-msearch-skel 1.2s ease infinite;
        margin-bottom: 10px;
        box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.03);
    }

    @keyframes tb-msearch-skel {
        0% { background-position: 100% 0; }
        100% { background-position: 0 0; }
    }
}
