/* ═══════════════════════════════════════════════════════════════════════════
   Smart App 2027 — Modern App-First QR Menu Design System
   Light & Dark Mode | Mobile / Tablet / Desktop Split-App Shell
   ═══════════════════════════════════════════════════════════════════════════ */

:root,
[data-theme="light"] {
  --brand: var(--theme-color-1, #2563eb);
  --brand-soft: var(--theme-color-0_12, rgba(37, 99, 235, 0.12));
  --brand-glow: var(--theme-color-0_28, rgba(37, 99, 235, 0.28));

  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-glass: rgba(255, 255, 255, 0.84);
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);

  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;

  --success: #10b981;
  --danger: #ef4444;
  --warn: #f59e0b;

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.18);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --header-h: 62px;
  --catbar-h: 54px;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #131c31;
  --surface-2: #1b2740;
  --surface-glass: rgba(11, 17, 32, 0.86);
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.24);

  --text: #f8fafc;
  --text-2: #cbd5e1;
  --muted: #94a3b8;

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 26px 64px rgba(0, 0, 0, 0.55);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "LINE Seed Sans TH",
    "LINESeedTH",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 0.25s ease,
    color 0.25s ease;
  overflow-x: hidden;
}
body.s27-noscroll {
  overflow: hidden;
}
a {
  color: var(--brand);
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
}
button,
input,
select,
textarea {
  font-family: inherit;
}
.hidden {
  display: none !important;
}

/* ═══════════ STICKY FROSTED-GLASS TOP APP BAR ═══════════ */
.s27-topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  height: var(--header-h);
  background: var(--surface-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition:
    box-shadow 0.2s ease,
    background-color 0.25s ease;
}
.s27-topbar.scrolled {
  box-shadow: var(--shadow-sm);
}
.s27-topbar-inner {
  max-width: 1380px;
  height: 100%;
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.s27-brand-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 4px 8px 4px 2px;
  border-radius: 14px;
  color: var(--text);
  cursor: pointer;
  min-width: 0;
  text-align: left;
  transition: background 0.15s ease;
}
.s27-brand-btn:hover {
  background: var(--surface-2);
}
.s27-brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
}
.s27-brand-meta {
  min-width: 0;
  display: none;
}
@media (min-width: 768px) {
  .s27-brand-meta {
    display: block;
  }
}
.s27-desktop-only {
  display: none !important;
}
@media (min-width: 1120px) {
  .s27-desktop-only {
    display: inline-flex !important;
  }
}
.s27-brand-name {
  font-size: 0.96rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
  line-height: 1.2;
}
.s27-brand-sub {
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.s27-table-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: 0.7rem;
}

.s27-nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.s27-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 38px;
  min-width: 38px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.14s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}
.s27-icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.s27-icon-btn:active {
  transform: scale(0.95);
}
.s27-icon-btn .material-icons-outlined {
  font-size: 19px;
}
.s27-icon-btn .s27-btn-lbl {
  display: none;
}
@media (min-width: 768px) {
  .s27-icon-btn .s27-btn-lbl {
    display: inline;
  }
  .s27-brand-name {
    max-width: 280px;
  }
}

/* Language Dropdown */
.s27-lang-wrap {
  position: relative;
}
.s27-lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 148px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: none;
  z-index: 1000;
}
.s27-lang-menu.open {
  display: block;
}
.s27-lang-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  transition: background 0.12s ease;
}
.s27-lang-item:hover {
  background: var(--surface-2);
  color: var(--brand);
}

/* ═══════════ MAIN RESPONSIVE APP SHELL (SPLIT ON DESKTOP) ═══════════ */
.s27-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 14px 14px 155px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
@media (min-width: 1120px) {
  .s27-shell.has-ordering {
    grid-template-columns: minmax(0, 1fr) 390px;
    padding: 18px 20px 60px;
  }
  .s27-shell {
    padding: 18px 20px 60px;
  }
}

/* ═══════════ EDITORIAL HERO STOREFRONT CARD ═══════════ */
.s27-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.s27-hero-cover {
  position: relative;
  height: 175px;
  background-size: cover;
  background-position: center;
  background-color: #1e293b;
}
@media (min-width: 768px) {
  .s27-hero-cover {
    height: 220px;
  }
}
.s27-hero-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.12) 0%,
    rgba(15, 23, 42, 0.72) 100%
  );
}
.s27-hero-top-badges {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  gap: 8px;
}
.s27-glass-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.14s ease;
}
.s27-glass-pill:hover {
  background: rgba(15, 23, 42, 0.76);
  transform: translateY(-1px);
}
.s27-glass-pill .material-icons-outlined {
  font-size: 16px;
}

.s27-hero-body {
  position: relative;
  padding: 12px 18px 16px;
  z-index: 2;
}
.s27-hero-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.s27-hero-logo {
  width: 68px;
  height: 68px;
  margin-top: -42px;
  border-radius: 18px;
  object-fit: cover;
  background: #fff;
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}
.s27-hero-title-wrap {
  min-width: 0;
}
.s27-hero-title {
  margin: 0;
  font-size: 1.32rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
}
.s27-hero-sub {
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}
.s27-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}
.s27-info-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.76rem;
  font-weight: 600;
}
.s27-info-chip .material-icons-outlined {
  font-size: 15px;
  color: var(--brand);
}

/* ═══════════ SEARCH + PROMO + STICKY CATEGORY BAR ═══════════ */
.s27-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.s27-search-box {
  position: relative;
  flex: 1;
}
.s27-search-box .s27-search-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 20px;
  pointer-events: none;
}
.s27-search-input {
  width: 100%;
  height: 46px;
  padding: 0 40px 0 44px;
  border-radius: 15px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}
.s27-search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.s27-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.s27-view-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}
.s27-vt-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.s27-vt-btn.active {
  background: var(--brand);
  color: #fff;
}
.s27-vt-btn .material-icons-outlined {
  font-size: 20px;
}

.s27-promo-slot:empty {
  display: none;
}
.s27-promo-slot {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.14),
    rgba(239, 68, 68, 0.1)
  );
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 0.85rem;
  color: var(--text);
}

.s27-catbar-wrap {
  position: sticky;
  top: var(--header-h);
  z-index: 800;
  margin: 0 -14px 16px;
  padding: 8px 14px;
  background: var(--surface-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
@media (min-width: 1120px) {
  .s27-catbar-wrap {
    margin: 0 0 18px;
    border-radius: 16px;
    border: 1px solid var(--border);
    top: calc(var(--header-h) + 10px);
  }
}
.s27-catbar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}
.s27-catbar::-webkit-scrollbar {
  display: none;
}
.s27-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.16s ease;
}
.s27-cat-pill .material-icons-outlined {
  font-size: 16px;
}
.s27-cat-pill:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.s27-cat-pill.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--brand-glow);
}

/* ═══════════ CATEGORY SECTIONS & BENTO FOOD CARDS ═══════════ */
.s27-cat-section {
  scroll-margin-top: calc(var(--header-h) + var(--catbar-h) + 18px);
  margin-bottom: 26px;
}
.s27-cat-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}
.s27-cat-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px !important;
}
.s27-cat-head h2 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.s27-subcat-head {
  margin: 18px 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--brand);
}
.s27-subcat-head h3 {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-2);
}

/* Grid View (Default) */
.s27-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 680px) {
  .s27-menu-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}
@media (min-width: 1120px) {
  .s27-menu-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

.s27-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}
.s27-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-glow);
}
.s27-card:active {
  transform: scale(0.985);
}

.s27-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  overflow: hidden;
  flex-shrink: 0;
}
.s27-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.s27-card:hover .s27-card-media img {
  transform: scale(1.05);
}
.s27-card-media.s27-no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface-2), var(--brand-soft));
}
.s27-card-media.s27-no-img::after {
  content: "restaurant_menu";
  font-family: "Material Icons Outlined";
  font-size: 36px;
  color: var(--muted);
  opacity: 0.35;
}
.s27-card-media.s27-no-img .s27-placeholder-ico {
  display: none;
}

.s27-opt-tag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}
.s27-card-qty-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--brand-glow);
  border: 2px solid #fff;
}

.s27-card-body {
  padding: 11px 12px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  gap: 8px;
}
.s27-card-title {
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.32;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.s27-diet-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.s27-diet-veg {
  background: #10b981;
}
.s27-diet-nonveg {
  background: #ef4444;
}
.s27-diet-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}
.s27-card-media .s27-diet-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  margin: 0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.24);
}
.s27-card-media .s27-diet-dot {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 12px;
  height: 12px;
  margin: 0;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.28);
}
.s27-diet-jay {
  background: #facc15;
  color: #b91c1c;
  border: 1px solid #eab308;
}
.s27-diet-halal {
  background: #047857;
  color: #ffffff;
  border: 1px solid #065f46;
}
.s27-diet-veg-pill {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}
.s27-card-desc {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.s27-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}
.s27-card-price {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--brand);
}
.s27-card-price del {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
}
.s27-add-btn {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: none;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--brand-glow);
  transition:
    transform 0.14s ease,
    filter 0.14s ease;
}
.s27-add-btn:hover {
  filter: brightness(1.08);
  transform: scale(1.06);
}
.s27-add-btn .material-icons-outlined {
  font-size: 20px;
}

/* Compact List Mode Override */
body.s27-list-mode .s27-menu-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
@media (min-width: 768px) {
  body.s27-list-mode .s27-menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
body.s27-list-mode .s27-card {
  flex-direction: row;
  align-items: stretch;
}
body.s27-list-mode .s27-card-media {
  width: 108px;
  aspect-ratio: 1 / 1;
}
body.s27-list-mode .s27-card-body {
  padding: 10px 12px;
}

/* ═══════════ DESKTOP STICKY CART SIDEBAR / MOBILE BOTTOM SHEET ═══════════ */
.s27-cart-panel {
  display: none;
}
@media (min-width: 1120px) {
  .s27-cart-panel {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: calc(var(--header-h) + 14px);
    max-height: calc(100vh - var(--header-h) - 28px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
  }
  .s27-mobile-cart-dock {
    display: none !important;
  }
}
/* On Mobile & Tablet, cart panel becomes a crisp slide-up Bottom Sheet when .open */
@media (max-width: 1119px) {
  .s27-cart-panel.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    max-height: 90vh;
    background: var(--surface);
    border-radius: 26px 26px 0 0;
    box-shadow: var(--shadow-lg);
    animation: s27SlideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }
}
.s27-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.s27-panel-head h3 {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 7px;
}
.s27-panel-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
@media (min-width: 1120px) {
  .s27-cart-panel .s27-panel-close {
    display: none;
  }
}
.s27-panel-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
}
.s27-panel-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

/* Mobile Floating Bottom Cart Bar (sits cleanly above Bottom Navigation Bar) */
.s27-mobile-cart-dock {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  z-index: 960;
  pointer-events: none;
  transition:
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease;
}
.s27-mobile-cart-dock.hidden-dock {
  transform: translateY(120%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none !important;
}
.s27-mobile-cart-dock.hidden-dock .s27-cart-bar-btn {
  pointer-events: none !important;
}
.s27-cart-bar-btn {
  pointer-events: auto;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 18px;
  border: none;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 12px 32px var(--brand-glow);
  cursor: pointer;
  font-weight: 800;
}
.s27-cart-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.s27-cart-bar-count {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
}
.s27-cart-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
}

/* Cart Item Rows */
.s27-cart-empty {
  text-align: center;
  padding: 36px 12px;
  color: var(--muted);
}
.s27-cart-empty .material-icons-outlined {
  font-size: 46px;
  opacity: 0.35;
  margin-bottom: 6px;
}
.s27-cart-item {
  padding: 11px 0;
  border-bottom: 1px dashed var(--border-strong);
}
.s27-cart-item:last-child {
  border-bottom: none;
}
.s27-ci-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.s27-ci-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}
.s27-ci-sub {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 2px;
}
.s27-ci-note {
  font-size: 0.76rem;
  color: var(--warn);
  margin-top: 3px;
}
.s27-ci-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.s27-ci-price {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--brand);
}
.s27-stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border-radius: 11px;
  padding: 3px;
}
.s27-step-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.s27-step-val {
  min-width: 20px;
  text-align: center;
  font-weight: 800;
  font-size: 0.88rem;
}

/* Form Inputs inside Sheets */
.s27-field {
  margin-bottom: 10px;
}
.s27-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 4px;
}
.s27-input,
.s27-select,
.s27-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease;
}
.s27-input:focus,
.s27-select:focus,
.s27-textarea:focus {
  border-color: var(--brand);
  background: var(--surface);
}

.s27-summary-box {
  background: var(--surface-2);
  border-radius: 14px;
  padding: 11px 13px;
  margin: 12px 0;
  font-size: 0.86rem;
}
.s27-sum-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  color: var(--text-2);
}
.s27-sum-grand {
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
  margin-top: 6px;
  border-top: 1px dashed var(--border-strong);
  font-size: 1.04rem;
  font-weight: 800;
  color: var(--text);
}
.s27-primary-btn {
  width: 100%;
  padding: 13px 18px;
  border-radius: 14px;
  border: none;
  background: var(--brand);
  color: #fff;
  font-size: 0.96rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 22px var(--brand-glow);
  transition:
    filter 0.15s ease,
    transform 0.14s ease;
}
.s27-primary-btn:hover {
  filter: brightness(1.06);
}
.s27-primary-btn:active {
  transform: scale(0.985);
}
.s27-primary-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  box-shadow: none;
}

/* ═══════════ UNIVERSAL BOTTOM SHEETS / MODALS ═══════════ */
.s27-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1150;
  background: rgba(2, 6, 23, 0.56);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.s27-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.s27-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1250;
  max-height: 90vh;
  background: var(--surface);
  border-radius: 26px 26px 0 0;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: s27SlideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.s27-sheet.open {
  display: flex;
}
@media (min-width: 720px) {
  .s27-sheet {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: 92%;
    max-width: 540px;
    max-height: 86vh;
    border-radius: 24px;
    animation: s27FadePop 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  }
}
.s27-handle {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: var(--border-strong);
  margin: 10px auto 2px;
  flex-shrink: 0;
}
@media (min-width: 720px) {
  .s27-handle {
    display: none;
  }
}

/* Item Customize Options Styling */
.s27-cust-hero {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 12px;
  background: var(--surface-2);
}
.s27-opt-group {
  margin-bottom: 14px;
}
.s27-opt-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.s27-opt-title {
  font-weight: 800;
  font-size: 0.9rem;
}
.s27-opt-req {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
}
.s27-opt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  transition:
    border-color 0.14s ease,
    background 0.14s ease;
}
.s27-opt-row:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.s27-opt-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.88rem;
}
.s27-opt-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  margin: 0;
}
.s27-opt-price {
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--brand);
}

/* Store Info Sheet */
.s27-store-banner {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 12px;
}
.s27-store-info-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}
.s27-store-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 14px;
  background: var(--surface-2);
}
.s27-store-row .material-icons-outlined {
  color: var(--brand);
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}
.s27-store-row-lbl {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 600;
}
.s27-store-row-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
}
.s27-store-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.s27-outline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 14px;
  border-radius: 13px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
}
.s27-outline-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* Success State */
.s27-success-box {
  text-align: center;
  padding: 24px 10px;
}
.s27-success-ico {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.14);
  color: var(--success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.s27-success-ico .material-icons-outlined {
  font-size: 38px;
}

/* Order History Accordion Styling (compatible with existing get_history HTML) */
#order_history .accordion {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 8px;
}
#order_history .panel {
  display: none;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid var(--border);
}

/* Toast Notification */
.s27-toast {
  position: fixed;
  top: calc(var(--header-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  padding: 10px 18px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  animation: s27FadePop 0.2s ease;
  max-width: 92vw;
  text-align: center;
}
[data-theme="dark"] .s27-toast {
  background: #f8fafc;
  color: #0f172a;
}

.s27-footer-credit {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 28px;
}

/* ═══════════ NATIVE APP BOTTOM NAVIGATION BAR (MOBILE / TABLET) ═══════════ */
.s27-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 950;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding: 4px 6px env(safe-area-inset-bottom, 4px);
  background: var(--surface-glass);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}
@media (min-width: 1120px) {
  .s27-bottom-nav {
    display: none !important;
  }
}
.s27-bnav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 2px;
  border-radius: 12px;
  cursor: pointer;
  transition:
    color 0.15s ease,
    transform 0.12s ease;
}
.s27-bnav-btn:active {
  transform: scale(0.92);
}
.s27-bnav-btn.active {
  color: var(--brand);
}
.s27-bnav-btn .material-icons-outlined {
  font-size: 22px;
}
.s27-bnav-ic-wrap {
  position: relative;
  display: inline-flex;
}
.s27-bnav-badge {
  position: absolute;
  top: -4px;
  right: -12px;
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #10b981;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--surface);
}

/* Hide standalone floating FABs in Smart App 2027 (integrated cleanly into Bottom Nav & Topbar!) */
#sm-loy-fab,
#smBannerReopen,
.sm-banner-reopen-btn {
  display: none !important;
}

@keyframes s27SlideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
@keyframes s27FadePop {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
.s27-toast {
  animation: s27ToastIn 0.2s ease;
}
@keyframes s27ToastIn {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
