.ndm-menu {
    --ndm-sticky-offset: 0px;
    position: relative;
    overflow: clip;
    direction: rtl;
    text-align: right;
}

.ndm-menu * { box-sizing: border-box; }

.ndm-menu__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    margin-inline: auto;
}

.ndm-menu--decorated::before,
.ndm-menu--decorated::after {
    content: "";
    position: absolute;
    z-index: 1;
    width: 1px;
    height: 190px;
    opacity: .55;
    top: 9%;
}
.ndm-menu--decorated::before { right: 2.4%; transform: rotate(10deg); }
.ndm-menu--decorated::after { left: 2.4%; transform: rotate(-10deg); top: 64%; }

.ndm-menu__header {
    max-width: 760px;
    margin: 0 auto 38px;
    text-align: center;
}

.ndm-menu__title {
    margin: 0;
    font-size: clamp(38px, 5vw, 74px);
    line-height: 1.05;
    font-weight: 500;
    letter-spacing: -.03em;
}

.ndm-menu__subtitle {
    margin-top: 14px;
    font-size: 17px;
    line-height: 1.8;
}

.ndm-menu__filter-wrap { margin-bottom: 38px; }
.ndm-menu--sticky .ndm-menu__filter-wrap {
    position: sticky;
    top: var(--ndm-sticky-offset);
    z-index: 20;
    padding-block: 12px;
    background: rgba(0,0,0,.10);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ndm-menu__filters {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.ndm-filter {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid;
    background: transparent;
    padding: 10px 18px;
    cursor: pointer;
    transition: transform .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
    line-height: 1.2;
    white-space: nowrap;
}
.ndm-filter:hover { transform: translateY(-1px); }
.ndm-filter:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.ndm-menu__items {
    display: flex;
    flex-direction: column;
}

.ndm-card {
    display: flex;
    align-items: stretch;
    min-height: 300px;
    border: 1px solid;
    overflow: hidden;
    isolation: isolate;
}

.ndm-card__media {
    position: relative;
    overflow: hidden;
    flex: 0 0 48%;
    min-width: 0;
}

.ndm-card__image,
.ndm-card__placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .65s cubic-bezier(.2,.7,.2,1);
}
.ndm-card:hover .ndm-card__image { transform: scale(1.035); }
.ndm-card__placeholder { background: rgba(255,255,255,.045); }

.ndm-card__content {
    flex: 1 1 52%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(28px, 4vw, 64px);
}

.ndm-card__heading-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
}

.ndm-card__title {
    margin: 0;
    font-size: clamp(28px, 3vw, 46px);
    line-height: 1.12;
    font-weight: 500;
}

.ndm-card__price {
    flex: 0 0 auto;
    font-size: clamp(18px, 1.5vw, 25px);
    font-weight: 600;
    white-space: nowrap;
}

.ndm-card__description {
    margin: 18px 0 0;
    max-width: 620px;
    font-size: 17px;
    line-height: 1.9;
}

.ndm-card__badge {
    align-self: flex-start;
    margin-bottom: 18px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
}

.ndm-menu--image-alternate .ndm-card:nth-child(even) { flex-direction: row-reverse; }
.ndm-menu--image-left .ndm-card { flex-direction: row-reverse; }
.ndm-menu--image-right .ndm-card { flex-direction: row; }

.ndm-menu__loader {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-height: 80px;
}
.ndm-menu__loader[hidden] { display: none; }
.ndm-menu__loader span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: .4;
    animation: ndmPulse .9s infinite alternate;
}
.ndm-menu__loader span:nth-child(2) { animation-delay: .15s; }
.ndm-menu__loader span:nth-child(3) { animation-delay: .3s; }
@keyframes ndmPulse { to { opacity: 1; transform: translateY(-4px); } }

.ndm-menu__empty {
    text-align: center;
    padding: 60px 20px;
    opacity: .75;
}
.ndm-menu__sentinel { height: 1px; }

@media (max-width: 767px) {
    .ndm-menu__filter-wrap {
        margin-inline: -12px;
        overflow: hidden;
    }
    .ndm-menu__filters {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: none;
        padding-inline: 12px;
    }
    .ndm-menu__filters::-webkit-scrollbar { display: none; }

    .ndm-card,
    .ndm-menu--image-alternate .ndm-card:nth-child(even),
    .ndm-menu--image-left .ndm-card,
    .ndm-menu--image-right .ndm-card {
        flex-direction: column;
    }
    .ndm-card__media {
        flex-basis: auto !important;
        width: 100%;
        min-height: 260px;
    }
    .ndm-card__content { padding: 26px 22px 30px; }
    .ndm-card__heading-row { gap: 12px; }
    .ndm-menu--decorated::before,
    .ndm-menu--decorated::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ndm-card__image,
    .ndm-filter { transition: none; }
    .ndm-menu__loader span { animation: none; }
}


/* ---- Layout options (Elementor controls): list layout / no image / no filters ---- */
.ndm-menu--no-filters .ndm-menu__filter-wrap { display: none; }
.ndm-menu--no-image .ndm-card__media { display: none; }
.ndm-menu--no-image .ndm-card__content { flex-basis: 100%; }
/* ---- List layout (v1.2) — refined desktop list + app-style mobile cards ----
   Colors come from the Elementor controls. --ndm-accent is set by frontend.js
   from the item-title color, so every accent follows the widget's palette. */
.ndm-menu--list .ndm-menu__items {
    display: grid;
    grid-template-columns: repeat(var(--ndm-columns, 1), minmax(0, 1fr));
    column-gap: 64px !important; /* list columns need breathing room even when the card-gap control is 0 */
    row-gap: 0;
}
.ndm-menu--list .ndm-card {
    position: relative;
    isolation: isolate;
    display: block;
    min-height: 0;
    border-width: 0 0 1px 0;
    border-style: solid;
    padding: 26px 0 24px;
    overflow: visible;
}
.ndm-menu--list .ndm-card::before,
.ndm-menu--list .ndm-card::after {
    content: "";
    position: absolute;
    pointer-events: none;
}
/* hover surface */
.ndm-menu--list .ndm-card::after {
    z-index: -1;
    inset: 6px -16px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--ndm-accent, currentColor) 5%, transparent);
    opacity: 0;
    transition: opacity .3s ease;
}
/* accent line */
.ndm-menu--list .ndm-card::before {
    inset-inline-start: -16px;
    top: 50%;
    width: 2px;
    height: 0;
    border-radius: 2px;
    background: var(--ndm-accent, currentColor);
    transform: translateY(-50%);
    transition: height .35s cubic-bezier(.2,.7,.2,1);
}
.ndm-menu--list .ndm-card__media { display: none; }
.ndm-menu--list .ndm-card__content { display: block; padding: 0; }
.ndm-menu--list .ndm-card__heading-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
}
.ndm-menu--list .ndm-card__title {
    font-size: 24px;
    line-height: 1.25;
    font-weight: 400;
    transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
/* dotted leader between title and price */
.ndm-menu--list .ndm-card__heading-row:has(.ndm-card__price)::after {
    content: "";
    order: 1;
    flex: 1 1 24px;
    min-width: 24px;
    border-bottom: 1px dotted var(--ndm-accent, currentColor);
    opacity: .35;
    transform: translateY(-6px);
}
.ndm-menu--list .ndm-card__title { order: 0; }
.ndm-menu--list .ndm-card__price { order: 2; font-size: 18px; font-weight: 500; }
.ndm-menu--list .ndm-card__description {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.75;
    max-width: 62ch;
}
.ndm-menu--list .ndm-card__badge {
    display: inline-block;
    margin: 0 0 10px;
    padding: 4px 11px;
}
.ndm-menu--list .ndm-menu__loader { min-height: 40px; }

@media (hover: hover) {
    .ndm-menu--list .ndm-card:hover::after { opacity: 1; }
    .ndm-menu--list .ndm-card:hover::before { height: 34px; }
    .ndm-menu--list .ndm-card:hover .ndm-card__title { transform: translateX(-6px); }
}

/* ---- Mobile: app-style cards ---- */
@media (max-width: 767px) {
    .ndm-menu--list .ndm-menu__items {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 12px !important;
    }
    .ndm-menu.ndm-menu--list .ndm-card {
        border-width: 1px;
        border-radius: 18px !important;
        padding: 16px 20px 17px 16px;
        background: color-mix(in srgb, #fff 62%, transparent) !important;
        box-shadow:
            0 1px 2px color-mix(in srgb, var(--ndm-accent, #000) 6%, transparent),
            0 12px 26px -18px color-mix(in srgb, var(--ndm-accent, #000) 45%, transparent);
        -webkit-tap-highlight-color: transparent;
        transition: transform .18s ease, box-shadow .18s ease;
    }
    .ndm-menu.ndm-menu--list .ndm-card:active {
        transform: scale(.98);
        box-shadow: 0 1px 2px color-mix(in srgb, var(--ndm-accent, #000) 10%, transparent);
    }
    .ndm-menu--list .ndm-card::after { display: none; }
    .ndm-menu--list .ndm-card::before {
        inset-inline-start: 0;
        top: 18px;
        bottom: 18px;
        height: auto;
        width: 3px;
        border-radius: 3px 0 0 3px;
        transform: none;
        opacity: .9;
    }
    .ndm-menu--list .ndm-card__heading-row { gap: 10px; }
    .ndm-menu--list .ndm-card__title { font-size: 19px; line-height: 1.3; }
    .ndm-menu--list .ndm-card__price {
        padding: 3px 10px;
        border-radius: 999px;
        font-size: 15px;
        background: color-mix(in srgb, var(--ndm-accent, currentColor) 9%, transparent);
    }
    .ndm-menu--list .ndm-card__heading-row:has(.ndm-card__price)::after { display: none; }
    .ndm-menu--list .ndm-card__description {
        margin-top: 6px;
        font-size: 14px;
        line-height: 1.65;
    }
}

/* ---- Reveal on scroll (class added by frontend.js) ---- */
.ndm-anim .ndm-card:not(.is-visible) { opacity: 0; }
.ndm-anim .ndm-card.is-visible {
    animation: ndmCardIn .55s cubic-bezier(.2,.7,.2,1) backwards;
    animation-delay: var(--ndm-delay, 0ms);
}
@keyframes ndmCardIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

/* ---- Sticky category bar (mobile & tablet, built by frontend.js) ---- */
.ndm-appbar {
    position: fixed;
    inset-inline: 0;
    top: 0;
    z-index: 990;
    direction: rtl;
    padding: 10px 0;
    background: color-mix(in srgb, var(--ndm-bar-bg, #fff) 86%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    backdrop-filter: blur(14px) saturate(1.3);
    border-bottom: 1px solid color-mix(in srgb, var(--ndm-accent, #000) 14%, transparent);
    box-shadow: 0 10px 24px -20px color-mix(in srgb, var(--ndm-accent, #000) 70%, transparent);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
}
.ndm-appbar.is-shown {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .25s ease, transform .25s ease;
}
.ndm-appbar__track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    padding-inline: 16px;
}
.ndm-appbar__track::-webkit-scrollbar { display: none; }
.ndm-appbar__link {
    flex: 0 0 auto;
    padding: 8px 16px;
    border: 1px solid color-mix(in srgb, var(--ndm-accent, #000) 25%, transparent);
    border-radius: 999px;
    color: var(--ndm-accent, inherit);
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.ndm-appbar__link:hover,
.ndm-appbar__link:focus { color: var(--ndm-accent, inherit); text-decoration: none; }
.ndm-appbar__link.is-active,
.ndm-appbar__link.is-active:hover,
.ndm-appbar__link.is-active:focus {
    background: var(--ndm-accent, #000);
    border-color: var(--ndm-accent, #000);
    color: var(--ndm-bar-bg, #fff);
}
@media (min-width: 1025px) {
    .ndm-appbar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ndm-anim .ndm-card.is-visible { animation: none; }
    .ndm-menu--list .ndm-card,
    .ndm-menu--list .ndm-card__title,
    .ndm-appbar { transition: none; }
}
