/* =========================================================
   menu.css — Restaurant card menu layout
   Tropical Bold: square edges, coral accent lines, image-forward cards
   ========================================================= */

/* ----------------------------------------------------------
   Section wrapper
   ---------------------------------------------------------- */
.menu-section {
    padding: var(--section-pad);
    background: #fff;
}

.menu-section__inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.menu-section__header {
    text-align: center;
    margin-bottom: 3rem;
}

/* ----------------------------------------------------------
   Category tabs — pill style (filled on active, outlined on inactive)
   ---------------------------------------------------------- */
.menu-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 3rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.25rem 1rem;
}
.menu-tabs::-webkit-scrollbar { display: none; }

.menu-tab {
    flex-shrink: 0;
    padding: 0.45rem 1.15rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-primary);
    background: transparent;
    border: 1.5px solid var(--brand-primary);
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.18s, background 0.18s, border-color 0.18s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.menu-tab:hover {
    background: var(--brand-primary);
    color: var(--brand-accent, #fff);
}
.menu-tab.active,
.menu-tab--active {
    background: var(--brand-primary);
    color: var(--brand-accent, #fff);
    border-color: var(--brand-primary);
}

/* ----------------------------------------------------------
   Tab panels — Alpine x-show owns all visibility.
   ---------------------------------------------------------- */
/* (panels shown/hidden exclusively via Alpine x-show) */

/* ----------------------------------------------------------
   Menu card grid — max 3 columns desktop, 2 tablet, 1 mobile
   ---------------------------------------------------------- */
.menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
}
@media (max-width: 900px) {
    .menu-list { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
}
@media (max-width: 520px) {
    .menu-list { grid-template-columns: 1fr; gap: 1rem; }
}

/* ----------------------------------------------------------
   Individual menu card — rounded, subtle shadow, coral accent on hover
   ---------------------------------------------------------- */
.menu-item {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}
.menu-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.13);
}

/* Full-bleed thumbnail — 16:10 aspect ratio, gradient overlay */
.menu-item__thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--surface-alt);
    border-radius: 8px 8px 0 0;
    position: relative;
}
.menu-item__thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.28) 100%);
    pointer-events: none;
}
.menu-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}
.menu-item:hover .menu-item__thumb img { transform: scale(1.05); }

/* No-image placeholder */
.menu-item__thumb--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--text-muted);
}
.menu-item__thumb--placeholder svg {
    width: 2.5rem;
    height: 2.5rem;
    opacity: 0.2;
}

/* Card body */
.menu-item__body {
    flex: 1;
    padding: 0.875rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* Name + price row */
.menu-item__name-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.menu-item__name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    flex: 1;
}

/* Leader unused in card layout */
.menu-item__leader { display: none; }

.menu-item__price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--brand-primary);
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 0.1rem;
}
.menu-item__price--tbc {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
    font-style: italic;
}

/* Description */
.menu-item__desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Badges row */
.menu-item__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.15rem;
}

/* Action buttons */
.menu-item__actions {
    display: flex;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.75rem;
    flex-wrap: wrap;
}
.menu-item__actions .btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.9rem;
    min-height: 44px;
    flex: 1;
    justify-content: center;
}
@media (max-width: 380px) {
    .menu-item__actions { flex-direction: column; }
}

/* ----------------------------------------------------------
   Badges (dietary flags) — square
   ---------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
}
.badge--vegan  { background: #d4edda; color: #155724; }
.badge--veg    { background: #d1e7dd; color: #0a3622; }
.badge--gf     { background: #fff3cd; color: #856404; }
.badge--spicy  { background: #f8d7da; color: #842029; }
.badge--adult  { background: #f8d7da; color: #842029; }
.badge--popular{ background: #cff4fc; color: #055160; }

/* ----------------------------------------------------------
   Section divider header
   ---------------------------------------------------------- */
.menu-section-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2.5rem 0 1.5rem;
}
.menu-section-divider__line {
    flex: 1;
    height: 1px;
    background: var(--border);
}
.menu-section-divider__label {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-primary);
    white-space: nowrap;
}

/* ----------------------------------------------------------
   Empty state
   ---------------------------------------------------------- */
.menu-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ----------------------------------------------------------
   Cart Drawer (items list — consolidated here)
   ---------------------------------------------------------- */
.cart-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.cart-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; padding-bottom: 0; }

.cart-item__photo {
    width: 3rem; height: 3rem;
    overflow: hidden;
    flex-shrink: 0;
}
.cart-item__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cart-item__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.cart-item__name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-item__price {
    font-size: 0.8rem;
    color: var(--brand-secondary);
    font-weight: 600;
}

.cart-item__qty {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.cart-item__qty span {
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 1.25rem;
    text-align: center;
    color: var(--text-primary);
}
.cart-item__btn {
    width: 1.6rem; height: 1.6rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cart-item__btn:hover { background: var(--brand-secondary); border-color: var(--brand-secondary); color: #fff; }

.cart-item__remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}
.cart-item__remove:hover { color: #ef4444; }
.cart-item__remove svg { width: 1rem; height: 1rem; }

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0 0;
    margin-top: 0.5rem;
    border-top: 2px solid var(--border);
    font-size: 1rem;
    color: var(--text-primary);
}
.cart-total span { font-weight: 600; }
.cart-total strong { font-size: 1.1rem; color: var(--brand-secondary); }

.cart-empty {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    padding: 2rem 1rem;
    margin: 0;
}

/* ----------------------------------------------------------
   Item Detail Drawer — square, coral left accent
   ---------------------------------------------------------- */
.item-drawer {
    position: fixed;
    inset: 0;
    z-index: 300;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0s 0.35s;
}
.item-drawer--open {
    pointer-events: all;
    visibility: visible;
    transition: visibility 0s 0s;
}

.item-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.35s ease;
}
.item-drawer--open .item-drawer__backdrop {
    opacity: 1;
}

/* Desktop: right drawer, square, coral left border */
.item-drawer__panel {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: min(440px, 100vw);
    background: #fff;
    box-shadow: -4px 0 40px rgba(0,0,0,.18);
    border-left: 4px solid var(--brand-secondary);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
}
.item-drawer--open .item-drawer__panel {
    transform: translateX(0);
}

/* Coral top bar above the photo */
.item-drawer__panel::before {
    content: '';
    display: block;
    height: 4px;
    background: var(--brand-secondary);
    flex-shrink: 0;
}

/* Close button */
.item-drawer__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 10;
    background: rgba(255,255,255,.92);
    border: 1px solid var(--border);
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    padding: 0;
}
.item-drawer__close:hover {
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.item-drawer__close svg { width: 1rem; height: 1rem; }

/* Photo area */
.item-drawer__photo {
    width: 100%;
    aspect-ratio: 4 / 3;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--surface-alt);
    position: relative;
}
.item-drawer__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.item-drawer__photo--placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}
.item-drawer__photo--placeholder svg {
    width: 4rem;
    height: 4rem;
    opacity: 0.2;
}

/* Body */
.item-drawer__body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

/* Name + price header */
.item-drawer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.item-drawer__name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.25;
    flex: 1;
}

.item-drawer__price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-secondary);
    white-space: nowrap;
    padding-top: 0.25rem;
    flex-shrink: 0;
}

/* Badges */
.item-drawer__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* Description */
.item-drawer__desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
}

/* Actions */
.item-drawer__actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* Mobile: bottom sheet — square top edge */
@media (max-width: 600px) {
    .item-drawer__panel {
        top: auto;
        left: 0; right: 0; bottom: 0;
        width: 100%;
        max-height: 92dvh;
        border-left: none;
        border-top: 4px solid var(--brand-secondary);
        transform: translateY(100%);
        box-shadow: 0 -4px 40px rgba(0,0,0,.18);
    }
    .item-drawer--open .item-drawer__panel {
        transform: translateY(0);
    }
    /* Remove the ::before bar on mobile since border-top handles it */
    .item-drawer__panel::before { display: none; }
}

/* ----------------------------------------------------------
   Responsive tweaks (card content — grid handled above)
   ---------------------------------------------------------- */
@media (max-width: 520px) {
    .menu-item__name  { font-size: 0.92rem; }
    .menu-item__price { font-size: 0.84rem; }
}
