/* =========================
   Global
========================= */
* {
    box-sizing: border-box;
    font-family: system-ui, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #f6f6f6;
}

.no-scroll {
    overflow: hidden;
    height: 100vh;
}

/* =========================
   Top Bar (HEADER) — GRID
   Left: burger + title
   Center: add buttons
   Right: login/logout
========================= */
/* TRUE CENTERED HEADER */
.top-bar{
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* left and right equal */
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.top-left{
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.top-center{
    justify-self: center; /* true center */
    display: flex;
    gap: .75rem;
}

.top-right{
    justify-self: end;
    display: flex;
    gap: .75rem;
}

/* keep title from stealing space */
.top-bar h1{
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40vw; /* optional: prevents huge title pushing */
}

.burger{
    font-size: 1.5rem;
    background: #7b2d2d;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
}

/* Header links styled (override bootstrap link styles) */
.top-bar a.top-link{
    text-decoration: none !important;
    padding: .45rem .75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: .95rem;
    border: 1px solid rgba(123,45,45,0.25);
    color: #7b2d2d !important;
    background: #fff;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.top-bar a.top-link:hover{
    background: #7b2d2d;
    color: #fff !important;
    border-color: #7b2d2d;
}

.top-bar a.top-link.primary{
    background: #7b2d2d;
    border-color: #7b2d2d;
    color: #fff !important;
}

.top-bar a.top-link.primary:hover{
    background: #620F0F;
    border-color: #620F0F;
}

.top-bar a.top-link.danger:hover{
    background: #222;
    border-color: #222;
}

/* =========================
   Side Menu
========================= */
.side-menu {
    position: fixed;
    top: 0;
    left: -260px;
    width: 260px;
    height: 100%;
    background: #7b2d2d;
    padding: 2rem 1rem;
    transition: left 0.3s ease;
    z-index: 20;

    overflow-y: auto;        
    -webkit-overflow-scrolling: touch;
}

.side-menu.open {
    left: 0;
}

.side-menu nav a {
    display: block;
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.side-menu .nav-title {
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    display: block;
    text-align: center;
}

.side-menu .nav-group + .nav-group {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.25);
}

/* =========================
   Overlay
========================= */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 15;
}

.overlay.show {
    opacity: 1;
    pointer-events: all;
}

/* =========================
   Sections + Cards
========================= */
.menu-section {
    padding: 1rem;
}

.menu-section h2 {
    margin-bottom: 0.5rem;
}

.menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 2rem;
}

.menu-card {
    display: flex;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    height: auto;
    cursor: pointer;
    border-radius: 12px;
}

.menu-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.menu-info h3 {
    margin: 0 0 0.3rem;
}

/* Image column */
.image-wrap {
    width: 200px;
    height: 100%;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.image-wrap img {
    width: 100%;
    flex: 1;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

#dishImage {
    border-radius: 0 0 12px 12px;
}

.meta.under-image {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    font-size: 0.85rem;
    background: #fff;
}

.ingredients {
    font-size: 0.85rem;
    color: #555;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.meta {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.price {
    font-weight: 700;
    color: #7b2d2d;
}

/* =========================
   Dish Modal
========================= */
.dish-modal {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 50;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.dish-modal.show {
    transform: translateY(0);
}

.dish-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #222;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.dish-header .title {
    font-size: 1.1rem;
    font-weight: 600;
}

.close-btn {
    background: #7b2d2d;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
}

.close-btn:hover {
    background: #620F0F;
}

.dish-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.dish-content img {
    width: 100%;
    max-width: 450px;
    height: 280px;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

.dish-body {
    padding: 1rem;
    max-width: 450px;
    margin: 0 auto;
}

.dish-meta {
    display: flex;
    gap: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.dish-body h2 {
    color: #620F0F;
    margin-bottom: 0.5rem;
}

.dish-body h4 {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #620F0F;
    color: #620F0F;
}

/* =========================
   Responsive
========================= */
@media (max-width: 900px) {
    .menu-items {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .top-bar{
        grid-template-columns: 1fr auto; /* left (wrap) | right */
        grid-template-areas:
            "left right"
            "center center";
    }

    .top-left{ grid-area: left; }
    .top-right{ grid-area: right; }
    .top-center{
        grid-area: center;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .image-wrap{
        width: 160px;
    }
}
