/* Keranjang etalase — layout marketplace, aksen biru NeoShop */
.ke-page {
  --ke-brand: #0284c7;
  --ke-brand-deep: #0369a1;
  --ke-brand-soft: #e0f2fe;
  --ke-orange: var(--ke-brand);
  --ke-ink: #222;
  --ke-muted: #757575;
  --ke-line: #ebebeb;
  --ke-bg: #f5f5f5;
  --ke-green: #26aa99;
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  padding: 0 0 calc(5.5rem + env(safe-area-inset-bottom, 0px));
  background: var(--ke-bg);
  min-height: 60vh;
  color: var(--ke-ink);
  box-sizing: border-box;
}

.ke-top {
  position: sticky;
  top: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid var(--ke-line);
}
.ke-top-back {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--ke-brand);
  text-decoration: none;
  flex-shrink: 0;
}
.ke-top-title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}
.ke-top-title span {
  font-weight: 700;
  color: var(--ke-muted);
}
.ke-top-actions {
  flex-shrink: 0;
}
.ke-top-edit {
  border: 0;
  background: transparent;
  color: var(--ke-brand);
  font-size: 13px;
  font-weight: 800;
  padding: 6px 4px;
  cursor: pointer;
}

.ke-edit-bar {
  position: sticky;
  top: 52px;
  z-index: 34;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid var(--ke-line);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.ke-page.is-edit .ke-edit-bar {
  display: flex;
}
.ke-page.is-edit .ke-edit-bar[hidden] {
  display: flex !important;
}
.ke-edit-bar-btn {
  border: 0;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.ke-edit-bar-btn--danger {
  background: #fef2f2;
  color: #b91c1c;
}
.ke-edit-bar-btn--done {
  background: var(--ke-brand-soft);
  color: var(--ke-brand-deep);
}

.ke-alert {
  margin: 10px 12px 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}
.ke-alert-ok {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.ke-alert-err {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.ke-empty {
  padding: 3rem 1.25rem;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--ke-muted);
  line-height: 1.6;
}

.ke-kanal-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 12px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.ke-kanal-tabs::-webkit-scrollbar {
  display: none;
}
.ke-kanal-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--ke-line);
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.ke-kanal-tab.is-active {
  border-color: var(--ke-brand);
  background: var(--ke-brand-soft);
  color: var(--ke-brand-deep);
}
.ke-kanal-tab__n {
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--ke-brand);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ke-pos-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ke-muted);
}
.ke-pos-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--ke-brand-deep), var(--ke-brand));
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.ke-pos-badge--food {
  background: linear-gradient(90deg, #c2410c, #ea580c);
}
.ke-pos-badge--green {
  background: linear-gradient(90deg, #15803d, #22c55e);
}
.ke-pos-badge--neo {
  background: linear-gradient(90deg, #1e3a6e, #2563eb);
}

.ke-store {
  margin: 8px 0 0;
  background: #fff;
  border-top: 1px solid var(--ke-line);
  border-bottom: 1px solid var(--ke-line);
}
.ke-store:not(.is-active) {
  opacity: 0.72;
}
.ke-store-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #f3f4f6;
}
.ke-check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--ke-brand);
}
.ke-page:not(.is-edit) .ke-check {
  display: none;
}
.ke-store-badge {
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--ke-brand-soft);
  color: var(--ke-brand-deep);
  font-size: 10px;
  font-weight: 800;
}
.ke-store-badge--neo {
  background: #eef5fb;
  color: #1e3a6e;
}
.ke-store-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--ke-ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ke-store-edit,
.ke-store-clear-form button {
  border: 0;
  background: transparent;
  color: var(--ke-brand);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 0;
  cursor: pointer;
  flex-shrink: 0;
}

.ke-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #f3f4f6;
}
.ke-item:last-child {
  border-bottom: 0;
}
.ke-item-img-wrap {
  position: relative;
  flex-shrink: 0;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.ke-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ke-item-img-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 1.25rem;
}
.ke-stock-badge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
  padding: 2px 4px;
}
.ke-item-body {
  flex: 1;
  min-width: 0;
}
.ke-item-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ke-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: none;
}
a.ke-item-name:hover {
  color: var(--ke-brand);
}
a.ke-item-img-wrap {
  text-decoration: none;
  color: inherit;
}
.ke-item-unit {
  display: none;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ke-muted);
}
.ke-item-varian {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ke-muted);
}
.ke-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.ke-item-price {
  font-size: 14px;
  font-weight: 900;
  color: var(--ke-brand);
  white-space: nowrap;
}
.ke-item-qty-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ke-muted);
}
.ke-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.ke-qty button {
  width: 1.85rem;
  height: 1.85rem;
  border: 0;
  background: #f8fafc;
  color: #334155;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
}
.ke-qty button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.ke-qty input {
  width: 2.4rem;
  height: 1.85rem;
  border: 0;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  background: #fff;
  -moz-appearance: textfield;
}
.ke-qty input::-webkit-outer-spin-button,
.ke-qty input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ke-item-note-row {
  margin-top: 8px;
}
.ke-item-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.ke-item-note.has-note {
  background: var(--ke-brand-soft);
  color: var(--ke-brand-deep);
}
.ke-item-note-preview {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--ke-muted);
  line-height: 1.35;
}
.ke-item-note-preview[hidden] {
  display: none !important;
}
.ke-item-remove {
  display: none;
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: #dc2626;
  font-size: 12px;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}
.ke-page.is-edit .ke-item-remove {
  display: inline-block;
}

.ke-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 300;
  background: #fff;
  border-top: 1px solid var(--ke-line);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.1);
}
.ke-sticky-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  max-width: 100%;
  box-sizing: border-box;
}
.ke-sticky-summary {
  flex: 1;
  min-width: 0;
  text-align: right;
}
.ke-sticky-label {
  display: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--ke-muted);
}
.ke-sticky-all {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  flex-shrink: 0;
}
.ke-page.is-edit .ke-sticky-all {
  display: inline-flex;
}
.ke-sticky-total {
  flex: 1;
  min-width: 0;
  text-align: right;
}
.ke-sticky-summary .ke-sticky-total {
  flex: none;
}
.ke-sticky-total strong {
  font-size: 15px;
  font-weight: 900;
  color: var(--ke-brand);
}
.ke-sticky-btn {
  border: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--ke-brand-deep), var(--ke-brand));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  padding: 12px 18px;
  cursor: pointer;
  white-space: nowrap;
  min-width: 7.5rem;
  touch-action: manipulation;
}
.ke-sticky-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ke-note-sheet {
  /* Variabel di sini: sheet di-append ke .neo-portal-frame (di luar .ke-page) */
  --ke-brand: #0284c7;
  --ke-brand-deep: #0369a1;
  --ke-muted: #757575;
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.ke-note-sheet[hidden] {
  display: none !important;
}
.ke-note-sheet__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
}
.ke-note-sheet__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  background: #fff;
  color: #0f172a;
  border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}
.ke-note-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.ke-note-sheet__head strong,
.ke-note-sheet__head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}
.ke-note-sheet__close {
  border: 0;
  background: #f1f5f9 !important;
  background-image: none !important;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: #475569 !important;
  -webkit-text-fill-color: #475569 !important;
  cursor: pointer;
}
.ke-note-sheet__prod {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ke-muted, #757575);
}
.ke-note-sheet__input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  resize: vertical;
  min-height: 4.5rem;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  background: #fff !important;
}
.ke-note-sheet__actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}
.ke-note-sheet__clear,
.ke-note-sheet__save {
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 14px;
  cursor: pointer;
  background-image: none !important;
}
.ke-note-sheet__clear {
  background: #f1f5f9 !important;
  background-color: #f1f5f9 !important;
  color: #475569 !important;
  -webkit-text-fill-color: #475569 !important;
}
.ke-note-sheet__save {
  background: #0284c7 !important;
  background-color: #0284c7 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  margin-left: auto;
}

.ke-like {
  margin: 16px 0 0;
  padding: 0 0 12px;
}
.ke-like-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px 10px;
}
.ke-like-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}
.ke-like-head a {
  font-size: 12px;
  font-weight: 800;
  color: var(--ke-brand);
  text-decoration: none;
  white-space: nowrap;
}
.ke-like-rail {
  display: flex;
  gap: 10px;
  padding: 0 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.ke-like-rail::-webkit-scrollbar {
  display: none;
}
.ke-like-card {
  flex: 0 0 7.5rem;
  width: 7.5rem;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
}
.ke-like-img {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}
.ke-like-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ke-like-name {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ke-like-price {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 900;
  color: var(--ke-brand);
}
.ke-like-coret {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-decoration: line-through;
}

/* APK: tab bawah disembunyikan (fallback) — ruang untuk sticky checkout */
body.portal-hide-tabs .neo-portal-tabs {
  display: none !important;
}
body.neo-portal-app.portal-hide-tabs .ke-page {
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)) !important;
}
body.portal-hide-tabs .neo-aktif-fab {
  bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
}
/* Android: Checkout di atas menu tab — menu tetap kelihatan */
body.neo-portal-app:not(.portal-hide-tabs) .ke-sticky {
  bottom: calc(var(--portal-tab-h, 72px) + var(--portal-safe-b, 0px));
  padding-bottom: 10px !important;
}
body.neo-portal-app:not(.portal-hide-tabs) .ke-page {
  padding-bottom: calc(5.75rem + var(--portal-tab-h, 72px) + var(--portal-safe-b, 0px)) !important;
}
body.neo-portal-app:not(.portal-hide-tabs) .neo-aktif-fab {
  bottom: calc(5.5rem + var(--portal-tab-h, 72px) + var(--portal-safe-b, 0px));
}

@media (min-width: 768px) {
  body:not(.neo-portal-app) .ke-page {
    max-width: 100%;
    margin: 0;
    padding-bottom: 1.5rem;
    border-radius: 0;
    background: transparent;
  }
  body:not(.neo-portal-app) .ke-top {
    position: static;
    border-radius: 12px;
    border: 1px solid var(--ke-line);
    margin-bottom: 0;
  }
  body:not(.neo-portal-app) .ke-edit-bar {
    position: static;
    border-radius: 12px;
    margin-top: 8px;
    border: 1px solid var(--ke-line);
  }
  body:not(.neo-portal-app) .ke-store {
    margin: 12px 0 0;
    border: 1px solid var(--ke-line);
    border-radius: 12px;
    overflow: hidden;
  }
  body:not(.neo-portal-app) .ke-pos-head {
    margin-top: 12px;
    border-radius: 10px;
  }
  body:not(.neo-portal-app) .ke-item-img-wrap {
    width: 5.5rem;
    height: 5.5rem;
  }
  body:not(.neo-portal-app) .ke-item-name {
    font-size: 14px;
  }
  body:not(.neo-portal-app) .ke-item-unit {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: var(--ke-brand);
  }
  body:not(.neo-portal-app) .ke-sticky {
    position: sticky;
    top: 1rem;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none;
    width: 100%;
    max-width: none;
    border-radius: 12px;
    border: 1px solid var(--ke-line);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    margin-top: 12px;
    z-index: 20;
  }
  body:not(.neo-portal-app) .ke-sticky-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
  }
  body:not(.neo-portal-app) .ke-sticky-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    text-align: left;
  }
  body:not(.neo-portal-app) .ke-sticky-label {
    display: inline;
  }
  body:not(.neo-portal-app) .ke-sticky-total strong {
    font-size: 1.25rem;
  }
  body:not(.neo-portal-app) .ke-sticky-btn {
    width: 100%;
    text-align: center;
    padding: 12px 16px;
    font-size: 15px;
  }
  body:not(.neo-portal-app) .ke-like {
    margin-top: 20px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--ke-line);
    border-radius: 12px;
  }
  body:not(.neo-portal-app) .ke-like-head {
    padding: 0 0 12px;
  }
  body:not(.neo-portal-app) .ke-like-rail {
    padding: 0;
  }
  body.neo-portal-app .ke-page {
    max-width: 720px;
    margin: 0 auto;
    padding-bottom: 6rem;
    border-radius: 12px;
  }
  body.neo-portal-app .ke-sticky {
    max-width: 720px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 12px 12px 0 0;
  }
}

@media (min-width: 1024px) {
  body:not(.neo-portal-app) .ke-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.7fr);
    gap: 16px;
    align-items: start;
    padding-top: 12px;
  }
  body:not(.neo-portal-app) .ke-col {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
  }
  body:not(.neo-portal-app) .ke-col-side .ke-sticky {
    margin-top: 0;
  }
  body:not(.neo-portal-app) .ke-item {
    padding: 16px 18px;
    gap: 14px;
  }
  body:not(.neo-portal-app) .ke-item-img-wrap {
    width: 6.5rem;
    height: 6.5rem;
    border-radius: 10px;
  }
}
