/* Menu examples are isolated from the calculator, payment and result styles. */
.hero-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

.hero-actions > a {
    min-width: 0;
    min-height: 44px;
    padding: 0 14px;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
}

.hero-actions .cta {
    flex: 0 1 300px;
}

.hero-actions .hero-example-link {
    flex: 0 0 auto;
    padding: 0 2px;
    color: #2e6b96;
    font-size: 13px;
    font-weight: 750;
}

.hero-actions > a:focus-visible,
.menu-examples__actions > a:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
}

@media (min-width: 981px) {
    .hero-actions .hero-example-link {
        color: #52738b;
        font-size: 12px;
        font-weight: 700;
    }
}

.menu-examples {
    scroll-margin-top: 84px;
}

#menu-calc {
    scroll-margin-top: 65px;
}

.menu-examples__head {
    margin-bottom: 16px;
}

.menu-examples__head h2 {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.2;
}

.menu-examples__head p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}

.menu-examples__gallery {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 4px;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: #b9dcfb transparent;
}

.menu-example {
    min-width: 0;
    scroll-snap-align: start;
}

.menu-example figure {
    margin: 0;
}

.menu-example__frame {
    appearance: none;
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1.9;
    max-height: 340px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 4px 12px rgba(15, 122, 229, 0.05);
    cursor: zoom-in;
    touch-action: pan-x pan-y;
    user-select: none;
    -webkit-user-select: none;
}

.menu-example__frame:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

.menu-example__frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
    transform-origin: center;
    pointer-events: none;
    -webkit-user-drag: none;
}

.menu-example figcaption {
    margin-top: 10px;
    color: #24435f;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
}

.menu-examples__actions {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.menu-examples__actions .cta {
    min-width: 178px;
    min-height: 44px;
    font-size: 14px;
}

.menu-example-viewer {
    width: fit-content;
    height: fit-content;
    max-width: calc(100vw - 32px);
    max-height: calc(100svh - 32px);
    margin: auto;
    padding: 0;
    overflow: visible;
    border: 1px solid rgba(187, 216, 236, 0.92);
    border-radius: 8px;
    background: #f5fbff;
    color: #111827;
    box-shadow: 0 28px 80px rgba(5, 28, 48, 0.32);
    overscroll-behavior: contain;
}

.menu-example-viewer:not([open]) {
    display: none;
}

.menu-example-viewer[open] {
    display: block;
    animation: menuExampleViewerIn 160ms ease-out;
}

.menu-example-viewer::backdrop {
    background: rgba(5, 22, 37, 0.76);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.menu-example-viewer-open {
    overflow: hidden;
}

.menu-example-viewer__dialog {
    display: grid;
    grid-template-rows: auto auto;
    width: auto;
    height: auto;
    overflow: visible;
    border-radius: 8px;
}

.menu-example-viewer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding: 8px 10px 8px 18px;
    border-bottom: 1px solid rgba(185, 217, 239, 0.86);
    background: rgba(255, 255, 255, 0.92);
    border-radius: 8px 8px 0 0;
}

.menu-example-viewer__header > div {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 10px;
}

.menu-example-viewer__header strong {
    overflow: hidden;
    font-size: 15px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-example-viewer__header [data-example-viewer-counter] {
    flex: 0 0 auto;
    color: #637b8e;
    font-size: 12px;
    font-weight: 700;
}

.menu-example-viewer__close,
.menu-example-viewer__nav {
    appearance: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: #24435f;
    background: transparent;
    cursor: pointer;
}

.menu-example-viewer__close {
    flex: 0 0 44px;
    font-size: 28px;
    line-height: 1;
}

.menu-example-viewer__nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    border: 1px solid rgba(185, 217, 239, 0.9);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 18px rgba(36, 67, 95, 0.12);
    font-size: 38px;
    line-height: 1;
}

.menu-example-viewer__nav--prev {
    left: 0;
    transform: translate(-50%, -50%);
}

.menu-example-viewer__nav--next {
    right: 0;
    transform: translate(50%, -50%);
}

.menu-example-viewer__close:hover,
.menu-example-viewer__nav:hover {
    color: #075da8;
    background: #e8f5ff;
}

.menu-example-viewer__close:focus-visible,
.menu-example-viewer__nav:focus-visible {
    outline: 3px solid rgba(15, 122, 229, 0.38);
    outline-offset: 2px;
}

.menu-example-viewer__stage {
    position: relative;
    display: block;
    overflow: visible;
    padding: 10px;
    background: #eaf6fd;
    border-radius: 0 0 8px 8px;
}

.menu-example-viewer__stage figure {
    display: block;
    width: auto;
    height: auto;
    margin: 0;
}

.menu-example-viewer__stage img {
    display: block;
    position: static;
    width: auto;
    height: auto;
    max-width: calc(100vw - 54px);
    max-height: calc(92svh - 84px);
    background: transparent;
    filter: drop-shadow(0 12px 18px rgba(25, 61, 88, 0.18));
    object-fit: contain;
}

@keyframes menuExampleViewerIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 980px) {
    .menu-examples__gallery {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: calc((100% - 24px) / 3);
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        scroll-padding-inline: 4px;
        padding-bottom: 10px;
    }
}

@media (max-width: 640px) {
    .hero-actions {
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 1px;
        margin-top: 14px;
    }

    .hero-actions > a {
        width: auto;
        padding: 0 clamp(5px, 1.8vw, 9px);
        font-size: clamp(11px, 3.2vw, 12px);
    }

    .hero-actions .cta {
        flex: 0 0 auto;
        width: min(100%, 280px);
    }

    .hero-actions .hero-example-link {
        flex: 0 0 auto;
        min-height: 20px;
        padding-inline: 0;
        color: #3d708f;
        font-size: 11px;
        font-weight: 700;
        line-height: 1.15;
    }

    /* Keep the secondary link compact despite the shared CTA sizing rule above. */
    .hero-actions > a.hero-example-link {
        min-height: 20px;
    }

    .menu-examples {
        scroll-margin-top: 16px;
    }

    #menu-calc {
        scroll-margin-top: 0;
    }

    .menu-examples__head h2 {
        font-size: 22px;
    }

    .menu-examples__gallery {
        grid-auto-columns: calc((100% - 10px) / 2);
        gap: 10px;
    }

    .menu-example__frame {
        max-height: min(320px, 48svh);
    }

    .menu-example figcaption {
        min-height: 34px;
        font-size: 11px;
    }

    .menu-examples__actions .cta {
        width: 100%;
    }

    .menu-example-viewer {
        max-width: calc(100vw - 16px);
        max-height: calc(100svh - 16px);
    }

    .menu-example-viewer__header {
        min-height: 52px;
        padding: 6px 6px 6px 12px;
    }

    .menu-example-viewer__header strong {
        font-size: 13px;
    }

    .menu-example-viewer__stage {
        padding: 8px;
    }

    .menu-example-viewer__stage img {
        max-width: calc(100vw - 34px);
        max-height: calc(100svh - 86px);
    }

    .menu-example-viewer__nav--prev {
        left: 4px;
        transform: translateY(-50%);
    }

    .menu-example-viewer__nav--next {
        right: 4px;
        transform: translateY(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-actions > a,
    .menu-examples__actions > a,
    .menu-example-viewer[open] {
        transition: none;
        animation: none;
    }
}
