.mmlivesearch__result {
    max-height: 100vh !important;
    height: 100vh !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 9999 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
}

/* Базовые элементы старой верстки истории — оставляем для совместимости */
.mmlivesearch__result span.search_sel {
    cursor: pointer;
    display: table;
    width: 100%;
    padding: 10px 15px;
    position: relative;
    border-top: 1px solid #e3e3e3;
    background: #fff;
    text-align: left;
    box-sizing: border-box;
}

.mmlivesearch__result span.search_sel .im {
    display: table-cell;
    padding-right: 10px;
    width: 40px;
    vertical-align: middle;
    text-align: center;
}

.mmlivesearch__result span.search_sel .im img {
    max-width: 36px;
    max-height: 36px;
    border-radius: 4px;
    object-fit: cover;
}

.mmlivesearch__result span.search_sel .w {
    display: table-cell;
    vertical-align: middle;
    text-align: left;
    font-size: 13px;
    line-height: 1.4;
    color: #111827;
}

.mmlivesearch__result span.search_sel:hover {
    background: #f3f4f6;
}

.mmlivesearch__result span.search_sel:hover .mmls__price {
    background: #f3f4f6;
}

.mmlivesearch__result span.search_sel.toproduct,
.mmlivesearch__result span.search_sel.tosearch {
    padding: 10px 100px 10px 15px;
}

.mmlivesearch__result span.search__sel.toproduct {
    padding: 10px 100px 10px 15px;
    position: relative;
    z-index: 976;
    padding-left: 35px;
    border-top: 1px solid #e3e3e3;
    background: #fff;
    text-align: left;
}

.mmlivesearch__result span.search_sel.history {
    padding: 10px 15px 10px 15px;
}

.mmlivesearch__result span.selected {
    background: #e5edff;
}

.mmlivesearch__result span.selected .mmls__price {
    background: #e5edff;
}

.mmlivesearch__result .title {
    padding: 10px 12px 8px 12px;
    background: #f9fafb;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mmlivesearch__result .title strong {
    font-weight: 600;
}

.mmlivesearch__result span.all_products {
    width: 100%;
    padding: 10px;
    text-align: center !important;
}

.mmlivesearch__result span.no_find {
    width: 100%;
    padding: 16px 12px;
    display: block;
    background: #fff;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}

.mmlivesearch__result .clearMMLiveSearch {
    float: right;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    text-decoration: none;
    padding: 4px 0 4px 10px;
}

.mmlivesearch__result .clearMMLiveSearch:hover {
    color: #ef4444;
}

.mmlivesearch__result .mmls__price {
    position: absolute;
    font-weight: 600;
    right: 10px;
    top: calc(50% - 10px);
    background: #fff;
    padding-left: 10px;
    font-size: 13px;
    color: #ef4444;
}

.mmlsloader {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: block;
    margin: 15px auto;
    position: absolute;
    left: 50%;
    top: 0;
    z-index: 2;
    color: #9ca3af;
    box-sizing: border-box;
    animation: mmlsanimloader 1s linear infinite alternate;
}

@keyframes mmlsanimloader {
    0% { box-shadow: -38px -12px, -14px 0, 14px 0, 38px 0; }
    33% { box-shadow: -38px 0, -14px -12px, 14px 0, 38px 0; }
    66% { box-shadow: -38px 0, -14px 0, 14px -12px, 38px 0; }
    100% { box-shadow: -38px 0, -14px 0, 14px 0, 38px -12px; }
}

/* FULLSCREEN */

.mmlivesearch-fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding-top: 56px !important;
    overflow: hidden !important;
}

body.mmlivesearch-fullscreen-active {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

.mmlivesearch-fullscreen-mode .search-input-wrapper {
    position: relative !important;
    width: 80% !important;
    margin: -16px auto 20px auto !important;
    max-width: 960px !important;
}

.mmlivesearch-fullscreen-mode .mmlivesearch__input {
    width: 100% !important;
    height: 60px !important;
    font-size: 18px !important;
    padding: 14px 56px 14px 20px !important;
    box-sizing: border-box !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.25) !important;
}

.mmlivesearch__input {
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.2s ease;
}

.mmlivesearch-fullscreen-mode .mmlivesearch__input:focus {
    border-color: #6366f1 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22) !important;
    background: #ffffff !important;
}

.mmlivesearch-fullscreen-mode .mmlivesearch__result {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    width: 100% !important;
    max-width: none !important;
    max-height: calc(100vh - 130px) !important;
    height: calc(100vh - 130px) !important;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28) !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 16px !important;
    margin-top: 10px !important;
    z-index: 1000 !important;
    overflow: hidden !important;
}

.mmlivesearch-fullscreen-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 9998 !important;
    background: transparent !important;
}

.mmlivesearch-fullscreen-mode .search_sel {
    padding: 14px 18px !important;
    font-size: 15px !important;
    border-bottom: 1px solid #f3f4f6 !important;
}

.mmlivesearch-fullscreen-mode .mmls__price {
    font-size: 15px !important;
    right: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

.mmlivesearch-fullscreen-mode .im {
    width: 50px !important;
}

.mmlivesearch-fullscreen-mode .w {
    font-size: 15px !important;
}

.mmlivesearch-close-fullscreen {
    position: fixed !important;
    top: 22px !important;
    right: 10vw !important;
    width: 40px !important;
    height: 40px !important;
    background: #f3f4f6 !important;
    border: none !important;
    border-radius: 999px !important;
    font-size: 24px !important;
    cursor: pointer !important;
    z-index: 10000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #111827 !important;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25) !important;
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.mmlivesearch-close-fullscreen:hover {
    background: #e5e7eb !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.3) !important;
}

.mmlivesearch-mobile-close {
    position: absolute !important;
    right: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 30px !important;
    height: 30px !important;
    background: none !important;
    border: none !important;
    font-size: 22px !important;
    cursor: pointer !important;
    color: #6b7280 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
}

/* НОВЫЙ ВНЕШНИЙ ВИД РЕЗУЛЬТАТОВ */

.mmls-result-item {
    border-bottom: 1px solid #f3f4f6;
    background: #ffffff;
    transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.08s ease;
    margin: 0;
}

.mmls-result-item:last-child {
    border-bottom: none;
}

.mmls-result-item:hover {
    background: #f9fafb;
}

.mmls-result-item.selected {
    background: #eef2ff;
    border-left: 3px solid #6366f1;
}

/* Категории */
.mmls-category-content {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    width: 100%;
    box-sizing: border-box;
    gap: 10px;
}

.mmls-category-image {
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mmls-category-image img {
    width: 32px !important;
    height: 32px !important;
    object-fit: cover;
}

.mmls-category-info {
    flex: 1;
    min-width: 0;
}

.mmls-category-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 3px;
    font-size: 14px;
    line-height: 1.35;
}

.mmls-category-type {
    font-size: 11px;
    color: #22c55e;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

/* Продукты (мероприятия) */
.mmls-product-content {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    width: 100%;
    box-sizing: border-box;
    gap: 12px;
}

.mmls-product-image {
    flex: 0 0 54px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mmls-product-image img {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    width: 100px;
    height: 100px;
    object-fit: cover;
}

.mmls-product-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mmls-product-name {
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 700;
    color: #4f46e5;
    margin-bottom: 2px;
    line-height: 1.35;
    order: 2;
}

.mmls-product-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    order: 3;
}

/* Строка с кодами – серая, моноширинная, чтобы не мешала заголовку */
.mmls-product-jan,
.mmls-product-isbn,
.mmls-product-mpn {
    font-size: 12px;
    line-height: 1.3;
    color: #6b7280;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.mmls-product-price {
    font-weight: 700;
    color: #ef4444;
    font-size: 14px;
}

.mmls-product-type {
    font-size: 11px;
    color: #f97316;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 2px;
    order: 1;
}

/* Серии / поисковые группы */
.mmls-search-content {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    width: 100%;
    box-sizing: border-box;
    gap: 10px;
}

.mmls-search-image {
    flex: 0 0 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mmls-search-image img {
    width: 32px !important;
    height: 32px !important;
    object-fit: cover;
}

.mmls-search-info {
    flex: 1;
    min-width: 0;
}

.mmls-search-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 3px;
    font-size: 14px;
    line-height: 1.35;
}

.mmls-search-type {
    font-size: 11px;
    color: #3b82f6;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

/* Панель "Все предложения" - всегда внизу */
.mmls-all-products {
    background: #f9fafb;
    border-top: 2px solid #e5e7eb;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* Контейнер для скроллируемого контента */
.mmls-tab-scroll-container {
    position: relative;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

/* Контент вкладки с паддингом для кнопки "Все предложения" */
.mmls-tab-content-wrapper {
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    padding-bottom: 60px; /* Место для кнопки "Все предложения" */
    box-sizing: border-box;
}

.mmls-all-content {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
    position: relative;
    gap: 8px;
}

@media (max-width: 768px) {
.mmls-all-content {
    padding: 10px 16px 35px 16px
}
}

.mmls-all-text {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    text-align: center;
}

.mmls-all-content .mmls-item-arrow {
    position: absolute;
    right: 18px;
}

/* Нет результатов */

.mmls-no-results {
    text-align: center;
    padding: 28px 18px;
    color: #6b7280;
    border-left: 3px solid #9ca3af;
    background: #f9fafb;
}

.mmls-no-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.mmls-no-text {
    font-size: 14px;
    color: #6b7280;
}

/* СТАНДАРТНЫЕ ХОВЕРЫ ПО ТИПАМ */

.mmls-category-item:hover {
    background: #f0fdf4;
    border-left-color: #22c55e;
}

.mmls-product-item:hover {
    background: #fff7ed;
    border-left-color: #f97316;
}

.mmls-search-item:hover {
    background: #eff6ff;
}

.mmls-all-products:hover {
    background: #e5e7eb;
    border-left-color: #4b5563;
}

/* Подсветка найденного */

.mmls-category-name strong,
.mmls-product-name strong,
.mmls-search-name strong {
    color: #dc2626;
    font-weight: 800;
}

/* Стрелка справа */

.mmls-item-arrow {
    flex: 0 0 20px;
    margin-left: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    opacity: 0.7;
    transition: opacity 0.16s ease, color 0.16s ease, transform 0.08s ease;
}

.mmls-result-item:hover .mmls-item-arrow {
    opacity: 1;
    color: #111827;
    transform: translateX(1px);
}

.mmls-arrow-icon {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Вкладки - ИЗМЕНЕНО: 2 вкладки вместо 3 */

.mmlivesearch__result-with-tabs {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

.mmls-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 10px;
    gap: 4px;
    position: sticky;
    top: 0;
    z-index: 20;
    flex-shrink: 0;
}

.mmls-tab {
    flex: 1;
    text-align: center;
    padding: 9px 10px;
    cursor: pointer;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #6b7280;
    font-weight: 600;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.08s ease;
    white-space: nowrap;
}

.mmls-tab:hover {
    background: #e5e7eb;
    color: #111827;
}

.mmls-tab.active {
    color: #111827;
    border-color: #6366f1;
    background: #eef2ff;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
    transform: translateY(-1px);
}

.mmls-tab span {
    display: inline-block;
    vertical-align: middle;
}

/* Контенты вкладок */

.mmls-tab-content {
    display: none;
    flex: 1 1 auto;
    overflow-y: auto;
    max-height: calc(100% - 50px); /* Высота вкладки минус высота табов */
    position: relative;
}

.mmls-tab-content.active {
    display: block;
}

.mmls-tab-content .mmls-result-item {
    border-bottom: 1px solid #f3f4f6;
}

/* Контейнер для скролла контента вкладки */
.mmls-tab-content-scroll {
    overflow-y: auto;
    height: 100%;
    max-height: calc(100vh - 140px); /* с учетом табов и кнопки "Все предложения" */
}

/* Стили для компоновки: сначала мероприятия, потом серии */
.mmls-tab-content-series {
    display: none;
    flex-direction: column;
}

.mmls-tab-content-series.active {
    display: flex;
}

/* Адаптация под fullscreen */

.mmlivesearch-fullscreen-mode .mmls-result-item {
    border-bottom: 1px solid #e5e7eb;
}

.mmlivesearch-fullscreen-mode .mmls-category-content,
.mmlivesearch-fullscreen-mode .mmls-product-content,
.mmlivesearch-fullscreen-mode .mmls-search-content {
    padding: 14px 18px;
}

.mmlivesearch-fullscreen-mode .mmls-category-name,
.mmlivesearch-fullscreen-mode .mmls-search-name {
    text-transform: uppercase;
    font-size: 14px;
}

.mmlivesearch-fullscreen-mode .mmls-product-price {
    font-size: 14px;
}

.mmlivesearch-fullscreen-mode .mmls-category-image {
    flex: 0 0 48px;
}

.mmlivesearch-fullscreen-mode .mmls-product-image {
    flex: 0 0 62px;
}

.mmlivesearch-fullscreen-mode .mmls-search-image {
    flex: 0 0 42px;
}

.mmlivesearch-fullscreen-mode .mmls-all-text {
    font-size: 15px;
    padding: 16px;
}

.mmlivesearch-fullscreen-mode .mmls-no-results {
    padding: 40px 20px;
}

.mmlivesearch-fullscreen-mode .mmls-no-text {
    font-size: 15px;
}

/* Стрелка в fullscreen */

.mmlivesearch-fullscreen-mode .mmls-item-arrow {
    flex: 0 0 24px;
    margin-left: 14px;
}

.mmlivesearch-fullscreen-mode .mmls-arrow-icon {
    width: 18px;
    height: 18px;
}

/* Скрытие штатных кнопок в fullscreen */

.mmlivesearch-fullscreen-mode .search-btn-clear,
.mmlivesearch-fullscreen-mode .header-search__btn,
.mmlivesearch-fullscreen-mode .fa-search {
    display: none !important;
}

.mmlivesearch-fullscreen-mode .search-input-wrapper button:not(.mmlivesearch-mobile-close) {
    display: none !important;
}

/* АДАПТИВ */

@media (max-width: 768px) {
    .mmlivesearch-fullscreen-mode .search-input-wrapper {
        width: 94% !important;
        margin: -50px auto 16px auto !important;
    }

    .mmlivesearch-fullscreen-mode .mmlivesearch__input {
        height: 52px !important;
        font-size: 16px !important;
        padding: 11px 44px 11px 16px !important;
        border-radius: 999px !important;
    }

    .mmlivesearch-fullscreen-mode .mmlivesearch__result {
        max-height: calc(100vh - 160px) !important;
        border-radius: 16px !important;
    }

    .mmlivesearch-fullscreen-mode .search_sel {
        padding: 11px 13px !important;
    }

    .mmlivesearch-fullscreen-mode .im {
        width: 44px !important;
    }

    .mmlivesearch-mobile-close {
        display: flex !important;
    }

    .mmlivesearch-close-fullscreen {
        display: none !important;
    }

    .mmls-category-content,
    .mmls-product-content,
    .mmls-search-content {
        padding: 10px 12px;
        gap: 8px;
    }

    .mmls-category-image {
        flex: 0 0 34px;
    }

    .mmls-product-image {
        flex: 0 0 46px;
    }

    .mmls-search-image {
        flex: 0 0 30px;
    }

    .mmls-category-name,
    .mmls-product-name,
    .mmls-search-name {
        font-size: 10px;
    }

    .mmls-product-price {
        font-size: 13px;
    }

    .mmls-category-type,
    .mmls-product-type,
    .mmls-search-type {
        font-size: 10px;
    }

    .mmls-all-text {
        font-size: 13px;
        padding: 10px;
    }

    .mmls-no-results {
        padding: 24px 14px;
    }

    .mmls-no-text {
        font-size: 13px;
    }

    .mmls-tabs {
        padding: 10px 4px 10px 4px;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mmls-tab {
        font-size: 10px;
        padding: 7px 8px;
        white-space: nowrap;
    }

    .mmls-item-arrow {
        flex: 0 0 16px;
        margin-left: 8px;
    }

    .mmls-arrow-icon {
        width: 14px;
        height: 14px;
    }
}

@media (min-width: 769px) {
    .mmlivesearch-mobile-close {
        display: none !important;
    }

    .mmlivesearch-close-fullscreen {
        display: flex !important;
    }
}

.mmlivesearch-fullscreen-mode .header-search__form {
    border: 2px none;
}

/* Контейнер вкладок с внутренним скроллом */
.mmlivesearch__result-with-tabs {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
}

/* Область с контентом вкладок */
.mmls-tab-content {
    display: none;
    flex: 1 1 auto;
    overflow-y: auto;
    max-height: calc(100% - 50px);
}

/* Активная вкладка показывает свой скроллируемый список */
.mmls-tab-content.active {
    display: block;
}

.mmlivesearch-fullscreen-mode .mmlivesearch__result-with-tabs {
    max-height: calc(100vh - 130px);
    height: calc(100vh - 130px);
}

.mmlivesearch-fullscreen-mode .mmls-tab-content {
    max-height: calc(100vh - 170px); /* чуть меньше из-за input + отступы */
}

/* Новые стили для группировки мероприятий и серий в первой вкладке */
.mmls-section-title {
    padding: 12px 14px 8px 14px;
    background: #f9fafb;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
    top: 0;
    z-index: 10;
}

.mmls-section-content {
    padding-bottom: 60px; /* Отступ для кнопки "Все предложения" */
}

.mmls-tab-content-products .mmls-section-title:first-child {
    top: 50px; /* Учитываем высоту табов */
}