﻿/* ── 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: 10080;
        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 10px;
        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 40px;
        width: 40px;
        height: 40px;
        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;
    }

    .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__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 {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        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;
    }

    .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[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__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__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__status {
        margin: 8px 4px 12px;
        font-size: 13px;
        color: #6b7280;
    }

    .tb-msearch__group + .tb-msearch__group { margin-top: 18px; }

    .tb-msearch__label {
        margin: 0 4px 10px;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #9ca3af;
    }

    .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);
    }

    .tb-msearch__chips--cats a {
        background: #111827;
        border-color: #111827;
        color: #fff !important;
    }

    .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;
    }

    .tb-msearch__list a:active { background: #f9fafb; }

    .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 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__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__badge {
        display: inline-flex;
        align-items: center;
        padding: 2px 7px;
        border-radius: 999px;
        background: #ecfdf5;
        color: #047857;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.04em;
    }

    .tb-msearch__badge--used {
        background: #eff6ff;
        color: #1d4ed8;
    }

    .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__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; }
    }
}

