.storefront {
  --color-bg: #f7f6f2;
  --canvas: var(--color-bg);
  --primary: #111;
  --primary-dark: #333;
}

.storefront .site-header { background: rgba(255, 255, 255, .95); }
.storefront .app-main { padding-top: 1.5rem; }
.storefront .brand-mark { border-radius: 50%; }
body:has(.customer-auth) .header-actions [aria-label="View cart"] { display: none; }

.directory-hero { padding: clamp(2rem, 6vw, 4rem) 0; border-bottom: 1px solid var(--color-border); color: #111; }
.directory-hero h1 { margin: .4rem 0; color: #111; font-size: clamp(2.5rem, 7vw, 4.5rem); }
.directory-hero p { max-width: 620px; margin: 0; color: var(--color-muted); font-size: 1.05rem; }
.directory-hero .eyebrow { color: var(--color-muted); }
.restaurant-directory { padding: 2.5rem 0 4rem; }
.restaurant-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 390px), 1fr)); gap: 1.25rem; }
.restaurant-card { display: grid; grid-template-columns: minmax(0, 1fr) 140px; align-items: stretch; min-height: 190px; overflow: hidden; border: 1px solid var(--color-border); border-radius: 18px; background: #fff; color: inherit; text-decoration: none; transition: transform .16s, border-color .16s, box-shadow .16s; }
.restaurant-card:hover { border-color: #aaa; box-shadow: var(--shadow); transform: translateY(-3px); }
.restaurant-card > img, .restaurant-logo-placeholder { width: 140px; height: 100%; min-height: 190px; background: #ecece8; object-fit: cover; }
.restaurant-logo-placeholder { display: grid; place-items: center; color: #777; font-size: 3.5rem; font-weight: 950; }
.restaurant-card-body { display: flex; min-width: 0; padding: 1.2rem; flex-direction: column; align-items: flex-start; }
.restaurant-card-body h3 { margin: 0 0 .35rem; font-size: 1.3rem; }
.restaurant-card-body p { margin: 0 0 .8rem; color: var(--color-muted); }
.restaurant-card-body > strong { display: block; margin-top: auto; padding-top: 1rem; }
.restaurant-services { display: flex; flex-wrap: wrap; gap: .4rem; }
.restaurant-services span { padding: .32rem .58rem; border-radius: 999px; background: #edf7f1; color: #12623c; font-size: .76rem; font-weight: 820; }

.store-hero { position: relative; padding: clamp(1.5rem, 5vw, 3.5rem); overflow: hidden; border-radius: 24px; background: #111; color: #fff; box-shadow: var(--shadow); }
.store-hero .logo { width: 104px; height: 104px; border: 3px solid #fff; border-radius: 22px; background: #fff; object-fit: cover; }
.store-hero h1 { margin: .35rem 0; color: #fff; }
.store-hero a { color: #fff; }
.store-hero .badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.store-hero .badge { border: 1px solid #42423f; background: #292927; color: #fff; }
.store-hero .badge.open { border-color: transparent; background: #dff5e8; color: #12623c; }
.store-hero .badge.closed { border-color: transparent; background: #f9dfdd; color: #8d1c14; }
.restaurant-menu-page .shell { width: min(calc(100% - 2.5rem), 1540px); }
.restaurant-banner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1.25rem; padding: 1.5rem 0 2rem; border-bottom: 1px solid var(--color-border); color: #111; }
.restaurant-banner-logo { width: 96px; height: 96px; border: 1px solid var(--color-border); border-radius: 18px; background: #fff; object-fit: cover; }
.restaurant-banner-logo.logo-fallback { display: grid; place-items: center; background: #ecece8; font-size: 2.25rem; font-weight: 950; }
.restaurant-identity h1 { margin: .2rem 0; }
.restaurant-identity p { margin: 0; color: var(--color-muted); }
.restaurant-meta { display: flex; flex-wrap: wrap; gap: .55rem 1rem; margin-top: .6rem; color: var(--color-muted); font-size: .85rem; }
.restaurant-meta a { color: inherit; }
.status-dot::before { color: #a32920; content: "● "; }
.status-dot.open::before { color: #238552; }
.banner-service-selector > span { display: block; margin-bottom: .4rem; color: var(--color-muted); font-size: .72rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.banner-service-selector > div { display: flex; padding: .3rem; border-radius: 12px; background: #e9e9e6; }
.banner-service-selector .service-choice { color: #555 !important; }
.restaurant-order-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr) 300px; gap: 1.5rem; align-items: start; }
.menu-category-sidebar, .menu-cart-sidebar { position: sticky; top: 90px; margin-top: 2rem; }
.menu-category-sidebar > strong { display: block; padding: 0 .8rem .8rem; font-size: 1.2rem; }
.menu-category-sidebar nav { display: grid; gap: .2rem; }
.menu-category-sidebar a { padding: .7rem .8rem; border-left: 3px solid transparent; border-radius: 0 9px 9px 0; color: #555; font-weight: 720; text-decoration: none; }
.menu-category-sidebar a:hover, .menu-category-sidebar a:focus { border-left-color: #111; background: #e9e9e6; color: #111; }
.restaurant-menu-content { min-width: 0; }
.restaurant-menu-content .category:first-child { margin-top: 2rem; }
.menu-cart-sidebar { overflow: hidden; border: 1px solid var(--color-border); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.mini-cart-heading { display: flex; align-items: center; justify-content: space-between; padding: 1rem; border-bottom: 1px solid var(--color-border); }
.mini-cart-heading h2 { margin: .1rem 0 0; font-size: 1.25rem; }
.mini-cart-heading h2 span { display: inline-grid; place-items: center; min-width: 25px; height: 25px; border-radius: 50%; background: #eee; font-size: .78rem; }
.mini-cart-heading > a { font-size: .8rem; font-weight: 800; }
.mini-cart-lines { max-height: 48vh; overflow-y: auto; padding: .3rem 1rem; }
.mini-cart-lines article { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .65rem; padding: .9rem 0; border-bottom: 1px solid var(--color-border); font-size: .88rem; }
.mini-cart-lines article > div:last-child { text-align: right; }
.mini-cart-lines small { display: block; margin-top: .25rem; color: var(--color-muted); }
.mini-cart-remove { min-height: auto; margin-top: .35rem; padding: 0; border: 0; background: transparent; color: var(--color-danger); font-size: .75rem; }
.mini-cart-total { display: flex; justify-content: space-between; padding: 1rem; font-size: 1.05rem; }
.mini-cart-checkout { display: block; margin: 0 1rem 1rem; text-align: center; }
.mini-cart-empty { display: grid; justify-items: center; gap: .45rem; padding: 2.5rem 1.25rem; color: var(--color-muted); text-align: center; }
.mini-cart-empty > span { font-size: 2rem; }
.mini-cart-empty p { margin: 0; }
.service-selector { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid #3a3a37; }
.service-selector > span { color: #c8c8c3; font-size: .78rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.service-selector > div { display: flex; gap: .5rem; padding: .3rem; border-radius: 12px; background: #292927; }
.service-choice { min-width: 108px; padding: .65rem 1rem; border: 1px solid transparent; border-radius: 9px; color: #d4d4cf !important; font-weight: 850; text-align: center; text-decoration: none; }
.service-choice.delivery.active { border-color: #63b3ff; background: #dcedff; color: #104f87 !important; }
.service-choice.pickup.active { border-color: #7fd9a9; background: #dcf7e8; color: #12623c !important; }
.order-account-prompt { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; margin: 1rem 0 1.5rem; padding: 1rem 1.15rem; border: 1px solid #c9c9c4; border-radius: 14px; background: #fff; }
.order-account-prompt strong, .order-account-prompt span { display: block; }
.order-account-prompt span { margin-top: .15rem; color: var(--color-muted); font-size: .88rem; }
.checkout-signin { display: block; margin-top: .8rem; font-size: .88rem; font-weight: 750; text-align: center; }

.category-nav { position: sticky; z-index: 20; top: 72px; display: flex; gap: .5rem; margin-inline: calc(50% - 50vw); padding: .72rem max(.65rem, calc((100vw - var(--content)) / 2)); overflow-x: auto; border-bottom: 1px solid var(--color-border); background: rgba(247, 246, 242, .96); backdrop-filter: blur(12px); scrollbar-width: none; }
.category-nav a { flex: none; padding: .52rem .9rem; border: 1px solid var(--color-border); border-radius: 999px; background: #fff; font-size: .88rem; font-weight: 780; text-decoration: none; }
.category-nav a:hover { border-color: #111; }
.category { margin-top: 2.5rem; padding-top: .5rem; scroll-margin-top: 150px; }
.category .page-head { border-bottom: 1px solid var(--color-border); margin-bottom: 1rem; }
.menu-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.menu-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 128px; gap: 1rem; min-height: 160px; padding: 1rem; border: 1px solid var(--color-border); border-radius: 16px; background: #fff; color: inherit; box-shadow: none; transition: border-color .16s, transform .16s, box-shadow .16s; }
.menu-card:hover { border-color: #aaa; box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.menu-card h3 { margin-top: .15rem; font-size: 1.18rem; }
.item-image { width: 128px; height: 128px; border-radius: 12px; background: #eee; object-fit: cover; }
.price { font-size: 1.08rem; font-weight: 900; }
.add-pill { position: absolute; right: .65rem; bottom: .65rem; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #111; color: #fff; font-size: 1.2rem; font-weight: 900; text-decoration: none; box-shadow: var(--shadow-sm); }

.menu-item-dialog { width: min(920px, calc(100vw - 2rem)); max-width: none; height: min(820px, calc(100dvh - 2rem)); max-height: none; padding: 0; overflow: hidden; border: 0; border-radius: 22px; background: #fff; box-shadow: 0 30px 90px rgba(0, 0, 0, .35); }
.menu-item-dialog::backdrop { background: rgba(0, 0, 0, .62); backdrop-filter: blur(4px); }
.dialog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 58px; padding: 0 .75rem 0 1.25rem; border-bottom: 1px solid var(--color-border); background: #fff; }
.dialog-close { width: 40px; min-height: 40px; padding: 0; border-radius: 50%; background: #efefed; color: #111; font-size: 1.55rem; line-height: 1; }
.menu-item-dialog iframe { display: block; width: 100%; height: calc(100% - 58px); border: 0; background: var(--color-bg); }
.modal-document { min-height: 100%; }
.modal-item-detail { display: grid; grid-template-columns: minmax(260px, .85fr) minmax(0, 1.15fr); min-height: 100%; }
.modal-item-media { background: #ecece8; }
.modal-item-media img, .modal-image-placeholder { position: sticky; top: 0; width: 100%; height: min(520px, 100vh); object-fit: cover; }
.modal-image-placeholder { display: grid; place-items: center; font-size: 5rem; }
.modal-item-content { padding: clamp(1.25rem, 4vw, 2.25rem); }
.modal-item-content h1 { margin-top: .25rem; font-size: clamp(2rem, 5vw, 3.4rem); }
.modal-quantity input { max-width: 110px; }
.modal-add-button { position: sticky; z-index: 2; bottom: .75rem; width: 100%; min-height: 52px; box-shadow: 0 12px 28px rgba(0, 0, 0, .2); }

.detail-layout, .cart-layout, .checkout-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .75fr); gap: 1.5rem; align-items: start; }
.detail-image { width: 100%; max-height: 520px; border-radius: 20px; object-fit: cover; }
.detail, .cart-line { box-shadow: none; }
.cart-line h2 { font-size: 1.15rem; }
.sticky-summary { position: sticky; top: 95px; }
.summary-row { display: flex; justify-content: space-between; gap: 1rem; padding: .62rem 0; }
.summary-total { margin-top: .5rem; padding-top: 1rem; border-top: 2px solid #111; font-size: 1.35rem; font-weight: 900; }
.cart-page-actions { justify-content: flex-end; }
.checkout-step { display: flex; align-items: center; gap: .55rem; margin: .25rem 0 1.5rem; color: var(--color-muted); font-size: .8rem; font-weight: 760; }
.checkout-step .active { color: #111; }
.form-section { margin: 0 0 1rem; padding: clamp(1.1rem, 3vw, 1.6rem); border: 1px solid var(--color-border); border-radius: var(--radius); background: #fff; }
.form-section h2 { font-size: 1.25rem; }
.payment-choice ul { display: grid; gap: .65rem; padding: 0; list-style: none; }
.payment-choice label { display: flex; align-items: center; gap: .65rem; padding: 1rem; border: 1px solid var(--color-border); border-radius: 12px; cursor: pointer; }
.payment-choice label:has(input:checked) { border-color: #111; box-shadow: inset 0 0 0 1px #111; }
fieldset { margin: 1rem 0; padding: 1rem; border: 1px solid var(--color-border); border-radius: 14px; }
legend { padding: 0 .4rem; font-weight: 850; }
.required-label { color: var(--color-danger); font-size: .72rem; text-transform: uppercase; }

.confirmation-page { max-width: 1080px; margin-inline: auto; padding-bottom: 3rem; }
.confirmation-hero { padding: clamp(2rem, 6vw, 4rem) 1rem 2rem; text-align: center; }
.confirmation-hero h1 { margin: .35rem 0; font-size: clamp(2.3rem, 6vw, 4rem); }
.confirmation-hero > p { max-width: 590px; margin: 0 auto 1.25rem; color: var(--color-muted); }
.confirmation-mark { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 1rem; border-radius: 50%; background: #dff5e8; color: #12623c; font-size: 2rem; animation: confirmation-pop .55s cubic-bezier(.2,.9,.25,1.3); }
.confirmation-mark span { animation: confirmation-check .7s .25s both; }
.confirmation-number { display: flex; align-items: center; justify-content: center; gap: .55rem; margin-bottom: .8rem; }
.confirmation-number span { color: var(--color-muted); }
.live-order-card { padding: clamp(1rem, 3vw, 1.6rem); border: 1px solid var(--color-border); border-radius: 20px; background: #fff; box-shadow: var(--shadow-sm); }
.live-status-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.live-status-heading > div { display: flex; align-items: center; gap: .5rem; color: var(--color-muted); font-size: .82rem; font-weight: 780; }
.live-indicator { width: 9px; height: 9px; border-radius: 50%; background: #28a568; box-shadow: 0 0 0 0 rgba(40,165,104,.5); animation: live-pulse 1.7s infinite; }
.live-indicator.stopped { animation: none; box-shadow: none; }
.status-track { position: relative; display: flex; justify-content: space-between; gap: .4rem; margin: 2rem 0 .5rem; }
.status-track::before { position: absolute; top: 25px; right: 8%; left: 8%; height: 3px; border-radius: 3px; background: var(--color-border); content: ""; }
.status-node { position: relative; z-index: 1; flex: 1; color: var(--color-muted); font-size: .76rem; text-align: center; transition: color .3s ease, transform .3s ease; }
.status-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto .6rem; border: 3px solid #fff; border-radius: 50%; background: #e9e9e6; filter: grayscale(1); font-size: 1.25rem; box-shadow: 0 0 0 1px var(--color-border); transition: background .3s, box-shadow .3s, filter .3s, transform .3s; }
.status-node strong, .status-node small { display: block; }
.status-node small { margin-top: .15rem; }
.status-node.complete { color: #12623c; }
.status-node.complete .status-icon { background: #dff5e8; filter: none; box-shadow: 0 0 0 1px #9ed8b8; }
.status-node.current { color: #111; transform: translateY(-3px); }
.status-node.current .status-icon { background: #fff0c2; filter: none; box-shadow: 0 0 0 2px #d49b15, 0 6px 18px rgba(0,0,0,.12); transform: scale(1.08); animation: current-step 1.8s infinite; }
.cancelled-status { display: flex; align-items: center; gap: .8rem; margin-top: 1rem; padding: 1rem; border-radius: 12px; background: #f9dfdd; color: #8d1c14; }
.cancelled-status[hidden] { display: none; }
.cancelled-status > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #8d1c14; color: #fff; font-weight: 900; }
.cancelled-status p { margin: .15rem 0 0; }
.confirmation-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1rem 0; }
.confirmation-facts article { display: flex; align-items: center; gap: .8rem; padding: 1rem; border: 1px solid var(--color-border); border-radius: 14px; background: #fff; }
.confirmation-facts article > span { font-size: 1.45rem; }
.confirmation-facts small, .confirmation-facts strong { display: block; }
.confirmation-facts small { color: var(--color-muted); }
.confirmation-details { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(280px,.65fr); gap: 1rem; margin-top: 1rem; }
.confirmation-details > section, .confirmation-details > aside { padding: 1.25rem; border: 1px solid var(--color-border); border-radius: 16px; background: #fff; }
.confirmation-line { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--color-border); }
.confirmation-line small { display: block; margin-top: .2rem; color: var(--color-muted); }
.confirmation-actions { justify-content: center; margin-top: 1.5rem; }
@keyframes confirmation-pop { from { opacity: 0; transform: scale(.5) rotate(-12deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes confirmation-check { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 8px rgba(40,165,104,0); } 100% { box-shadow: 0 0 0 0 rgba(40,165,104,0); } }
@keyframes current-step { 50% { transform: scale(1.14); } }

.account-card { max-width: 760px; margin-inline: auto; }
.loyalty-card { border: 0; background: #111; color: #fff; }
.loyalty-card .muted { color: #bbb; }
.loyalty-points { font-size: 2.5rem; font-weight: 950; }

@media (max-width: 760px) {
  .storefront .header-actions .button { padding-inline: .72rem; }
  .category-nav { top: 64px; }
  .detail-layout, .cart-layout, .checkout-layout { display: block; }
  .sticky-summary { position: static; }
  .menu-card { grid-template-columns: minmax(0, 1fr) 100px; min-height: 132px; }
  .item-image { width: 100px; height: 100px; }
  .mobile-sticky-action { position: sticky; z-index: 10; bottom: .5rem; width: 100%; box-shadow: 0 12px 28px rgba(0, 0, 0, .2); }
  .status-track { justify-content: flex-start; overflow-x: auto; }
  .status-node { min-width: 78px; }
  .service-selector, .order-account-prompt { align-items: stretch; flex-direction: column; }
  .service-selector > div { display: grid; grid-template-columns: repeat(2, 1fr); }
  .service-choice { min-width: 0; }
  .order-account-prompt .actions, .order-account-prompt .button { width: 100%; }
  .menu-item-dialog { width: 100vw; height: 100dvh; border-radius: 0; }
  .modal-item-detail { display: block; }
  .modal-item-media img, .modal-image-placeholder { position: static; height: 220px; }
  .modal-item-content { padding-bottom: 2rem; }
  .restaurant-menu-page .shell { width: min(calc(100% - 1.25rem), 1540px); }
  .restaurant-banner { grid-template-columns: auto minmax(0, 1fr); padding-top: .75rem; }
  .restaurant-banner-logo { width: 72px; height: 72px; }
  .banner-service-selector { grid-column: 1 / -1; }
  .banner-service-selector > div { display: grid; grid-template-columns: repeat(2, 1fr); }
  .restaurant-order-layout { display: block; }
  .menu-category-sidebar { position: sticky; z-index: 20; top: 64px; display: flex; align-items: center; gap: .5rem; margin: 0 -.65rem; padding: .7rem .65rem; overflow-x: auto; border-bottom: 1px solid var(--color-border); background: rgba(247,246,242,.96); }
  .menu-category-sidebar > strong { flex: none; padding: 0 .35rem 0 0; }
  .menu-category-sidebar nav { display: flex; gap: .4rem; }
  .menu-category-sidebar a { flex: none; padding: .5rem .75rem; border: 1px solid var(--color-border); border-radius: 999px; background: #fff; }
  .menu-cart-sidebar { position: static; margin: 2rem 0; }
  .restaurant-card { grid-template-columns: minmax(0, 1fr) 105px; min-height: 165px; }
  .restaurant-card > img, .restaurant-logo-placeholder { width: 105px; min-height: 165px; }
  .restaurant-card-body { padding: 1rem; }
  .confirmation-facts, .confirmation-details { grid-template-columns: 1fr; }
  .status-track { margin-inline: -.25rem; padding: .3rem .25rem .8rem; }
  .status-track::before { right: 45px; left: 45px; }
  .status-node { min-width: 92px; }
  .live-status-heading { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .confirmation-mark, .confirmation-mark span, .live-indicator, .status-node.current .status-icon { animation: none; }
}

@media (min-width: 761px) and (max-width: 1120px) {
  .restaurant-order-layout { grid-template-columns: 170px minmax(0, 1fr); }
  .menu-cart-sidebar { position: static; grid-column: 1 / -1; margin-top: 0; }
}
