/* Phone-first store skin — the ordering flow of a food-delivery app: a slim brand header, a restaurant info card, a search box,
   sticky category tabs, one-column dish rows with a photo and a round "+" button, a bottom "view basket" bar and bottom-sheet
   dialogs. Pure presentation: every id, class and behaviour of the store is untouched. Colours come from the active theme
   (themes.css), so the whole skin follows the palette the customer picked. */
:root { --tl-a: var(--t-a, #7c3aed); --tl-b: var(--t-b, #5b21b6); --tl-card: var(--t-card, #fff); --tl-line: var(--t-line, #e7ecea); --tl-bg: var(--t-bg, #faf8f5); --tl-ink: var(--ink, #17231f); --tl-muted: var(--muted, #6b7772); }

@media (max-width: 820px) {
  body { padding-bottom: 96px; background: var(--tl-bg); -webkit-tap-highlight-color: transparent; }
  html { scroll-padding-top: 64px; }

  /* ── header: brand row + one swipeable row of links ── */
  html body .nav { position: static; height: auto; padding: 10px 14px 8px; row-gap: 6px; flex-wrap: wrap; justify-content: flex-start; background: var(--tl-card); border-bottom: 1px solid var(--tl-line); backdrop-filter: none; }
  html body .nav .brand { width: auto; justify-content: flex-start; gap: 10px; }
  html body .nav .brand-mark { width: 42px; height: 42px; border-radius: 12px; }
  html body .nav .brand b { font-size: 17px; }
  html body .nav nav { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; gap: 8px; margin: 0 -14px; padding: 2px 14px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  html body .nav nav::-webkit-scrollbar { display: none; }
  html body .nav nav a, html body .nav nav .lang-btn { flex: 0 0 auto; padding: 8px 14px; font-size: 13.5px; background: transparent; border: 1px solid var(--tl-line); color: var(--tl-ink); }

  /* ── restaurant card instead of the big hero ── */
  html body .hero { min-height: 0; padding: 18px 16px 8px; display: block; background: transparent; }
  html body .hero-art, html body .trust-row { display: none; }
  html body .hero h1 { font-size: 25px; line-height: 1.35; letter-spacing: 0; margin: 8px 0 6px; }
  html body .hero p { font-size: 14px; margin: 0; color: var(--tl-muted); }
  html body .hero-actions { margin: 14px 0 4px; gap: 10px; flex-wrap: nowrap; }
  html body .hero-actions .primary, html body .hero-actions .secondary { flex: 1 1 0; text-align: center; padding: 12px 8px; font-size: 15px; border-radius: 14px; }
  html body .quick-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; width: auto; margin: 6px 16px 0; padding: 0; background: transparent; box-shadow: none; border-radius: 0; }
  html body .quick-facts div { background: var(--tl-card); border: 1px solid var(--tl-line); border-radius: 14px; padding: 10px 6px; text-align: center; }
  html body .quick-facts div:nth-child(2) { border: 1px solid var(--tl-line); }
  html body .quick-facts b { display: block; font-size: 15px; }
  html body .quick-facts span { font-size: 11.5px; color: var(--tl-muted); }

  html body .section { padding: 22px 16px 8px; }
  html body .section h2 { font-size: 24px; line-height: 1.35; overflow-wrap: anywhere; margin: 4px 0 8px; }
  html body .section-head { margin-bottom: 12px; }
  html body .section-head h2 { font-size: 20px; margin: 0; }
  html body .about-grid { gap: 6px; margin-top: 8px; }
  html body .about .section-kicker { display: block; font-size: 13px; }
  html body .about p { font-size: 14.5px; line-height: 1.8; }
  html body .loyalty-promo { margin: 14px 16px 0; padding: 16px; border-radius: 18px; }
  html body .section-kicker { display: none; }

  /* ── offers: a swipeable row ── */
  html body .offers-grid { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 10px; scrollbar-width: none; }
  html body .offers-grid::-webkit-scrollbar { display: none; }
  html body .offers-grid > * { flex: 0 0 82%; scroll-snap-align: center; }

  /* ── menu: search, sticky tabs, dish rows ── */
  html body .menu-section { padding-top: 14px; }
  html body .menu-title { display: block; }
  html body .menu-title h2 { display: none; }
  html body .search { width: 100%; margin: 0 0 4px; background: var(--tl-card); border: 1px solid var(--tl-line); border-radius: 14px; padding: 0 14px; }
  html body .search input { font-size: 16px; padding: 13px 4px; color: var(--tl-ink); }
  html body .menu-section > .categories, html body .menu-section > .menu-grid, html body .menu-section > .more-button { margin-inline: 0; }

  html body #categories { position: sticky; top: 0; z-index: 25; flex-wrap: nowrap; overflow-x: auto; gap: 4px; margin: 0 -16px; padding: 0 12px; background: var(--tl-bg); border-bottom: 1px solid var(--tl-line); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  html body #categories::-webkit-scrollbar { display: none; }
  html body #categories button, html[data-theme] body #categories button.active { background: transparent; color: var(--tl-muted); border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 14px 14px 11px; font-size: 15px; font-weight: 800; }
  html body #categories button.active, html[data-theme] body #categories button.active { color: var(--tl-ink); border-bottom-color: var(--tl-a); background: transparent; }
  html body .categories.subcats { flex-wrap: nowrap; overflow-x: auto; padding: 10px 0 2px; position: static; border: 0; margin: 0 -16px; padding-inline: 16px; scrollbar-width: none; }
  html body .categories.subcats button { padding: 7px 14px; font-size: 13.5px; border-radius: 999px; border: 1px solid var(--tl-line); background: var(--tl-card); color: var(--tl-ink); }
  html body .categories.subcats button.active { background: var(--tl-a); color: #fff; border-color: transparent; }

  html body .menu-grid { display: block; margin: 6px -16px 0; }
  html body .menu-card { position: relative; display: grid; grid-template-columns: 1fr 104px; grid-template-areas: "title pic" "desc pic" "price pic"; column-gap: 14px; align-content: start; min-height: 128px; margin: 0; padding: 16px; border: 0; border-bottom: 1px solid var(--tl-line); border-radius: 0; background: var(--tl-card); box-shadow: none; transform: none; }
  html body .menu-card:active { background: color-mix(in srgb, var(--tl-card) 92%, var(--tl-a)); }
  html body .menu-card .item-symbol { grid-area: pic; width: 104px; height: 104px; border-radius: 16px; display: grid; place-items: center; font-size: 46px; overflow: hidden; background: color-mix(in srgb, var(--tl-a) 14%, var(--tl-card)); margin: 0; }
  html body .menu-card .item-symbol img { width: 100%; height: 100%; object-fit: cover; display: block; }
  html body .menu-card h3 { grid-area: title; margin: 0 0 4px; font-size: 16px; line-height: 1.45; color: var(--tl-ink); }
  html body .menu-card p { grid-area: desc; margin: 0 0 6px; font-size: 12.5px; color: var(--tl-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  html body .menu-card .item-bottom { display: contents; }
  html body .menu-card .price { grid-area: price; align-self: end; font-size: 16px; font-weight: 800; color: var(--tl-ink); }
  html body .menu-card .card-actions { position: absolute; left: 22px; bottom: 12px; display: flex; flex-direction: row-reverse; align-items: center; gap: 6px; }
  html body .menu-card .add { width: 38px; height: 38px; border-radius: 50%; font-size: 22px; line-height: 1; background: var(--tl-card); color: var(--tl-a); border: 0; box-shadow: 0 3px 12px rgba(0,0,0,.28); display: grid; place-items: center; padding: 0; }
  html[data-theme] body .menu-card .add { background: var(--tl-card); color: var(--tl-a); }
  html body .menu-card .note-btn { width: 30px; height: 30px; border-radius: 50%; border: 0; font-size: 14px; background: rgba(0,0,0,.35); color: #fff; padding: 0; }
  html body .menu-card .card-stepper { display: flex; align-items: center; gap: 2px; background: var(--tl-a); color: #fff; border-radius: 999px; padding: 2px; box-shadow: 0 3px 12px rgba(0,0,0,.28); }
  html body .menu-card .card-stepper button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: #fff; font-size: 20px; padding: 0; }
  html body .menu-card .card-stepper b { min-width: 22px; text-align: center; color: #fff; }
  html body .menu-card--unavailable { opacity: .5; }
  html body .more-button { display: block; width: calc(100% - 32px); margin: 16px auto; padding: 14px; border-radius: 14px; font-weight: 800; }

  /* ── bottom "view basket" bar ── */
  html body #cartButton { border: 0; position: fixed; inset: auto 12px calc(12px + env(safe-area-inset-bottom)) 12px; width: auto; height: 54px; z-index: 40; border-radius: 16px; padding: 0 14px; display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, var(--tl-a), var(--tl-b)); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.35); font-size: 16px; }
  html body.tl-ready #cartButton { transition: transform .25s, opacity .25s; }
  html body #cartButton.tl-empty { transform: translateY(140%); opacity: 0; pointer-events: none; }
  html body #cartButton > span { display: none; }
  html body #cartButton #cartCount { order: 1; min-width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.22); color: #fff; font-size: 15px; }
  html body #cartButton .tl-label { order: 2; flex: 1; text-align: start; font-style: normal; font-weight: 800; }
  html body #cartButton .tl-total { order: 3; font-style: normal; font-weight: 800; }
  /* the floating helpers sit above the basket bar */
  html body .chat-fab { bottom: calc(14px + env(safe-area-inset-bottom)); }
  html body.tl-hascart .chat-fab { bottom: calc(80px + env(safe-area-inset-bottom)); }
  html body .theme-fab { left: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); width: 44px; height: 44px; font-size: 20px; }
  html body.tl-hascart .theme-fab { bottom: calc(80px + env(safe-area-inset-bottom)); }

  /* ── dialogs become bottom sheets ── */
  html body .modal { align-items: flex-end; padding: 0; }
  html body .modal-card { width: 100%; max-width: none; max-height: 92vh; max-height: 92dvh; border-radius: 22px 22px 0 0; padding: 22px 16px calc(18px + env(safe-area-inset-bottom)); }
  html body .modal-close { left: 14px; top: 14px; width: 40px; height: 40px; }
  html body .cart-drawer { width: 100%; padding: 18px 16px calc(14px + env(safe-area-inset-bottom)); }
  html body .cart-drawer .primary, html body .modal-card .primary, html body .submit-order { min-height: 52px; font-size: 16px; border-radius: 14px; }
  html body .modal-card input, html body .modal-card select, html body .modal-card textarea, html body .cart-drawer input { font-size: 16px; }
  html body .modal-card { overflow-x: hidden; }
  html body .modal-card *, html body .cart-drawer * { max-width: 100%; }
  html body .modal-card input:not([type=radio]):not([type=checkbox]), html body .modal-card select, html body .modal-card textarea { width: 100%; }
  html body .sched-mode span { background: var(--tl-card); color: var(--tl-ink); border-color: var(--tl-line); }
  html body .sched-mode input:checked + span { background: var(--tl-a); color: #fff; border-color: var(--tl-a); }
  html body .item-modal-footer { display: flex; align-items: center; gap: 10px; }
  html body .item-qty { display: flex; align-items: center; gap: 8px; flex: none; }
  html body .item-qty b { min-width: 22px; text-align: center; }
  html body .item-modal-footer .primary { flex: 1; }
}
