/* ═══════════════════════════════════════════════════════════
   FIX CSS STICKY: overflow/overflow-x parent container fix
   ═══════════════════════════════════════════════════════════ */
html, body {
  overflow-x: visible !important;
  overflow-y: visible !important;
  height: auto !important;
}

#app {
  overflow: visible !important;
}

.client-page.cafe-menu {
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  contain: none !important;
}

/* Original menu styling comes from style.css. Layout and the photo layer live here. */
.cafe-menu > header.client-header {
  position: relative;
  z-index: 10;
}
.cafe-menu .client-header-spacer { display: none; }
.cafe-menu > header.client-header::before { animation: none; transform: none; }
.cafe-menu .cafe-header-photo {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--cafe-header-photo, none) center / cover no-repeat;
  opacity: var(--cafe-header-opacity, .5);
}
.cafe-menu .logo-area[data-logo] {
  min-width: 0;
  color: inherit;
  font: inherit;
}
.cafe-menu .logo-area[data-logo]:active:not(:disabled) { transform: none; }
.cafe-menu [data-logo-img][hidden],
.cafe-menu [data-address][hidden] { display: none !important; }
.cafe-menu .category-bar {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 120 !important;
  background: rgba(255, 255, 255, 0.96) !important;
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--border, #e5e5e5) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
}

.cafe-menu .category-bar.is-fixed {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  margin: 0 !important;
}
.cafe-menu .category-chips {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 6px 12px;
  gap: 8px;
}
.cafe-menu .category-chips::-webkit-scrollbar { display: none; }
.cafe-menu .cafe-menu-product-link {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

/* Category Sections in Native Scroll Feed */
.cafe-menu .category-section {
  scroll-margin-top: 60px;
  margin-bottom: 24px;
}
.cafe-menu .category-section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink, #18181b);
  padding: 14px 14px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cafe-menu .category-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border, #eee);
}
.cafe-menu .category-section .products-grid {
  padding: 0 12px;
}

/* White glass with a solid white fallback when backdrop filters are unavailable. */
.cafe-menu > .contacts-panel,
#modal-root .modal-content:is(.client-cart-dialog, .product-detail, .cafe-access-dialog) {
  --ink: #181818;
  --ink-2: #262626;
  --ink-3: #383838;
  --ink-4: #535353;
  --ink-5: #616161;
  --accent: #222;
  --surface: #fff;
  --surface-2: #f5f5f5;
  --surface-3: #ebebeb;
  --border: #dedede;
  --shadow-focus: 0 0 0 2px #555;
  color: #181818;
  background: #fff !important;
  border: 1px solid #ffffffde !important;
  box-shadow: 0 16px 48px #00000024, inset 0 1px 0 #ffffffef !important;
  border-radius: 16px;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .cafe-menu > .contacts-panel,
  #modal-root .modal-content:is(.client-cart-dialog, .product-detail, .cafe-access-dialog) {
    background: linear-gradient(148deg, #fffffff2, #ffffffc9) !important;
    -webkit-backdrop-filter: blur(20px) saturate(.8) !important;
    backdrop-filter: blur(20px) saturate(.8) !important;
  }
}
.cafe-menu > .contacts-panel { animation: cafe-glass-in 180ms ease-out both; }
#modal-root .modal:has(> :is(.client-cart-dialog, .product-detail, .cafe-access-dialog)) {
  background: #00000048;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
#modal-root .modal-content:is(.client-cart-dialog, .product-detail, .cafe-access-dialog) {
  animation: cafe-glass-in 220ms cubic-bezier(.2,.7,.2,1) both;
}
@keyframes cafe-glass-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
#modal-root :is(.client-cart-dialog, .product-detail, .cafe-access-dialog)
  :is(.modal-header, .modal-footer) {
  background: #ffffffb8 !important;
  border-color: #00000016 !important;
}
#modal-root :is(.client-cart-dialog, .product-detail, .cafe-access-dialog)
  :is(.form-input, .form-select, .form-textarea) {
  color: #181818 !important;
  background: #ffffffd9 !important;
  border-color: #c9c9c9 !important;
}
#modal-root .client-cart-dialog .cafe-cart-whatsapp {
  color: #181818;
  border: 1px solid #b9b9b9;
  background: #ffffffd9;
}
#modal-root .client-cart-dialog .cafe-cart-whatsapp:hover { background: #eaeaea; }
#modal-root .product-detail .btn-accent { background: #191919; color: #fff; }
#modal-root .product-detail-image .placeholder { background: #ededed; color: #777; }
#modal-root .cafe-access-dialog .login-option {
  background: #ffffffad;
  border-color: #d7d7d7;
}
#modal-root .cafe-access-dialog .login-option-icon { background: #242424; }
#modal-root .cafe-access-dialog:has(.passcode-screen) {
  background: linear-gradient(148deg, #242424f5, #141414ec) !important;
  border-color: #ffffff3d !important;
}
#modal-root .cafe-access-dialog .passcode-screen { background: transparent !important; color: #fff; }
#modal-root .cafe-access-dialog .passcode-sub { color: #d2d2d2 !important; }
#modal-root .cafe-access-dialog :is(.passcode-key, .passcode-cell) {
  color: #fff !important;
  background: #ffffff0d !important;
  border-color: #ffffff3d !important;
}
#modal-root .cafe-access-dialog .passcode-key:hover { background: #ffffff24 !important; }
#modal-root .cafe-access-dialog .passcode-cell.active {
  border-color: #f0f0f0 !important;
  box-shadow: none;
}
@media (prefers-reduced-motion: reduce) {
  #modal-root .modal-content:is(.client-cart-dialog, .product-detail, .cafe-access-dialog),
  .cafe-menu > .contacts-panel { animation: none !important; }
}

@media (max-width: 600px) {
  .cafe-menu > header.client-header,
  .cafe-menu .client-header-top {
    transition: min-height 300ms ease, padding 300ms ease, margin 300ms ease;
  }
  .cafe-menu .site-logo {
    transition: width 300ms ease, height 300ms ease;
  }
  .cafe-menu > .client-header.cafe-header-compact {
    min-height: calc(var(--safe-top) + 104px);
    padding-top: calc(var(--safe-top) + 5px);
    padding-bottom: 5px;
  }
  .cafe-menu .cafe-header-compact .client-header-top { min-height: 52px; margin: 0; }
  .cafe-menu .cafe-header-compact .logo-area {
    flex-direction: row;
    gap: 6px;
    padding: 0 44px;
    border-radius: 10px;
  }
  .cafe-menu .cafe-header-compact .site-logo { width: 29px; height: 29px; }
  .cafe-menu .cafe-header-compact .brand-name {
    font-size: 17px;
    line-height: 1.15;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
  }
  .cafe-menu .cafe-header-compact .welcome-block { padding-top: 0; }
  
}

#modal-root .client-cart-dialog .cafe-cart-whatsapp {
  background: #137842;
  border-color: #137842;
  color: #fff;
}
#modal-root .client-cart-dialog .cafe-cart-whatsapp:hover { background: #0e6235; }

/* Shared glass panels use a white fallback and dark, solid text. */
#modal-root .modal-content,
.sidebar-drawer, .kiik-chat {
  color: #171717;
  background: #fff !important;
  border-color: #ddd !important;
  box-shadow: 0 14px 44px #00000024 !important;
}
#modal-root .modal-content :is(.modal-header, .modal-footer),
.sidebar-drawer .sidebar-drawer-header {
  background: #ffffffdb !important;
  border-color: #00000018 !important;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  #modal-root .modal-content,
  .sidebar-drawer, .kiik-chat {
    background: linear-gradient(145deg, #fffffff4, #ffffffd9) !important;
    -webkit-backdrop-filter: blur(18px) saturate(.85) !important;
    backdrop-filter: blur(18px) saturate(.85) !important;
  }
}

body.kds-body, .kds-body .kds-page {
  background: #fafafa !important;
  color: #171717 !important;
}
.kds-body .kds-header {
  background: #fff !important;
  border-bottom: 1px solid #dfdfdf !important;
  color: #171717;
}
.kds-body :is(.kds-header-title, .kds-stat-value, .kds-order-no, .kds-item-name) { color: #171717; }
.kds-body :is(.kds-header-sub, .kds-stat-label, .kds-order-no small, .kds-age-label) { color: #555; }
.kds-body .kds-stat {
  background: #f7f7f7 !important;
  border-color: #ddd !important;
}
.kds-body .kds-header-stats .btn-icon {
  background: #f6f6f6 !important;
  border: 1px solid #ddd !important;
  color: #222 !important;
}
.kds-body .kds-card {
  background: #fff !important;
  color: #171717 !important;
  box-shadow: 0 2px 8px #0000000d !important;
}
.kds-body .kds-card-head.green { background: #f3f8f4; }
.kds-body .kds-card-head.yellow { background: #fff8ec; }
.kds-body .kds-card-head.red { background: #fff1f1; }
.kds-body .kds-age.green { color: #17643a; }
.kds-body .kds-age.yellow { color: #864800; }
.kds-body .kds-age.red { color: #ab2424; }
.kds-body .kds-item { color: #171717; border-color: #eee; }
.kds-body .kds-qty { background: #ececec; color: #171717; }

.tv-queue {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 2vw, 24px);
  padding: clamp(12px, 2vw, 24px);
}
.tv-queue-column {
  background: #fff;
  border: 1px solid #ddd;
  border-top: 4px solid #8f5b14;
  border-radius: 12px;
  overflow: hidden;
}
.tv-queue-column.tv-queue-ready { border-top-color: #287149; }
.tv-queue-column h2 {
  padding: 14px 8px;
  border-bottom: 1px solid #e5e5e5;
  text-align: center;
  color: #262626;
  font-size: clamp(13px, 2.5vw, 26px);
  line-height: 1.3;
}
.tv-queue-cooking h2 i { color: #8f5b14; }
.tv-queue-ready h2 i { color: #287149; }
.tv-queue-orders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 118px), 1fr));
  gap: 10px;
  padding: 12px;
}
.tv-queue-number {
  padding: clamp(12px, 2vw, 22px) 6px;
  background: #f5f5f5;
  color: #171717;
  border: 1px solid #dedede;
  border-radius: 8px;
  text-align: center;
  font: 800 clamp(25px, 4vw, 54px)/1.15 var(--font-mono);
}
.tv-queue-ready .tv-queue-number {
  color: #185a33;
  background: #f2f8f3;
  border-color: #cadfcf;
}

.kiik-trigger .kiik-avatar {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
  pointer-events: none;
}

/* Scroll category pickers instead of shrinking their labels into each other. */
.menu-tabs {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
}
.menu-tabs > .menu-tab {
  flex: 0 0 auto;
  min-width: max-content;
  white-space: nowrap;
}
.pos-right-content { min-width: 0; }
.pos-split [data-phone-group][hidden] { display: none !important; }

/* Common staff controls, leaving action colors intact. */
.staff-header :is(.staff-header-actions .btn, .btn-icon),
.kds-header .kds-header-stats :is(.btn, .btn-icon),
.staff-page .order-card .btn-icon {
  border-radius: 5px !important;
  box-shadow: none !important;
}
.staff-page .courier-release { width: 34px; height: 34px; }
.staff-page .courier-release:disabled {
  color: #646464 !important;
  background: #f0f0f0 !important;
  border-color: #d7d7d7 !important;
}
.kds-header .kds-header-stats { gap: 8px; flex-wrap: wrap; }
.kds-history { display: grid; gap: 8px; }
.kds-history-order summary { cursor: pointer; font-weight: 700; }
.kds-history-order ul { padding: 8px 0 0 18px; }
.boss-margin-details > summary { cursor: pointer; list-style: none; margin: 0; }
.boss-margin-details > summary::-webkit-details-marker { display: none; }
.boss-margin-details[open] > summary { margin-bottom: 12px; }
.boss-margin-details[open] > summary > .fa-chevron-down { transform: rotate(180deg); }

.kiik-trigger .kiik-mood-avatar { display: block; width: 52px; height: 52px; }
.kiik-mood-avatar .kiik-eyes { fill: #30251e; }
.kiik-mood-avatar .kiik-tired-eyes,
.kiik-mood-marks > text { display: none; }
.kiik-widget:is([data-kiik-mood=busy], [data-kiik-mood=quiet]) .kiik-eyes { display: none; }
.kiik-widget:is([data-kiik-mood=busy], [data-kiik-mood=quiet]) .kiik-tired-eyes,
.kiik-widget[data-kiik-mood=busy] .kiik-mood-busy,
.kiik-widget[data-kiik-mood=quiet] .kiik-mood-quiet,
.kiik-widget[data-kiik-mood=lunch] .kiik-mood-lunch,
.kiik-widget[data-kiik-mood=steady] .kiik-mood-steady { display: inline; }
.kiik-widget[data-kiik-mood=busy] .kiik-mood-avatar { animation: kiik-exhale 460ms ease-out 2; }
@keyframes kiik-exhale { 50% { transform: rotate(-7deg) scale(.96); } }
.kiik-mood-text {
  margin: 0;
  padding: 8px 14px;
  background: #f3f3f3;
  color: #333;
  border-bottom: 1px solid #ddd;
  font-size: 12px;
}
.kiik-settings-panel [data-kiik-key-group][hidden] { display: none !important; }
