.mmts-widget,
.mmts-widget * {
    box-sizing: border-box;
}

.mmts-widget {
    --mmts-surface: #ffffff;
    --mmts-surface-soft: #f7f8fa;
    --mmts-text: #1f2937;
    --mmts-muted: #667085;
    --mmts-line: #e7e9ee;
    --mmts-accent: #111827;
    width: 100%;
    direction: rtl;
    background: var(--mmts-surface);
    color: var(--mmts-text);
    border: 1px solid var(--mmts-line);
    border-radius: 18px;
    padding: 18px;
}

.mmts-widget__title {
    margin: 0 0 16px;
    font-size: 18px;
    line-height: 1.6;
    font-weight: 700;
    color: var(--mmts-text);
}

.mmts-editor-note {
    margin: -6px 0 14px;
    padding: 9px 12px;
    border: 1px dashed #cfd4dc;
    border-radius: 10px;
    color: #667085;
    background: #fafafa;
    font-size: 12px;
    line-height: 1.8;
}

.mmts-specs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.mmts-layout-grid .mmts-specs-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.mmts-group-title {
    grid-column: 1 / -1;
    width: 100%;
    margin: 8px 0 0;
    padding: 9px 12px;
    border-radius: 10px;
    color: #344054;
    background: #f2f4f7;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.7;
}

.mmts-group-title:first-child {
    margin-top: 0;
}

.mmts-spec-row {
    display: flex;
    align-items: stretch;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--mmts-line);
    border-radius: 12px;
    transition: transform .22s ease, background-color .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.mmts-striped .mmts-spec-row.mmts-row-even {
    background: var(--mmts-surface-soft);
}

.mmts-spec-row__label,
.mmts-spec-row__value {
    min-width: 0;
    display: flex;
    align-items: center;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.mmts-spec-row__label {
    flex: 0 0 34%;
    width: 34%;
    padding: 12px 14px;
    color: var(--mmts-muted);
    border-left: 1px solid var(--mmts-line);
    font-size: 14px;
    font-weight: 500;
}

.mmts-spec-row__value {
    flex: 1 1 auto;
    padding: 12px 14px;
    color: var(--mmts-text);
    font-size: 14px;
    font-weight: 600;
}

.mmts-more-wrap {
    display: none;
    margin-top: 12px;
}

.mmts-more-button {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    background: #fff;
    color: #344054;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.mmts-more-button:hover {
    background: #f8fafc;
    color: #111827;
}

.mmts-more-button:active {
    transform: scale(.985);
}

.mmts-more-button__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 25px;
    height: 25px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(17, 24, 39, .07);
    font-size: 11px;
    line-height: 1;
}

.mmts-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, .58);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, visibility .22s ease;
}

.mmts-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mmts-modal__dialog {
    width: min(92%, 640px);
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .24);
    transform: translateY(12px) scale(.985);
    transition: transform .22s ease;
}

.mmts-modal.is-open .mmts-modal__dialog {
    transform: translateY(0) scale(1);
}

.mmts-modal__header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 16px;
    border-bottom: 1px solid var(--mmts-line);
}

.mmts-modal__title {
    margin: 0;
    color: var(--mmts-text);
    font-size: 17px;
    line-height: 1.7;
    font-weight: 800;
}

.mmts-modal__close {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: transparent;
    color: #475467;
    font: inherit;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.mmts-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px;
    scrollbar-width: thin;
}

.mmts-modal__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mmts-modal .mmts-group-title {
    margin-top: 8px;
}

body.mmts-modal-open {
    overflow: hidden !important;
}

@media (max-width: 767px) {
    .mmts-widget {
        border-radius: 14px;
        padding: 12px;
    }

    .mmts-widget__title {
        margin-bottom: 12px;
    }

    .mmts-specs-list,
    .mmts-layout-grid .mmts-specs-list {
        display: flex !important;
        flex-direction: column;
        grid-template-columns: none !important;
    }

    .mmts-spec-row {
        width: 100%;
        min-height: 48px;
    }

    .mmts-spec-row__label {
        flex: 0 0 44%;
        width: 44%;
        padding: 10px 11px;
        font-size: 13px;
    }

    .mmts-spec-row__value {
        padding: 10px 11px;
        font-size: 13px;
    }

    .mmts-widget > .mmts-specs-list > .mmts-mobile-extra {
        display: none !important;
    }

    .mmts-more-wrap {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mmts-modal {
        align-items: flex-end;
        padding: 10px;
    }

    .mmts-modal__dialog {
        width: 100%;
        max-height: 86vh;
        border-radius: 18px 18px 12px 12px;
        transform: translateY(22px);
    }

    .mmts-modal.is-open .mmts-modal__dialog {
        transform: translateY(0);
    }

    .mmts-modal__header {
        padding: 13px 14px;
    }

    .mmts-modal__title {
        font-size: 15px;
    }

    .mmts-modal__body {
        padding: 10px;
    }

    .mmts-modal .mmts-spec-row__label {
        flex-basis: 44%;
        width: 44%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mmts-spec-row,
    .mmts-more-button,
    .mmts-modal,
    .mmts-modal__dialog {
        transition: none !important;
    }
}
