/* ============================================
   Menu Page Styles
   Depends on: base.css
   ============================================ */

/* — Body Override — */
body {
    padding-bottom: 120px;
    /* space for floating fixed nav */
}

/* — Brand mark decorations — */
.brand-decor {
    position: fixed;
    z-index: 0;
    pointer-events: none;
    opacity: 0.07;
    color: var(--brand-red);
}

.brand-decor.top-right {
    top: 24px;
    right: 24px;
    width: 96px;
    height: 96px;
}

.brand-decor.bottom-left {
    bottom: 100px;
    left: 20px;
    width: 72px;
    height: 72px;
    opacity: 0.05;
}

/* — Header (Menu-specific) — */
header {
    padding: 50px 20px 40px;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 40px;
    background: var(--body-bg);
    clip-path: ellipse(55% 100% at 50% 100%);
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 140px;
    height: 140px;
    background: url("/images/icon-mark.svg") no-repeat bottom right;
    background-size: contain;
    opacity: 0.14;
    pointer-events: none;
}

.header-logo-img {
    width: min(380px, 80vw);
    height: auto;
}

.language-switch {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1100;
    border: 1px solid rgba(191, 33, 30, 0.35);
    background: rgba(255, 255, 255, 0.92);
    color: var(--brand-red);
    min-width: 74px;
    height: 40px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    cursor: pointer;
    backdrop-filter: blur(14px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
    transition:
        transform 360ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 360ms cubic-bezier(0.22, 1, 0.36, 1),
        background 360ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 300ms ease;
}

.language-switch:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.language-icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
    opacity: 0.85;
}

.language-text {
    line-height: 1;
}

/* — Bottom Navigation (Fixed) — */
nav {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: min(920px, calc(100% - 20px));
    background: rgba(31, 31, 31, 0.88);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(191, 33, 30, 0.35);
    border-radius: 16px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.35),
        0 2px 10px rgba(0, 0, 0, 0.18);
    z-index: 1000;
    overflow-x: auto;
    white-space: nowrap;
    animation: nav-float-in 0.6s ease both;
    transition:
        transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 280ms cubic-bezier(0.22, 1, 0.36, 1);
    --indicator-x: 0px;
    --indicator-w: 0px;
}

nav.nav-docked {
    position: absolute;
    top: var(--nav-docked-top, 0px);
    bottom: auto;
}

nav::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    width: var(--indicator-w);
    height: 2.5px;
    border-radius: 999px;
    background: var(--brand-red);
    transform: translateX(var(--indicator-x));
    transition:
        transform 340ms cubic-bezier(0.22, 1, 0.36, 1),
        width 340ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 240ms ease;
    opacity: 0.95;
    pointer-events: none;
}

nav::-webkit-scrollbar {
    height: 3px;
}

nav::-webkit-scrollbar-thumb {
    background: rgba(191, 33, 30, 0.45);
    border-radius: 2px;
}

nav a {
    display: inline-block;
    padding: 13px 18px;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 0.02em;
    border-bottom: 2px solid transparent;
    border-radius: 10px;
    position: relative;
    transition: color var(--transition-fast),
        border-color var(--transition-fast),
        background var(--transition-fast),
        transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 220ms ease;
}

nav a:hover,
nav a.active {
    color: var(--brand-white);
    border-bottom-color: transparent;
    background: rgba(191, 33, 30, 0.35);
    transform: translateY(-2px);
}

/* — Container — */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 20px;
    position: relative;
    z-index: 5;
    transition: opacity 420ms cubic-bezier(0.22, 1, 0.36, 1), transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.container.is-fading {
    opacity: 0.14;
    transform: translateY(2px);
}

body.lang-switching .container,
body.lang-switching .menu-footer-inner,
body.lang-switching nav {
    transition: opacity 380ms cubic-bezier(0.22, 1, 0.36, 1);
    opacity: 0.82;
}

#menu-container,
#category-nav,
.menu-footer-inner,
#language-switch .language-text {
    transition:
        filter 300ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 300ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: filter, opacity, transform;
}

body.lang-morph-out #menu-container,
body.lang-morph-out #category-nav,
body.lang-morph-out .menu-footer-inner,
body.lang-morph-out #language-switch .language-text {
    filter: blur(4px);
    opacity: 0.5;
    transform: translateY(1px);
}

body.lang-morph-in #menu-container,
body.lang-morph-in #category-nav,
body.lang-morph-in .menu-footer-inner,
body.lang-morph-in #language-switch .language-text {
    filter: blur(0);
    opacity: 1;
    transform: translateY(0);
}

/* — Sections — */
section {
    margin-bottom: 70px;
}

section h2 {
    font-size: 1.7rem;
    color: var(--black);
    padding-bottom: 14px;
    border-bottom: 2px solid var(--brand-red);
    flex: 1;
    letter-spacing: 0.04em;
}

/* — Menu Grid — */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
}

/* — Menu Item Card — */
.menu-item {
    background: var(--brand-white);
    backdrop-filter: blur(8px);
    padding: 24px 22px;
    border-radius: 16px;
    box-shadow:
        0 2px 8px rgba(31, 31, 31, 0.08),
        0 0 0 1px rgba(31, 31, 31, 0.08);
    position: relative;
    overflow: hidden;

    /* Entrance animation (controlled by JS IntersectionObserver) */
    opacity: 0;
    transform: translateY(20px);
    transition: transform var(--transition-fast),
        box-shadow var(--transition-fast),
        opacity 0.5s ease;
}

.menu-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at top right, var(--brand-red-soft), transparent 70%);
    pointer-events: none;
}

.menu-item:hover {
    transform: translateY(-7px);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.15);
}

/* — Item Content — */
.menu-item h3 {
    font-size: 1.15rem;
    color: var(--text-dark);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.menu-item h3 .item-name {
    flex: 1;
    word-wrap: break-word;
    line-height: 1.5;
}

.menu-item h3 .price {
    flex-shrink: 0;
    white-space: nowrap;
}

.item-name {
    flex: 1;
}

.price {
    color: var(--brand-white);
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    background: var(--brand-red);
    padding: 3px 10px;
    border-radius: 20px;
}

.description {
    color: var(--text-mid);
    margin-bottom: 14px;
    font-size: 0.9rem;
}

.details {
    color: var(--text-light);
    font-size: 0.83rem;
    padding-top: 12px;
    border-top: 1px dashed rgba(0, 0, 0, 0.15);
}

.brand-divider-img {
    width: min(52px, 14vw);
    height: auto;
    opacity: 0.85;
}

/* — Item Image — */
.menu-item-image-wrapper {
    margin-bottom: 12px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.menu-item-image {
    background-color: rgba(31, 31, 31, 0.72);
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* — Section divider — */
.brand-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 36px 0;
}

.brand-divider::before,
.brand-divider::after {
    content: '';
    flex: 1;
    max-width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(191, 33, 30, 0.45), transparent);
}

/* — Footer — */
.menu-footer {
    margin: 20px auto 140px;
    padding: 0 20px;
    max-width: 1200px;
    position: relative;
    z-index: 5;
}

.footer-tagline {
    font-weight: 700;
    color: var(--brand-red);
    letter-spacing: 0.02em;
}

.menu-footer-inner {
    border-top: 1px solid rgba(191, 33, 30, 0.2);
    padding: 20px 0 0;
    display: grid;
    gap: 8px;
    color: var(--text-mid);
    font-size: 0.9rem;
}

.footer-sticker {
    width: min(88px, 28vw);
    opacity: 0.85;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.16));
    animation: sticker-float 3.2s ease-in-out infinite;
}

.menu-footer p {
    margin: 0;
    line-height: 1.7;
}

.menu-footer a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.3);
}

.menu-footer a:hover {
    color: var(--brand-red);
    border-bottom-color: var(--brand-red);
}

.footer-social {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

@keyframes nav-float-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes sticker-float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

/* ============================================
   Responsive — Mobile
   ============================================ */
@media (max-width: 768px) {
    header {
        padding: 40px 16px 32px;
    }

    .header-logo {
        font-size: 2.8rem;
        letter-spacing: 0.08em;
    }

    .header-sub {
        font-size: 0.75rem;
        letter-spacing: 0.18em;
    }

    .container {
        padding: 30px 16px 90px;
    }

    section h2 {
        font-size: 1.4rem;
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }

    .menu-item {
        padding: 18px 16px;
    }

    nav a {
        padding: 12px 14px;
        font-size: 0.82rem;
    }

    .brand-divider-img {
        width: min(44px, 12vw);
    }

    .menu-footer {
        margin-bottom: 124px;
        padding: 0 16px;
    }

    .menu-footer-inner {
        font-size: 0.85rem;
    }

    .footer-sticker {
        display: block;
        width: min(140px, 46vw);
        margin: 0 auto 10px;
    }

    nav {
        bottom: 12px;
        width: calc(100% - 14px);
        border-radius: 12px;
    }

    .language-switch {
        top: 12px;
        right: 12px;
        min-width: 66px;
        height: 38px;
    }
}