.mm-eas,
.mm-eas * {
    box-sizing: border-box;
}

.mm-eas {
    width: 100%;
    direction: rtl;
}

.mm-eas-trigger {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 52px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
}

.mm-eas-trigger__input,
.mm-eas-modal__input {
    width: 100%;
    min-width: 0;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 16px;
    font: inherit;
    color: #111827;
}

.mm-eas-trigger__input::-webkit-search-cancel-button,
.mm-eas-modal__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.mm-eas-trigger__button {
    appearance: none;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    flex: 0 0 54px;
    width: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    background: #111827;
    color: #fff;
    transition: opacity .2s ease, transform .2s ease, background-color .2s ease, color .2s ease;
}

.mm-eas-trigger__button:hover {
    opacity: .92;
}

.mm-eas-trigger__button:active {
    transform: scale(.97);
}

.mm-eas-trigger__button svg,
.mm-eas-modal__search-icon svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

.mm-eas-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5vh 20px;
    background: rgba(0,0,0,.55);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, visibility .22s ease;
    overflow-y: auto;
}

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

.mm-eas-modal__dialog {
    position: relative;
    width: 90%;
    max-width: 1200px;
    min-height: 260px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 20px;
    padding: 64px 28px 28px;
    transform: translateY(18px) scale(.985);
    opacity: 0;
    transition: transform .25s ease, opacity .25s ease;
}

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

.mm-eas-modal__close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: #f2f4f7;
    color: #101828;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0 0 3px;
    transition: transform .2s ease, background-color .2s ease, color .2s ease;
}

.mm-eas-modal__close:hover {
    transform: rotate(90deg);
}

.mm-eas-modal__search {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 54px;
    overflow: hidden;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    background: #fff;
}

.mm-eas-modal__search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 50px;
    color: #667085;
}

.mm-eas-status {
    min-height: 24px;
    padding: 14px 2px 6px;
    color: #667085;
    font-size: 13px;
}

.mm-eas-results-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
}

.mm-eas-card {
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #eaecf0;
    border-radius: 16px;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.mm-eas-card:hover {
    transform: translateY(-3px);
}

.mm-eas-card__image {
    position: relative;
    display: block;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f2f4f7;
}

.mm-eas-card__image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .35s ease;
}

.mm-eas-card:hover .mm-eas-card__image img {
    transform: scale(1.035);
}

.mm-eas-card__image--empty span {
    position: absolute;
    inset: 0;
    display: block;
    background: linear-gradient(135deg, #f8fafc, #e9eef5);
}

.mm-eas-card__body {
    padding: 18px;
}

.mm-eas-card__title {
    margin: 0 0 16px;
    font-size: 16px;
    line-height: 1.8;
}

.mm-eas-card__title a {
    color: #101828;
    text-decoration: none !important;
    transition: color .2s ease;
}

.mm-eas-card__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 0;
    border-radius: 9px;
    background: #111827;
    color: #fff;
    text-decoration: none !important;
    transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.mm-eas-card__button:hover {
    color: #fff;
    transform: translateY(-1px);
}

.mm-eas-message {
    grid-column: 1 / -1;
    width: 100%;
    padding: 42px 20px;
    border: 1px dashed #d0d5dd;
    border-radius: 14px;
    text-align: center;
    color: #667085;
    background: #fafafa;
}

.mm-eas-loading {
    grid-column: 1 / -1;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mm-eas-loading::after {
    content: '';
    width: 34px;
    height: 34px;
    border: 3px solid rgba(17,24,39,.16);
    border-top-color: #111827;
    border-radius: 50%;
    animation: mmEasSpin .75s linear infinite;
}

body.mm-eas-lock {
    overflow: hidden !important;
}

@keyframes mmEasSpin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1024px) {
    .mm-eas-results-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .mm-eas-modal {
        padding: 12px;
        align-items: flex-start;
    }

    .mm-eas-modal__dialog {
        width: 100%;
        max-height: calc(100vh - 24px);
        padding: 58px 14px 18px;
        border-radius: 16px;
    }

    .mm-eas-results-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .mm-eas-card__image {
        height: 190px;
    }
}
