/* ==========================================================================
   Bistro — restaurant / café menu
   --------------------------------------------------------------------------
   Not a shop: a menu. Dark, warm ground; sections you scroll rather than
   navigate; each item a single row (name, tags, price) with a small square
   photo and a "+" affordance; a sheet that slides up from the bottom of the
   phone for choices and add-ons; a bar at the foot of the screen once there
   is an order to place.

   Colours and fonts all come from the CSS custom properties the layout
   emits from the store's theme settings.
   ========================================================================== */

.theme-bistro {
    --header-h: 60px;
}

/* A dark theme has to tell the browser, or form controls render as light
   widgets on a dark page. */
.theme-bistro { color-scheme: dark; }

.theme-bistro .card,
.theme-bistro .site-header,
.theme-bistro .drawer,
.theme-bistro .modal__panel,
.theme-bistro .suggest,
.theme-bistro .nav__menu { background: var(--color-surface); }

.theme-bistro .site-footer { background: color-mix(in srgb, var(--color-surface) 70%, var(--color-bg)); }
.theme-bistro input,
.theme-bistro select,
.theme-bistro textarea { background: color-mix(in srgb, var(--color-surface) 80%, var(--color-bg)); border-color: var(--color-border); }
.theme-bistro .search__field { background: color-mix(in srgb, var(--color-surface) 80%, var(--color-bg)); }
.theme-bistro .chip { background: var(--color-surface); }

/* ----------------------------------------------------------------- hero */
.theme-bistro .bistro-hero {
    position: relative;
    padding-block: 40px 30px;
    background: var(--color-surface);
    text-align: center;
    isolation: isolate;
}
.theme-bistro .bistro-hero.has-image::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: var(--hero-image);
    background-size: cover;
    background-position: center;
    opacity: .32;
}
.theme-bistro .bistro-hero.has-image::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--color-bg) 40%, transparent),
        color-mix(in srgb, var(--color-bg) 92%, transparent));
}
.theme-bistro .bistro-hero h1 { font-size: clamp(1.9rem, 1.4rem + 2.4vw, 3rem); margin-block-end: 6px; }
.theme-bistro .bistro-hero__sub { color: var(--color-muted); margin-block-end: 16px; }

.theme-bistro .bistro-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-bg) 60%, transparent);
    font-size: .86rem;
    font-weight: 600;
    margin-block-end: 14px;
}
.theme-bistro .bistro-status__dot { width: 8px; height: 8px; border-radius: 50%; }
.theme-bistro .bistro-status.is-open .bistro-status__dot { background: #4ade80; box-shadow: 0 0 0 4px rgb(74 222 128 / 20%); }
.theme-bistro .bistro-status.is-closed .bistro-status__dot { background: var(--color-accent); }

.theme-bistro .bistro-when { padding-block: 10px 4px; }

/* ---------------------------------------------------------------- rail */
.theme-bistro .bistro-rail {
    position: sticky;
    inset-block-start: var(--header-h);
    z-index: 50;
    background: color-mix(in srgb, var(--color-bg) 92%, transparent);
    backdrop-filter: blur(10px);
    border-block-end: 1px solid var(--color-border);
    padding-block: 10px;
}
.theme-bistro .bistro-rail .chip { flex: none; }

.theme-bistro .bistro-section { scroll-margin-block-start: calc(var(--header-h) + 64px); }
.theme-bistro .bistro-section__title {
    font-size: 1.35rem;
    margin-block-end: 14px;
    padding-block-end: 10px;
    border-block-end: 1px solid var(--color-border);
}

/* ------------------------------------------------------------ menu rows */
.theme-bistro .menu-list { display: grid; gap: 8px; }
@media (min-width: 60rem) { .theme-bistro .menu-list { grid-template-columns: 1fr 1fr; gap: 10px 24px; } }

.theme-bistro .menu-item {
    position: relative;
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border-radius: var(--radius);
    background: var(--color-surface);
    border: 1px solid transparent;
    cursor: pointer;
    transition: border-color .16s ease, transform .1s ease;
}
.theme-bistro .menu-item:hover { border-color: color-mix(in srgb, var(--color-primary) 50%, transparent); }
.theme-bistro .menu-item:active { transform: scale(.995); }
.theme-bistro .menu-item.is-sold-out { opacity: .5; cursor: default; }

.theme-bistro .menu-item__body { flex: 1; min-width: 0; }
.theme-bistro .menu-item__title { font-size: 1rem; margin: 0 0 4px; }
.theme-bistro .menu-item__tags { display: flex; flex-wrap: wrap; gap: 5px; margin-block-end: 6px; }
.theme-bistro .menu-item__price { font-weight: 700; display: flex; gap: 8px; align-items: baseline; }

.theme-bistro .menu-item__media {
    position: relative;
    width: 84px; height: 84px;
    flex: none;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: color-mix(in srgb, var(--color-bg) 60%, var(--color-surface));
}
.theme-bistro .menu-item__media img { width: 100%; height: 100%; object-fit: cover; }
.theme-bistro .menu-item__add {
    position: absolute;
    inset-block-end: 4px;
    inset-inline-end: 4px;
    width: 28px; height: 28px;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}
.theme-bistro .menu-item__add svg { width: 16px; height: 16px; }
.theme-bistro .menu-item__soldout { position: absolute; inset-block-end: 4px; inset-inline: 4px; text-align: center; }

/* The whole row is clickable for a pointer; this is the real link for
   keyboard, screen readers and a browser with JavaScript off. */
.theme-bistro .menu-item__link { position: absolute; inset: 0; }
.theme-bistro .menu-item[role="button"] .menu-item__link { pointer-events: none; }

/* ----------------------------------------------------------- item sheet */
.theme-bistro .item-sheet { position: relative; }
.sheet-hidden { transform: translateY(100%); }
@media (min-width: 40rem) { .sheet-hidden { transform: translateY(24px); opacity: 0; } }

.theme-bistro .item-sheet__close {
    position: absolute;
    inset-block-start: 10px;
    inset-inline-end: 10px;
    z-index: 3;
    background: color-mix(in srgb, var(--color-bg) 70%, transparent);
}
.theme-bistro .item-sheet__image { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.theme-bistro .item-sheet__body { padding: 18px; }
.theme-bistro .item-sheet__body h2 { font-size: 1.25rem; margin-block-end: 6px; }
.theme-bistro .item-sheet__foot {
    position: sticky;
    inset-block-end: 0;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
    background: var(--color-surface);
    border-block-start: 1px solid var(--color-border);
}

/* --------------------------------------------------------- product page */
.theme-bistro .product__stage { aspect-ratio: 16 / 10; }
.theme-bistro .product__layout { gap: 24px; }
@media (min-width: 60rem) { .theme-bistro .product__layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* --------------------------------------------------------- misc chrome */
.theme-bistro .announce { color: #fff; }
.theme-bistro .badge--soft { background: color-mix(in srgb, var(--color-bg) 55%, var(--color-surface)); color: var(--color-muted); }
.theme-bistro .btn--ghost { border-color: var(--color-border); color: var(--color-text); }
.theme-bistro .btn--ghost:hover { background: color-mix(in srgb, var(--color-text) 8%, transparent); }
.theme-bistro .cart-bar { background: var(--color-primary); }
