/* Public restaurant menu and checkout. Loads after Argon and custom.css, on those pages only.
   Colors and fonts come from tokens.css. Scripts rely on the IDs and category classes
   in restorants/show.blade.php, so style them here rather than renaming them. */

:root { --error: #B3261E; --ok: #11703C; }
:root[data-theme='dark'] { --error: #FF9C8A; --ok: #7FD6A1; }

body { background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 1.0625rem; }
.wrapper { background: var(--paper); }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .heading, .heading-small { color: var(--ink); font-family: var(--display); }
a { color: var(--ink); }
p, .description, label, .form-control-label { color: inherit; }
.text-muted { color: var(--muted) !important; }
.bg-white { background-color: var(--paper) !important; }
.bg-secondary { background-color: var(--surface) !important; }
.closed_time { color: var(--error); font-weight: 700; }
.opened_time { color: var(--ok); font-weight: 700; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }

/* Top bar */
#navbar-main, #navbar-main.custom-nav {
    background: var(--paper) !important;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
}
#navbar-main .nav-link, #navbar-main .nav-link-inner--text { color: var(--ink); }
[data-theme='dark'] #navbar-main .navbar-toggler-icon { filter: invert(1); }
[data-theme='dark'] .collapse-close .navbar-toggler span { background: var(--ink); }
@media (max-width: 991px) {
    #navbar-main .navbar-collapse { background: var(--paper); color: var(--ink); }
}

.btn { font-family: var(--display); text-transform: none; letter-spacing: 0; }
.btn-neutral, .btn-neutral:hover, .btn-neutral:focus {
    background: transparent;
    color: var(--ink);
    border: 1.5px solid var(--line);
    box-shadow: none;
}
.btn-primary, .btn-primary:hover, .btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active {
    background: var(--btn-bg);
    border-color: var(--btn-bg);
    color: var(--btn-ink) !important;
    box-shadow: none;
}
.btn-default, .btn-default:hover { background: var(--surface); border-color: var(--surface); color: var(--ink) !important; }
.btn-outline-primary, .btn-outline-primary:hover {
    background: transparent;
    border: 1.5px solid var(--ink);
    color: var(--ink);
}
.btn-outline-primary.active,
.btn-outline-primary:not(:disabled):not(.disabled).active,
.btn-outline-primary:not(:disabled):not(.disabled):active {
    background: var(--saffron);
    border-color: var(--saffron);
    color: var(--navy);
}
.badge-primary { background: var(--saffron); color: var(--navy); }

.theme-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle__sun { display: none; }
[data-theme='dark'] .theme-toggle__sun { display: block; }
[data-theme='dark'] .theme-toggle__moon { display: none; }

/* Menu top: cover and categories stay while the dishes scroll.
   The negative top lets the cover slide up until only its band is left, so no height
   ever changes during a scroll and the list cannot jump. */
.menu-top {
    --nav-h: 0px;
    --cover-h: 160px;
    --band-h: 72px;
    --glass: rgba(255, 255, 255, .55);
    position: sticky;
    top: calc(var(--nav-h) + var(--band-h) - var(--cover-h));
    z-index: 20;
    margin-top: var(--nav-h);
    background: var(--paper);
}
.menu-top--table { --band-h: 100px; }
.menu-top--plain { --cover-h: 104px; --band-h: 64px; }
.menu-top--plain.menu-top--table { --cover-h: 100px; --band-h: 100px; }
[data-theme='dark'] .menu-top { --glass: rgba(18, 21, 58, .65); }

.menu-hero__media { position: relative; height: var(--cover-h); background: var(--surface); }
.menu-hero__cover { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Floating pieces: the photo shows through a blurred veil, which keeps the text readable
   over both light and dark images. */
.menu-hero__chip,
.menu-hero__name:not(.sr-only),
.menu-floating #navbar-main .navbar-brand,
.menu-floating #navbar-main > .container-fluid > .navbar-toggler {
    background: var(--glass, rgba(255, 255, 255, .55));
    -webkit-backdrop-filter: blur(10px) saturate(1.4);
    backdrop-filter: blur(10px) saturate(1.4);
}
/* Logos are thin artwork, often on a white box: a denser veil, and the white melts into it. */
.menu-floating #navbar-main .navbar-brand { background: rgba(255, 255, 255, .8); }
html:not([data-theme='dark']) .menu-floating #navbar-main .navbar-brand img { mix-blend-mode: multiply; }
[data-theme='dark'] .menu-floating #navbar-main .navbar-brand,
[data-theme='dark'] .menu-floating #navbar-main > .container-fluid > .navbar-toggler { background: rgba(18, 21, 58, .65); }

.menu-hero__chips {
    position: absolute;
    right: 0;
    bottom: 8px;
    left: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.menu-hero__chip {
    min-width: 0;
    margin: 0;
    padding: 6px 12px;
    overflow: hidden;
    border-radius: 999px;
    color: var(--ink);
    font: 700 .875rem/1.2 var(--display);
    text-overflow: ellipsis;
    white-space: nowrap;
}
.menu-hero__hours { transition: opacity .15s linear; }
.menu-top .menu-hero__hours { color: var(--ink); }
.menu-hero__hours::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--ok);
    vertical-align: .05em;
}
.menu-hero__hours.closed_time::before { background: var(--error); }

/* Categories: their own band below the cover. */
.menu-top { border-bottom: 1px solid var(--line); }
.menu-top .tabbable .nav-pills { flex-wrap: nowrap; padding-bottom: 0; }
.menu-top .nav-pills .nav-item-category { margin-bottom: 0; padding-block: 8px; }
.menu-top .tabbable .nav-pills .nav-link { padding: 7px 12px; font-size: .8125rem; }
.menu-hero__name {
    margin: 0;
    color: var(--ink);
    font: 800 1rem/1.2 var(--display);
    letter-spacing: -.01em;
}
.menu-hero__name:not(.sr-only) {
    padding: 6px 12px;
    overflow: hidden;
    border-radius: 999px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.menu-notices > * { margin-block: 12px; }
.menu-floating--named #navbar-main .navbar-brand { visibility: hidden; }

/* Information and theme, inside the top menu */
.menu-nav-action { list-style: none; }
.menu-nav-info, #navbar-main .theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}
.theme-toggle__label--light, [data-theme='dark'] .theme-toggle__label--dark { display: none; }
[data-theme='dark'] .theme-toggle__label--light { display: inline; }

@media (max-width: 991px) {
    /* The logo sits in a corner cut out of the cover; the menu button floats over it. */
    .menu-floating #navbar-main, .menu-floating #navbar-main.custom-nav {
        padding: 0;
        border: 0;
        background: transparent !important;
        pointer-events: none;
    }
    .menu-floating #navbar-main > .container-fluid { padding-inline: 0 15px; }
    .menu-floating #navbar-main .navbar-brand,
    .menu-floating #navbar-main > .container-fluid > .navbar-toggler,
    .menu-floating #navbar-main .navbar-collapse { pointer-events: auto; }
    .menu-floating #navbar-main .navbar-brand,
    [data-theme='dark'] .menu-floating #navbar-main .navbar-brand {
        /* Padding, not flex: the theme script sets display inline on the logo. */
        align-self: flex-start;
        margin: 0;
        padding: 8px 14px 8px 15px;
        border-radius: 0 0 16px 0;
        background: var(--paper);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    .menu-floating #navbar-main .navbar-brand img { max-width: 170px; height: auto; max-height: 32px; }
    .menu-floating #navbar-main > .container-fluid > .navbar-toggler {
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        margin-top: 8px;
        align-self: flex-start;
        padding: 0;
        border-radius: 50%;
    }
    .menu-floating--named #navbar-main .navbar-brand { visibility: hidden; }

    /* Without a logo, the name takes its place in the same corner. */
    .menu-hero__name:not(.sr-only) {
        position: fixed;
        top: 0;
        left: 0;
        display: flex;
        align-items: center;
        max-width: calc(100vw - 74px);
        height: 48px;
        padding: 0 14px 0 15px;
        border-radius: 0 0 16px 0;
        background: var(--paper);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        font-size: 1.125rem;
    }

    .menu-top--compact .menu-hero__hours { opacity: 0; visibility: hidden; }

    /* Too little height to keep the cover: only the categories stay. */
    @media (max-height: 500px) {
        .menu-top, .menu-top--table, .menu-top--plain, .menu-top--plain.menu-top--table { --band-h: 0px; --cover-h: 120px; }
        .menu-floating #navbar-main { position: absolute; }
        .menu-top--compact .menu-hero__hours { opacity: 1; visibility: visible; }
        .menu-hero__name:not(.sr-only) { position: absolute; }
    }

    /* Rows in the open menu. */
    .menu-nav-info, #navbar-main .theme-toggle {
        justify-content: flex-start;
        gap: 6px;
        width: 100%;
        height: auto;
        min-height: 44px;
        padding: 8px 16px;
        border-radius: 0;
        font: 500 1rem/1.3 var(--body);
    }
    .menu-nav-info .fa, #navbar-main .theme-toggle svg { flex: none; width: 20px; text-align: center; }
}

@media (min-width: 992px) {
    /* The top bar stays solid here: search and "Your order" live in it. */
    .menu-top { --nav-h: 72px; --cover-h: 180px; --band-h: 52px; }
    .menu-top--table { --band-h: 52px; }
    .menu-top--plain, .menu-top--plain.menu-top--table { --cover-h: 52px; --band-h: 52px; }
    .menu-nav-label, .theme-toggle__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .menu-nav-action { margin-right: 4px; }
    .menu-nav-info, #navbar-main .theme-toggle { width: 44px; height: 44px; padding: 0; border-radius: 50%; }
}

@media (prefers-reduced-motion: reduce) {
    .menu-hero__hours { transition: none; }
}
.modal .list-inline { margin: 12px 0 0; }

/* Category tabs */
#restaurant-content { padding-top: 0; padding-bottom: 96px; }
.tabbable { background: var(--paper); margin-inline: -15px; padding-inline: 15px; }
.tabbable .nav-pills { margin-bottom: 0 !important; padding: 0; gap: 8px; scrollbar-width: none; }
.tabbable .nav-pills::-webkit-scrollbar { display: none; }
.nav-item-category { padding-block: 8px; padding-inline: 0 !important; flex: none; }
.nav-pills .nav-item { padding-right: 0; }
.tabbable .nav-pills .nav-link {
    margin: 0 !important;
    padding: 9px 16px;
    background: transparent;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    box-shadow: none;
    color: var(--ink);
    font: 700 .9375rem/1.2 var(--display);
}
.tabbable .nav-pills .nav-link.active {
    background: var(--saffron);
    border-color: var(--saffron);
    color: var(--navy);
}

/* Dishes */
.menu-category { padding-top: 36px; }
.menu-category h2 { margin: 0; font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -.02em; }
.menu-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; margin-top: 8px; }

.menu-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    padding: 16px 0;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.menu-item:hover .menu-item__name { text-decoration: underline; text-underline-offset: 3px; }
.menu-item:disabled { cursor: not-allowed; opacity: .6; }
.menu-item:disabled .menu-item__name { text-decoration: none; }
.menu-item__body { flex: 1; min-width: 0; display: block; }
.menu-item__head { display: flex; align-items: baseline; gap: 8px; }
.menu-item__name { min-width: 0; font: 700 1.125rem/1.25 var(--display); }
.menu-item__leader { flex: 1 1 12px; min-width: 12px; border-bottom: 2px dotted currentColor; opacity: .4; transform: translateY(-.25em); }
.menu-item__price { flex: none; font: 700 1.0625rem/1.25 var(--display); }
.menu-item__old { margin-right: 6px; color: var(--muted); font-weight: 500; text-decoration: line-through; }
.menu-item__description {
    display: -webkit-box;
    margin-top: 4px;
    color: var(--muted);
    font-size: .9375rem;
    line-height: 1.4;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.menu-item__stock { display: inline-block; margin-top: 6px; color: var(--error); font-size: .875rem; font-weight: 700; }
.menu-item__allergens { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.menu-item__allergens img { width: 22px; height: 22px; object-fit: contain; }
[data-theme='dark'] .menu-item__allergens img { padding: 2px; background: #FFFFFF; border-radius: 50%; }
.menu-item__image { flex: none; width: 88px; height: 88px; border-radius: 10px; object-fit: cover; background: var(--surface); }

.menu-empty { padding-block: 48px; color: var(--muted); }

/* The order bar: a kitchen ticket torn along its top edge */
.menu-order {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 18px 16px calc(14px + env(safe-area-inset-bottom));
    border: 0;
    background: var(--saffron);
    color: var(--navy);
    font: 700 1.0625rem/1.2 var(--display);
    text-align: left;
    cursor: pointer;
}
.menu-order::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: radial-gradient(circle at 7px 0, var(--paper) 4px, transparent 4.5px) 0 0 / 14px 6px repeat-x;
}
.menu-order__count {
    display: grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    padding: 0 7px;
    border-radius: 6px;
    background: var(--navy);
    color: var(--saffron);
    font-size: .9375rem;
}
.menu-order__label { flex: 1; min-width: 0; }
.menu-order__total { flex: none; }
.menu-order--added { animation: menu-order-added .4s ease-out; }
@keyframes menu-order-added {
    40% { transform: translateY(-6px); }
}
.menu-order:focus-visible { outline: 3px solid var(--navy); outline-offset: -6px; }
.footer { padding-bottom: 88px; }
@media (min-width: 861px) {
    .menu-order { right: 24px; bottom: 24px; left: auto; width: 420px; padding-bottom: 14px; border-radius: 0 0 10px 10px; }
}

/* Dialogs and forms */
.modal-content, .modal-body, .modal-header, .card, .card-header { background-color: var(--paper); color: var(--ink); }
.modal-header { border-color: var(--line); }
.modal-title { color: var(--ink); font-weight: 800; font-size: 1.375rem; }
.modal .close, .modal .close span { color: var(--ink); opacity: 1; }
.modal .card { box-shadow: none !important; }
#modalImg { max-width: 100%; height: auto; max-height: 300px; border-radius: 12px; object-fit: cover; }
.new-price { color: var(--ink); font: 800 1.625rem/1.2 var(--display); }
#modalDescription { margin-top: 8px; color: var(--muted); }
.form-control, .form-control:focus {
    background: var(--paper);
    border: 1.5px solid var(--muted);
    box-shadow: none;
    color: var(--ink);
}
.form-control:focus { outline: 3px solid var(--saffron); border-color: var(--ink); }
.custom-control-label { color: var(--ink); }
.custom-control-label::before { background: var(--paper); border-color: var(--muted); }
.custom-control-input:checked ~ .custom-control-label::before { background: var(--saffron); border-color: var(--saffron); }
.nav-pills .nav-link { background: transparent; color: var(--ink); box-shadow: none; border: 1.5px solid var(--line); }
.nav-pills .nav-link.active { background: var(--saffron); color: var(--navy); }
.dropdown-menu { background: var(--paper); border: 1px solid var(--line); }
.dropdown-item { color: var(--ink); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--surface); color: var(--ink); }

/* Dish search */
.select2-container--default .select2-selection--single,
.itemsSearch .select2-container--default .select2-selection--single {
    background: var(--paper);
    border: 1.5px solid var(--line);
    color: var(--ink);
}
.select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--ink); }
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--muted); }
.select2-dropdown { background: var(--paper); border-color: var(--line); color: var(--ink); }
.select2-search--dropdown .select2-search__field { background: var(--paper); border-color: var(--muted); color: var(--ink); }
.select2-results__group { color: var(--muted); }
.select2-results__option { color: var(--ink); }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--saffron); color: var(--navy); }

/* Footer */
.footer { background: var(--paper); border-top: 1px solid var(--line); color: var(--muted); }
.footer .copyright, .footer a, .footer .nav-link { color: var(--muted); }

@media (max-width: 860px) {
    .menu-items { grid-template-columns: minmax(0, 1fr); }
    .menu-hero { margin-top: 64px; }
}

@media (max-width: 420px) {
    .menu-item__image { width: 72px; height: 72px; }
}
