@import url("../fontawesome/css/fontawesome.min.css");
@import url("../fontawesome/css/solid.min.css");

:root {
    --green: #b6d49a;
    --green-dark: #204b3b;
    --green-darker: #102c24;
    --green-light: #d8ae68;
    --bg-dark: #f4f0e6;
    --bg-darker: #0b211b;
    --text: #1b3028;
    --text-dim: #68746b;
    --border: rgba(16, 44, 36, 0.13);
    --card: #fffdf8;
    --placeholder: #e7ecdf;
}

:root[data-theme="dark"] {
    --bg-dark: #091b16;
    --bg-darker: #0b211b;
    --text: #f2f1e8;
    --text-dim: #a4b0a7;
    --border: rgba(182, 212, 154, 0.15);
    --card: rgba(15, 39, 31, 0.88);
    --placeholder: #1b362b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image:
        radial-gradient(ellipse at 15% 35%, rgba(182, 212, 154, 0.11), transparent 30rem),
        radial-gradient(ellipse at 85% 72%, rgba(216, 174, 104, 0.08), transparent 28rem);
    transition: background-color 300ms ease, color 300ms ease;
}

:root[data-theme="dark"] body {
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(ellipse at 14% 20%, rgba(65, 116, 78, 0.22), transparent 34rem),
        radial-gradient(ellipse at 88% 42%, rgba(170, 132, 70, 0.12), transparent 30rem),
        radial-gradient(ellipse at 38% 96%, rgba(35, 95, 74, 0.2), transparent 38rem),
        linear-gradient(135deg, #081a15, #102d23 48%, #0b211b 76%, #1b3024);
    background-size: 180% 180%;
    animation: menu-dark-atmosphere 28s ease-in-out infinite alternate;
}

.header {
    position: relative;
    isolation: isolate;
    background:
        radial-gradient(ellipse at 78% 105%, rgba(182, 212, 154, 0.14), transparent 38%),
        linear-gradient(122deg, #0b211b 0%, #102c24 62%, #17392c 100%);
    background-size: 180% 180%;
    animation: menu-header-atmosphere 24s ease-in-out infinite alternate;
    padding: clamp(34px, 6vw, 62px) clamp(16px, 4vw, 40px) clamp(38px, 5vw, 58px);
    text-align: center;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
        radial-gradient(circle at 1px 1px, rgba(236, 240, 224, 0.12) 1px, transparent 0);
    background-size: 34px 34px;
    opacity: 0.22;
}

.header::after {
    position: absolute;
    z-index: -1;
    top: -35%;
    right: -8%;
    width: min(62vw, 650px);
    aspect-ratio: 1;
    border: 1px solid rgba(211, 226, 189, 0.12);
    border-radius: 50%;
    box-shadow: 0 0 0 48px rgba(211, 226, 189, 0.025), 0 0 0 96px rgba(211, 226, 189, 0.02);
    content: "";
    pointer-events: none;
}

.header-content { position: relative; z-index: 1; }

.theme-toggle {
    position: absolute;
    top: -10px;
    right: clamp(0px, 1vw, 14px);
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.82);
    font: inherit;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.theme-toggle:hover {
    border-color: var(--green);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 4px;
}

.theme-toggle-icon {
    color: var(--green);
    font-size: 0.95rem;
    line-height: 1;
}

.header-home-link {
    position: absolute;
    top: 0;
    left: clamp(0px, 1vw, 14px);
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-decoration: none;
    transition: color 160ms ease;
}

.header-home-link .fa-solid { color: var(--green); font-size: 1rem; }
.header-home-link:hover { color: #fff; }
.header-home-link:focus-visible,
.export-link:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 5px;
}

.header img {
    width: clamp(112px, 18vw, 190px);
    height: auto;
    margin: 8px auto clamp(8px, 1.5vw, 14px);
    max-width: 100%;
    filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.16));
}

.header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2.6rem, 7vw, 5rem);
    font-weight: 500;
    letter-spacing: -0.045em;
    color: #fff;
    text-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
    margin-bottom: 10px;
    line-height: 1.1;
}

.header-sub {
    font-size: clamp(0.76rem, 1.8vw, 0.9rem);
    color: rgba(255, 255, 255, 0.68);
    letter-spacing: 0.13em;
    text-transform: uppercase;
    padding: 0 10px;
}

.header-line {
    width: 46px;
    height: 1px;
    background: var(--green-light);
    margin: clamp(18px, 3vw, 24px) auto 0;
}

.search-wrap {
    margin: clamp(18px, 3vw, 24px) auto 0;
    max-width: 560px;
}

.menu-search {
    width: 100%;
    min-height: 54px;
    padding: 14px 21px;
    border: 1px solid rgba(255, 255, 255, 0.23);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.menu-search::placeholder {
    color: rgba(255, 255, 255, 0.62);
}

.menu-search:focus {
    border-color: var(--green);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 4px rgba(182, 212, 154, 0.12);
}

.export-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
    padding: 11px 16px;
    border: 1px solid rgba(182, 212, 154, 0.35);
    background: transparent;
    color: var(--green);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.export-link:hover {
    border-color: var(--green);
    background: rgba(182, 212, 154, 0.12);
    color: #fff;
    transform: translateY(-1px);
}

.print-link { cursor: pointer; }

.menu-board {
    max-width: 1320px;
    margin: 0 auto;
    padding: clamp(28px, 5vw, 58px) clamp(14px, 3vw, 30px) clamp(48px, 7vw, 82px);
}

:root[data-theme="dark"] .menu-board {
    background:
        radial-gradient(ellipse at 50% 0, rgba(182, 212, 154, 0.035), transparent 55%);
}

.menu-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: clamp(18px, 3vw, 34px);
}

.menu-col { min-width: 0; }

@media (max-width: 768px) {
    .menu-columns { grid-template-columns: 1fr; gap: 0; }
}

.category-block {
    margin-bottom: clamp(18px, 2.5vw, 28px);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    box-shadow: 0 8px 28px rgba(16, 44, 36, 0.045);
    transition: background-color 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}

:root[data-theme="dark"] .category-block {
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.16), inset 0 1px rgba(255, 255, 255, 0.025);
}

.cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 54px;
    padding: 0 clamp(14px, 2vw, 21px);
    background: linear-gradient(110deg, #102c24, #17392c 58%, #10271f);
}

.cat-bar {
    min-width: 0;
    display: flex;
    align-items: center;
    padding: 0;
}

.cat-bar-arrow { display: none; }

.cat-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.25rem, 2.5vw, 1.55rem);
    letter-spacing: 0.12em;
    color: #fff;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.cat-count {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.67);
    font-weight: 600;
    letter-spacing: 0.08em;
    white-space: nowrap;
    flex-shrink: 0;
}

.menu-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 0 clamp(14px, 2vw, 21px);
    padding: clamp(13px, 1.5vw, 16px) 0;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.menu-row:last-child { border-bottom: none; }

.item-image-wrapper {
    width: 74px;
    min-width: 74px;
    height: 74px;
    border-radius: 5px;
    overflow: hidden;
    background: var(--placeholder);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #e7ecdf 0%, #f5f3e9 100%);
    color: var(--green-dark);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

:root[data-theme="dark"] .image-placeholder {
    background: linear-gradient(135deg, #1b362b 0%, #233d30 100%);
    color: var(--green);
}

.menu-left {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.menu-name-row {
    display: flex;
    align-items: baseline;
    width: 100%;
    gap: 10px;
}

.menu-name {
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
}

.menu-dots {
    flex: 1;
    min-width: 24px;
    border-bottom: 1px dotted rgba(16, 44, 36, 0.22);
    height: 0.55em;
    display: block;
}

.menu-price {
    font-size: clamp(0.95rem, 2vw, 1rem);
    font-weight: 700;
    color: var(--green-dark);
    white-space: nowrap;
    flex-shrink: 0;
}

:root[data-theme="dark"] .menu-price { color: var(--green); }
:root[data-theme="dark"] .menu-dots { border-color: rgba(182, 212, 154, 0.25); }

.menu-desc {
    font-size: clamp(0.75rem, 1.5vw, 0.82rem);
    color: var(--text-dim);
    margin-top: 6px;
    font-style: italic;
    line-height: 1.45;
    word-wrap: break-word;
}

@media (max-width: 768px) {
    /* Keep rows side-by-side on most phones while making the image smaller */
    .menu-row {
        flex-direction: row;
        gap: 12px;
        align-items: center;
    }
    .menu-name-row {
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }
    .menu-name {
        white-space: normal;
        flex: 1 1 auto;
    }
    .menu-dots { display: none; }
    .menu-price {
        margin-left: auto;
        flex-shrink: 0;
    }
    .item-image-wrapper {
        width: 72px;
        min-width: 72px;
        height: 72px;
        border-radius: 5px;
    }
}

@media (max-width: 420px) {
    /* Very narrow phones */
    .item-image-wrapper {
        width: 64px;
        min-width: 64px;
        height: 64px;
        border-radius: 10px;
    }
    .menu-name { font-size: 0.98rem; }
    .menu-price { font-size: 0.98rem; }
}

.subcat-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--green-dark);
    margin: 0;
    padding: 15px clamp(14px, 2vw, 21px) 5px;
    border-left: 0;
    background: var(--card);
}

:root[data-theme="dark"] .subcat-label {
    color: var(--green);
    background: transparent;
}

.menu-footer {
    text-align: center;
    padding: clamp(26px, 4vw, 38px) clamp(12px, 3vw, 24px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--green-darker);
    color: rgba(255, 255, 255, 0.64);
    font-size: clamp(0.7rem, 1.5vw, 0.8rem);
    letter-spacing: 0.04em;
}

:root[data-theme="dark"] .menu-footer {
    background:
        radial-gradient(ellipse at 80% 0, rgba(182, 212, 154, 0.08), transparent 42%),
        linear-gradient(115deg, #081a15, #102c24 60%, #0b211b);
}

.menu-footer a:hover {
    text-decoration: none;
    color: #fff !important;
    cursor: pointer;
}

.menu-footer span {
    color: var(--green);
    font-weight: 700;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 12mm 14mm;
    }
    :root[data-theme="dark"] {
        --bg-dark: #fff;
        --text: #1b3028;
        --text-dim: #68746b;
        --border: rgba(16, 44, 36, 0.13);
        --card: #fffdf8;
        --placeholder: #e7ecdf;
        --green: #204b3b;
    }
    html, body {
        overflow: visible;
        max-width: none;
        background: #fff !important;
        background-image: none !important;
        color: #1b3028 !important;
        animation: none !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .header { padding: 24px 18px 18px; }
    .header-home-link { display: none; }
    .menu-board { max-width: none; padding: 18px 0 24px; }
    .category-block { box-shadow: none; break-inside: avoid; }
    .export-link { display: none !important; }
    .menu-footer { padding: 18px 0 0; }
}

.state-box {
    text-align: center;
    padding: clamp(40px, 10vw, 80px) clamp(16px, 4vw, 20px);
    grid-column: 1 / -1;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    box-shadow: 0 8px 28px rgba(16, 44, 36, 0.045);
}

:root[data-theme="dark"] .state-box {
    border-color: var(--border);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.16);
}

.state-box h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    color: var(--green-dark);
    margin-bottom: 10px;
}

:root[data-theme="dark"] .state-box h2 { color: var(--green); }

.state-box p {
    color: var(--text-dim);
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.error h2 { color: #a43c2e; }
body, html { overflow-x: hidden; max-width: 100vw; }

@keyframes menu-dark-atmosphere {
    0% { background-position: 0% 35%; }
    50% { background-position: 70% 55%; }
    100% { background-position: 100% 35%; }
}

@keyframes menu-header-atmosphere {
    0% { background-position: 0% 45%; }
    100% { background-position: 100% 55%; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
.scroll-top-button {
    position: fixed;
    z-index: 20;
    right: clamp(16px, 3vw, 32px);
    bottom: clamp(16px, 3vw, 32px);
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid rgba(24, 38, 30, 0.18);
    border-radius: 50%;
    background: #b6d49a;
    color: #102c24;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    font-size: 1rem;
    cursor: pointer;
    transition: transform 160ms ease, background-color 160ms ease;
}

.scroll-top-button[hidden] { display: none; }
.scroll-top-button:hover { transform: translateY(-3px); background: #d8e6c9; }
.scroll-top-button:focus-visible { outline: 2px solid #102c24; outline-offset: 3px; }

.menu-page-footer {
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: 42px 18px 32px;
    border-top: 1px solid rgba(182, 212, 154, 0.12);
    background:
        radial-gradient(ellipse at 50% 0, rgba(182, 212, 154, 0.08), transparent 58%),
        linear-gradient(115deg, #081a15, #102c24 60%, #0b211b);
    color: rgba(225, 233, 223, 0.78);
    text-align: center;
}

.menu-page-footer p { margin: 0; }
.menu-page-tagline { color: #c8d6ca; font-size: 0.96rem; letter-spacing: 0.02em; }
.menu-page-copyright { font-size: 0.88rem; letter-spacing: 0.02em; }
.menu-page-credit { font-size: 0.82rem; }
.menu-page-credit a { color: #e7b45f; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.menu-page-credit a:hover { color: #ffd17e; }
.menu-page-credit a:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }

@media (max-width: 480px) {
    .menu-page-footer { gap: 12px; padding: 34px 18px 28px; }
    .menu-page-tagline { font-size: 0.88rem; }
    .menu-page-copyright { font-size: 0.78rem; }
}
