:root {
  --bg:#eef1f4; --surface:#fff; --muted:#f2f4f7; --border:#d6dbe1;
  --text:#1e232b; --text-muted:#6f7782; --primary:#1f6feb;
  --primary-dark:#1859bd; --danger:#c62828; --radius:16px;
  --shadow:0 8px 24px rgb(0 0 0 / 10%); --safe-bottom:env(safe-area-inset-bottom,0px);
}
*{box-sizing:border-box} html,body{width:100%;min-height:100%;margin:0}
body{overflow:hidden;background:var(--bg);color:var(--text);font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
button,input{font:inherit} button{cursor:pointer} [hidden]{display:none!important}
.app-shell{display:grid;width:100%;height:100dvh;min-height:0;overflow:hidden;grid-template-rows:auto minmax(0,1fr)}
.app-header{display:flex;min-height:70px;align-items:center;justify-content:space-between;gap:16px;padding:12px 16px;background:var(--surface);border-bottom:1px solid var(--border)}
.brand{min-width:0}.brand h1{overflow:hidden;margin:0;font-size:1.15rem;text-overflow:ellipsis;white-space:nowrap}.brand p{margin:4px 0 0;color:var(--text-muted);font-size:.84rem}
.table-badge{flex:0 0 auto;padding:8px 12px;background:var(--muted);border:1px solid var(--border);border-radius:999px}
.app-main{display:grid;width:100%;height:100%;min-height:0;overflow:hidden}.ordering-layout{display:grid;width:100%;height:100%;min-height:0;max-height:100%;overflow:hidden;grid-template-columns:30% 45% 25%}
.panel{display:grid;min-width:0;min-height:0;overflow:hidden;grid-template-rows:auto minmax(0,1fr);background:var(--surface)}
.groups-panel,.articles-panel{border-right:1px solid var(--border)}.cart-preview-panel{grid-template-rows:auto minmax(0,1fr) auto}
.panel-header{min-height:58px;padding:13px 12px;background:#dfe5eb;border-bottom:1px solid #c8d0d8}
.panel-header h2{margin:0;font-size:1rem}.panel-header p{margin:4px 0 0;color:var(--text-muted);font-size:.76rem;line-height:1.3}
.category-list,.article-grid,.preview-items{min-height:0;height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable}
.category-list{padding:8px}.category-button{display:grid;width:100%;min-height:66px;grid-template-columns:50px minmax(0,1fr);align-items:center;gap:9px;margin-bottom:8px;padding:7px;background:#f0f2f5;color:var(--text);border:1px solid #d3d8de;border-radius:12px;text-align:left}
.category-button:hover{background:#e8ebef}.category-button.is-active{background:#dfe9f7;border-color:#8fb2df;box-shadow:inset 5px 0 0 var(--primary)}
.category-image,.article-image,.product-image-wrap{position:relative;display:grid;overflow:hidden;place-items:center;background:#e8ecf1;color:var(--text-muted)}
.category-image{width:50px;height:50px;border-radius:10px;font-size:.62rem;text-align:center}
.category-image img,.article-image img,.product-image-wrap img{width:100%;height:100%;object-fit:cover}
.category-title{display:block;min-width:0;font-size:clamp(.9rem,1.7vw,1.08rem);font-weight:800;line-height:1.12}.category-title-word{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.article-grid{display:grid;grid-template-columns:minmax(0,1fr);grid-auto-rows:max-content;align-content:start;gap:12px;padding:12px}
.article-card{display:grid;min-width:0;min-height:180px;grid-template-columns:38% minmax(0,1fr);grid-template-rows:minmax(180px,auto);overflow:hidden;padding:0;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:var(--radius);box-shadow:0 4px 14px rgb(0 0 0 / 7%);text-align:left}
.article-card:active{transform:scale(.985)}.article-image{font-size:.75rem}.article-body{display:flex;min-width:0;flex-direction:column;padding:11px}
.article-name{margin:0;font-size:.92rem;line-height:1.25}.article-description{display:-webkit-box;overflow:hidden;min-height:2.6em;margin:7px 0 10px;color:var(--text-muted);font-size:.76rem;line-height:1.35;overflow-wrap:break-word;word-break:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}
.article-price{margin-top:auto;color:var(--primary);font-size:1rem}
.preview-items{padding:8px 12px}.preview-item{padding:10px 0;border-bottom:1px solid var(--border)}.preview-row{display:flex;align-items:start;justify-content:space-between;gap:10px}
.preview-name{margin:0;font-size:.82rem;font-weight:700;line-height:1.25}.preview-options{margin:4px 0 0;color:var(--text-muted);font-size:.68rem;line-height:1.3}.preview-price{flex:0 0 auto;font-size:.78rem}
.empty-state{display:grid;min-height:0;place-items:center;padding:24px;color:var(--text-muted);text-align:center}.preview-footer{padding:12px;border-top:1px solid var(--border)}
.total-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.primary-button,.secondary-button,.add-to-cart-button{min-height:46px;padding:10px 14px;border-radius:12px;font-weight:750}
.primary-button,.add-to-cart-button{background:var(--primary);color:#fff;border:1px solid var(--primary)}.primary-button:hover,.add-to-cart-button:hover{background:var(--primary-dark)}
.secondary-button{background:var(--surface);color:var(--text);border:1px solid var(--border)}.preview-footer .primary-button{width:100%}
.count-badge{display:inline-grid;min-width:24px;min-height:24px;place-items:center;margin-left:6px;padding:2px 6px;background:rgb(255 255 255 / 18%);border-radius:999px}
.state-panel{display:grid;height:100%;place-items:center;align-content:center;gap:12px;padding:30px;color:var(--text-muted);text-align:center}.error-panel h2{color:var(--danger)}
.spinner{width:42px;height:42px;border:4px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:spin .85s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
.fullscreen-dialog{width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;padding:0;background:var(--bg);border:0}.fullscreen-dialog::backdrop,.cart-dialog::backdrop{background:rgb(0 0 0 / 45%)}
.product-dialog-layout{display:grid;height:100%;grid-template-rows:auto minmax(0,1fr) auto}.dialog-topbar{display:flex;min-height:62px;align-items:center;gap:14px;padding:10px 14px;background:var(--surface);border-bottom:1px solid var(--border)}
.back-button,.icon-button{min-height:42px;padding:8px 12px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:11px}
.back-button{background:var(--primary);color:#fff;border-color:var(--primary)}.back-button:hover{background:var(--primary-dark);border-color:var(--primary-dark)}
.product-dialog-scroll{overflow-y:auto;padding:14px}.product-hero{display:grid;grid-template-columns:minmax(180px,34%) minmax(0,1fr);gap:18px;width:min(100%,920px);margin:0 auto 18px}
.product-image-wrap{min-height:270px;border-radius:18px}.image-fallback{color:var(--text-muted);font-size:.85rem}.product-main-info{align-self:center}
.product-main-info h2{margin:0 0 10px;font-size:clamp(1.5rem,4vw,2.3rem);line-height:1.1}.product-main-info p{margin:0 0 18px;color:var(--text-muted);line-height:1.55;white-space:pre-line}.product-price{color:var(--primary);font-size:1.45rem}
.option-section{width:min(100%,920px);margin:0 auto 16px;padding:16px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius)}.option-section h3{margin:0 0 12px;font-size:1.02rem}
.option-list{display:grid;gap:8px}.option-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:11px;min-height:52px;padding:10px;background:var(--muted);border:1px solid var(--border);border-radius:12px}
.option-row input{width:22px;height:22px;margin:0;accent-color:var(--primary)}.option-name{font-size:.9rem;font-weight:700}.option-description{margin-top:3px;color:var(--text-muted);font-size:.74rem}.option-price{color:var(--primary);font-size:.84rem;font-weight:700}
.extra-info{color:var(--text-muted);line-height:1.5;white-space:pre-line}.recommendation-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.recommendation-card{display:flex;min-height:84px;flex-direction:column;justify-content:space-between;padding:11px;background:var(--muted);color:var(--text);border:1px solid var(--border);border-radius:12px;text-align:left}
.recommendation-card strong{font-size:.83rem;line-height:1.25}.recommendation-card span{margin-top:8px;color:var(--primary);font-size:.82rem;font-weight:700}
.product-footer{display:grid;grid-template-columns:auto minmax(220px,440px);align-items:center;justify-content:center;gap:12px;padding:12px 14px calc(12px + var(--safe-bottom));background:var(--surface);border-top:1px solid var(--border)}
.quantity-control{display:grid;grid-template-columns:46px 48px 46px;align-items:center;overflow:hidden;border:1px solid var(--border);border-radius:12px}.quantity-control button{height:48px;padding:0;background:var(--muted);border:0;font-size:1.35rem}.quantity-control strong{text-align:center}
.add-to-cart-button{display:flex;min-height:50px;align-items:center;justify-content:space-between;gap:16px}
.cart-dialog{width:min(100vw,720px);max-width:none;height:100dvh;max-height:none;margin:0 0 0 auto;padding:0;border:0}.cart-dialog-layout{display:grid;height:100%;grid-template-rows:auto minmax(0,1fr) auto;background:var(--surface)}
.cart-dialog-header{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 16px;border-bottom:1px solid var(--border)}.cart-dialog-header h2{margin:0}.cart-dialog-header p{margin:4px 0 0;color:var(--text-muted)}
.cart-items{overflow-y:auto;padding:8px 16px}.cart-item{padding:14px 0;border-bottom:1px solid var(--border)}.cart-item-top{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px}.cart-item-name{margin:0;font-size:.95rem}.cart-item-options{margin:5px 0 0;color:var(--text-muted);font-size:.74rem;line-height:1.4}
.cart-item-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px}.cart-qty-actions{display:flex;align-items:center;gap:7px}.qty-button{display:inline-grid;width:34px;height:34px;place-items:center;padding:0;background:var(--muted);border:1px solid var(--border);border-radius:10px}
.remove-button{padding:6px 9px;background:transparent;color:var(--danger);border:0;font-size:.78rem}.cart-footer{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:14px 16px calc(14px + var(--safe-bottom));border-top:1px solid var(--border)}.cart-footer .total-row{grid-column:1/-1;margin:0;font-size:1.1rem}
.mobile-cart-button{display:none}.toast{position:fixed;right:16px;bottom:calc(16px + var(--safe-bottom));left:16px;z-index:100;max-width:460px;margin:auto;padding:12px 16px;background:#20242b;color:white;border-radius:12px;box-shadow:var(--shadow);opacity:0;pointer-events:none;text-align:center;transform:translateY(12px);transition:opacity .18s ease,transform .18s ease}.toast.is-visible{opacity:1;transform:translateY(0)}
.notice-dialog{width:min(calc(100vw - 32px),480px);max-width:none;padding:0;background:var(--surface);border:0;border-radius:var(--radius);box-shadow:var(--shadow)}
.notice-dialog::backdrop{background:rgb(0 0 0 / 55%)}.notice-dialog-layout{display:grid;grid-template-rows:auto auto auto}.notice-dialog-header{padding:16px 18px;background:var(--primary);color:#fff}.notice-dialog-header h2{margin:0;font-size:1.1rem}.notice-dialog-content{padding:22px 18px;color:var(--text);line-height:1.5}.notice-dialog-content p{margin:0}.notice-dialog-footer{display:flex;justify-content:flex-end;padding:0 18px 18px}.notice-dialog-footer .primary-button{min-width:120px}
.session-status-dialog .notice-dialog-content{display:grid;gap:16px}.session-countdown{padding:12px;background:var(--muted);border:1px solid var(--border);border-radius:12px;color:var(--text-muted);font-weight:700;text-align:center}
@media(max-width:820px){.article-card{min-height:165px;grid-template-columns:40% minmax(0,1fr);grid-template-rows:minmax(165px,auto)}.category-button{min-height:58px;grid-template-columns:40px minmax(0,1fr)}.category-image{width:40px;height:40px}}
@media(max-width:620px){
  body{overflow:hidden}.app-shell{height:100dvh;padding-bottom:0}.app-header{min-height:62px;padding:9px 10px}.ordering-layout{grid-template-columns:32% 68%}.cart-preview-panel{display:none}.category-list{padding:5px}.category-button{display:block;min-height:60px;padding:7px 5px;text-align:center}.category-image{display:none}.category-title{font-size:.82rem;line-height:1.15}
  .article-grid{gap:8px;padding:8px}.article-card{min-height:150px;grid-template-columns:42% minmax(0,1fr);grid-template-rows:minmax(150px,auto);border-radius:12px}.article-body{padding:8px}.article-name{font-size:.78rem}.article-description{font-size:.68rem}
  .product-hero{grid-template-columns:1fr}.product-image-wrap{min-height:220px}.recommendation-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.product-footer{grid-template-columns:auto minmax(0,1fr);padding-inline:9px}.quantity-control{grid-template-columns:40px 36px 40px}
  .mobile-cart-button{position:fixed;right:10px;bottom:calc(8px + var(--safe-bottom));left:10px;z-index:20;display:flex;min-height:54px;align-items:center;justify-content:space-between;padding:10px 16px;background:var(--primary);color:#fff;border:0;border-radius:15px;box-shadow:var(--shadow);font-weight:750}
}


/* Vidni drsniki na namiznih brskalnikih */
.category-list,
.article-grid,
.preview-items,
.product-dialog-scroll,
.cart-items {
  scrollbar-width: thin;
  scrollbar-color: #b7bec8 transparent;
}

.category-list::-webkit-scrollbar,
.article-grid::-webkit-scrollbar,
.preview-items::-webkit-scrollbar,
.product-dialog-scroll::-webkit-scrollbar,
.cart-items::-webkit-scrollbar {
  width: 8px;
}

.category-list::-webkit-scrollbar-thumb,
.article-grid::-webkit-scrollbar-thumb,
.preview-items::-webkit-scrollbar-thumb,
.product-dialog-scroll::-webkit-scrollbar-thumb,
.cart-items::-webkit-scrollbar-thumb {
  background: #b7bec8;
  border-radius: 999px;
}

.category-list::-webkit-scrollbar-track,
.article-grid::-webkit-scrollbar-track,
.preview-items::-webkit-scrollbar-track,
.product-dialog-scroll::-webkit-scrollbar-track,
.cart-items::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 620px) {
  .category-list,
  .article-grid {
    padding-bottom: 82px;
  }

  .app-main,
  .ordering-layout,
  .groups-panel,
  .articles-panel {
    height: 100%;
    min-height: 0;
    max-height: 100%;
  }

  .category-list,
  .article-grid {
    touch-action: pan-y;
    overflow-y: scroll;
  }
}


.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-menu {
  position: relative;
}

.menu-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 11px;
  font-weight: 700;
}

.menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: min(260px, 82vw);
  padding: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: var(--shadow);
}

.language-choices button,
.waiter-choices button {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: 9px;
  text-align: left;
}

.language-choices button:hover,
.waiter-choices button:hover {
  background: var(--muted);
}

.language-choices,
.waiter-choices {
  display: grid;
  gap: 3px;
}

.waiter-button {
  white-space: nowrap;
}

.button-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  object-fit: contain;
}

.language-flag {
  width: 22px;
  height: 16px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 3px;
}

.waiter-choices button {
  justify-content: flex-start;
  gap: 10px;
}

.language-choices button {
  justify-content: flex-start;
  gap: 10px;
}

.language-choices button[data-language]::after {
  content: "";
}

@media (max-width: 620px) {
  .brand {
    display: none;
  }

  .app-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .menu-button {
    min-width: 42px;
    padding-inline: 9px;
  }

  .language-button {
    min-width: 68px;
  }

  .waiter-button {
    padding-inline: 7px;
    font-size: .72rem;
  }

  .waiter-choices {
    right: auto;
    left: 0;
  }

  .table-badge {
    padding-inline: 9px;
    font-size: .84rem;
  }
}


.groups-panel > .panel-header {
  background: #d9e0e7;
}

.articles-panel > .panel-header {
  background: #e4e9ee;
}

.panel-header h2 {
  color: #2b3541;
  font-weight: 800;
}

.category-list {
  background: #f7f8fa;
}


/* v9: enako visoki modri naslovni pasovi */
.groups-panel > .panel-header,
.articles-panel > .panel-header,
.cart-preview-panel > .panel-header {
  min-height: 68px;
  height: 68px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--primary);
  border-bottom-color: var(--primary-dark);
}

.groups-panel > .panel-header h2,
.articles-panel > .panel-header h2,
.cart-preview-panel > .panel-header h2,
.articles-panel > .panel-header p {
  color: #ffffff;
}

.articles-panel > .panel-header p {
  margin-top: 3px;
  opacity: .9;
}

/* Brez rezerviranega prostora in napisa, kadar slike ni */
.category-button.no-image {
  grid-template-columns: minmax(0, 1fr);
}

.category-button.no-image .category-title {
  width: 100%;
  text-align: center;
}

.article-card.no-image {
  display: block;
  min-height: 80px;
}

.article-card.no-image .article-body {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 4px;
  min-height: 80px;
  height: auto;
  padding: 8px 11px 14px;
  width: 100%;
}

.article-card.no-image .article-description {
  display: block;
  overflow: visible;
  min-height: 0;
  margin: 0;
  -webkit-box-orient: initial;
  -webkit-line-clamp: initial;
}

.article-card.no-image .article-price {
  margin: 0;
}

.product-hero.no-image {
  grid-template-columns: minmax(0, 1fr);
}

.product-hero.no-image .product-main-info {
  width: 100%;
}

/* Stanje postavk v košarici */
.order-status {
  display: inline-block;
  width: fit-content;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
}

.order-status.pending {
  background: #fff1c7;
  color: #725200;
}

.order-status.ordered {
  background: #dcefe2;
  color: #236238;
}

.preview-item.is-ordered,
.cart-item.is-ordered {
  opacity: .72;
}

.cart-item.is-ordered {
  background: #f5f7f5;
}

.qty-button:disabled {
  cursor: default;
  opacity: .45;
}

@media (max-width: 620px) {
  .groups-panel > .panel-header,
  .articles-panel > .panel-header {
    min-height: 74px;
    height: 74px;
  }
}
