:root {
    --bg: #0a0a0a;
    --panel: #111111;
    --panel-soft: #151515;
    --line: #242424;
    --line-strong: #3a3a3a;
    --text: #ffffff;
    --muted: #8f8f8f;
    --dim: #666666;
    --brand: #d1002c;
    --brand-dark: #970020;
    --paper: #f8f8f8;
    --ink: #111111;
    --danger: #c73535;
    --green: #2ea66b;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--bg);
    font-family: 'Montserrat', Arial, sans-serif;
    line-height: 1.55;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

.menu-page {
    padding-bottom: 78px;
}

.menu-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 14px;
    align-items: center;
    min-height: 76px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 10, 10, 0.96);
    backdrop-filter: blur(10px);
}

.brand-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 48px;
    overflow: hidden;
}

.brand-link img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.topbar-copy {
    min-width: 0;
}

.topbar-copy span,
.eyebrow {
    display: block;
    color: var(--brand);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.topbar-copy strong {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--brand);
    color: var(--text);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-decoration: none;
    text-transform: uppercase;
}

.menu-main,
.admin-main {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.menu-hero,
.admin-hero,
.admin-gate {
    padding: 36px 16px 24px;
}

.menu-hero {
    display: grid;
    gap: 22px;
    justify-items: center;
    text-align: center;
}

.menu-hero > div {
    max-width: 680px;
}

.menu-hero .search-field {
    width: min(520px, 100%);
    text-align: left;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 12px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2.4rem, 13vw, 5rem);
    line-height: 0.95;
    letter-spacing: 0;
    text-transform: uppercase;
}

h2 {
    margin-bottom: 18px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.6rem, 8vw, 2.4rem);
    line-height: 1;
    letter-spacing: 0;
    text-transform: uppercase;
}

h3 {
    margin-bottom: 8px;
    font-size: 15px;
    text-transform: uppercase;
}

.menu-hero p,
.admin-hero p,
.inline-status {
    color: var(--muted);
    font-size: 13px;
}

.search-field,
.form-stack label,
.category-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line-strong);
    border-radius: 0;
    color: var(--text);
    background: #0d0d0d;
    padding: 12px 13px;
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand);
}

.category-rail {
    position: sticky;
    top: 76px;
    z-index: 15;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(10, 10, 10, 0.96);
    scrollbar-width: none;
}

.category-rail::-webkit-scrollbar {
    display: none;
}

.category-rail button,
.segment-row button {
    min-height: 38px;
    flex: 0 0 auto;
    border: 1px solid var(--line-strong);
    color: var(--text);
    background: transparent;
    padding: 0 14px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
}

.category-rail button.is-active,
.segment-row button.is-active {
    border-color: var(--brand);
    background: var(--brand);
}

.menu-sections {
    padding: 18px 16px 26px;
}

.menu-section {
    scroll-margin-top: 140px;
    padding-top: 26px;
}

.menu-section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.menu-section-head span {
    flex: 0 0 auto;
    color: var(--dim);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.product-list {
    display: grid;
    gap: 18px;
}

.product-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.product-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background: #050505;
}

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

.product-info {
    min-width: 0;
    padding: 20px;
}

.product-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.product-name {
    min-width: 0;
    margin: 0;
    color: var(--text);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.product-desc {
    margin: 0;
    color: #b7b7b7;
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-line;
}

.product-allergens {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: #d8d8d8;
    font-size: 14px;
    line-height: 1.45;
}

.product-allergens strong {
    color: var(--text);
    font-weight: 800;
}

.product-allergen-text {
    min-width: 0;
}

.product-allergen-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-top: -1px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
}

.product-price {
    flex: 0 0 auto;
    color: var(--brand);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 28px;
    line-height: 1;
    white-space: nowrap;
}

.empty-state {
    border: 1px solid var(--line);
    padding: 28px 18px;
    color: var(--muted);
    text-align: center;
}

.menu-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 25;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: 66px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 10, 10, 0.97);
    backdrop-filter: blur(12px);
}

.menu-bottom-nav a,
.menu-bottom-nav button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
    background: transparent;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
}

.menu-bottom-nav button:last-child {
    border-right: 0;
}

.bottom-sheet {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: flex-end;
    background: rgba(0, 0, 0, 0.62);
}

.sheet-panel {
    width: 100%;
    padding: 22px 16px 28px;
    border-top: 1px solid var(--line-strong);
    background: #0f0f0f;
}

.sheet-head,
.panel-title-row,
.admin-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.icon-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line-strong);
    color: var(--text);
    background: transparent;
    cursor: pointer;
}

.contact-list {
    display: grid;
    gap: 10px;
}

.contact-list a,
.primary-action,
.ghost-action,
.danger-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border: 1px solid var(--line-strong);
    padding: 0 16px;
    color: var(--text);
    background: transparent;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
}

.primary-action {
    border-color: var(--brand);
    background: var(--brand);
}

.primary-action:hover {
    border-color: var(--brand-dark);
    background: var(--brand-dark);
}

.ghost-action:hover {
    border-color: var(--text);
}

.danger-action {
    border-color: var(--danger);
    color: #fff;
    background: rgba(199, 53, 53, 0.18);
}

.small-action {
    min-height: 36px;
    padding: 0 12px;
    font-size: 10px;
}

.admin-page {
    padding-bottom: 32px;
}

.admin-gate {
    width: min(520px, calc(100% - 32px));
    margin: 28px auto;
    border: 1px solid var(--line);
    background: var(--panel);
}

.form-stack {
    display: grid;
    gap: 16px;
}

.admin-hero {
    display: grid;
    gap: 18px;
    border-bottom: 1px solid var(--line);
}

.admin-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.admin-grid {
    display: grid;
    gap: 16px;
    padding: 16px;
}

.admin-panel {
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 16px;
}

.search-input {
    margin-bottom: 12px;
}

.segment-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 12px;
    scrollbar-width: none;
}

.segment-row::-webkit-scrollbar {
    display: none;
}

.admin-list,
.category-admin-list {
    display: grid;
    gap: 8px;
    max-height: 58vh;
    overflow: auto;
    padding-right: 3px;
}

.admin-item-button,
.category-button {
    display: grid;
    gap: 5px;
    width: 100%;
    border: 1px solid var(--line);
    color: var(--text);
    background: #0d0d0d;
    padding: 12px;
    text-align: left;
    cursor: pointer;
}

.admin-item-button.is-active,
.category-button.is-active {
    border-color: var(--brand);
}

.admin-item-title {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.admin-item-title strong {
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-item-meta,
.category-meta {
    color: var(--muted);
    font-size: 11px;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--green);
}

.status-dot.is-draft {
    background: #d4a72c;
}

.status-dot.is-archived,
.status-dot.is-unavailable {
    background: var(--danger);
}

.form-row,
.category-form {
    display: grid;
    gap: 14px;
}

.switch-row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    color: var(--text);
    font-size: 13px;
    letter-spacing: 0;
    text-transform: none;
}

.switch-row input {
    width: 20px;
    min-height: 20px;
    accent-color: var(--brand);
}

.category-panel {
    margin: 0 16px 18px;
}

.category-form {
    margin-bottom: 16px;
}

.inline-status {
    min-height: 20px;
}

.inline-status.is-error {
    color: #ff8f8f;
}

.inline-status.is-ok {
    color: #8be0b1;
}

@media (min-width: 760px) {
    .menu-page {
        padding-bottom: 0;
    }

    .menu-topbar {
        grid-template-columns: 74px 1fr auto;
        padding: 16px 34px;
    }

    .menu-hero {
        grid-template-columns: 1fr;
        align-items: center;
        padding: 54px 28px 34px;
    }

    .category-rail {
        top: 84px;
        padding-inline: 28px;
    }

    .menu-sections {
        padding-inline: 28px;
    }

    .product-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .menu-bottom-nav {
        right: 26px;
        bottom: 24px;
        left: auto;
        width: min(430px, calc(100% - 52px));
        overflow: hidden;
        border: 1px solid rgba(255, 255, 255, 0.12);
    }

    .sheet-panel {
        width: min(420px, calc(100% - 32px));
        margin: 0 auto 28px;
        border: 1px solid var(--line-strong);
    }

    .admin-hero {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        padding-inline: 28px;
    }

    .admin-grid {
        grid-template-columns: minmax(280px, 0.85fr) minmax(420px, 1.15fr);
        align-items: start;
        padding: 20px 28px;
    }

    .category-panel {
        margin-inline: 28px;
    }

    .category-form {
        grid-template-columns: minmax(220px, 1fr) 100px auto auto auto;
        align-items: end;
    }
}
