/* ===== KlassBox v2 - Lieferando-Stil ===== */

:root {
  --kb2-primary: #FF6B35;
  --kb2-primary-dark: #E55A2B;
  --kb2-primary-light: #FF8F66;
  --kb2-bg: #f5f5f5;
  --kb2-white: #FFFFFF;
  --kb2-text: #1a1a1a;
  --kb2-text-muted: #777777;
  --kb2-border: #e8e8e8;
  --kb2-success: #34C759;
  --kb2-error: #FF3B30;
  --kb2-warning: #FF9500;
  --kb2-radius: 16px;
  --kb2-radius-sm: 10px;
  --kb2-shadow: 0 1px 4px rgba(0,0,0,0.06);
  --kb2-shadow-lg: 0 8px 24px rgba(0,0,0,0.10);
  --kb2-transition: 0.2s ease;
  --kb2-header-h: 56px;
  --kb2-nav-h: 100px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Prevent double-tap zoom everywhere (Safari ignores user-scalable=no) */
html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

/* Prevent Safari auto-zoom on input focus (requires >= 16px font) */
@media (max-width: 600px) {
  input, select, textarea { font-size: 16px !important; }
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--kb2-bg);
  color: var(--kb2-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== Header (56px, sticky) ===== */
.kb2-header {
  height: var(--kb2-header-h);
  background: var(--kb2-white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--kb2-border);
}

.kb2-header__inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kb2-header__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kb2-header__back {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--kb2-bg);
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  align-items: center;
  justify-content: center;
  color: var(--kb2-text);
  transition: background var(--kb2-transition);
}
.kb2-header__back:hover { background: var(--kb2-border); }
.kb2-header__back--visible { display: flex; }

.kb2-header__brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.kb2-header__logo {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.kb2-header__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Header Icon Buttons (Cart + Account) */
.kb2-header__icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--kb2-transition);
  color: var(--kb2-text);
}
.kb2-header__icon-btn:hover { background: var(--kb2-bg); }
.kb2-header__icon-btn svg { width: 22px; height: 22px; }

.kb2-header__cart-badge {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--kb2-primary);
  color: var(--kb2-white);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* Account Dropdown */
.kb2-header__account { position: relative; }

.kb2-header__account-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--kb2-white);
  border-radius: var(--kb2-radius-sm);
  box-shadow: var(--kb2-shadow-lg);
  border: 1px solid var(--kb2-border);
  min-width: 200px;
  z-index: 110;
  overflow: hidden;
}
.kb2-header__account-dropdown--open { display: block; }

.kb2-header__account-dropdown .kb2-dropdown__name {
  padding: 12px 16px 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--kb2-text);
  border-bottom: 1px solid var(--kb2-border);
}

.kb2-header__account-dropdown a,
.kb2-header__account-dropdown button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--kb2-text);
  text-align: left;
  text-decoration: none;
  transition: background var(--kb2-transition);
}
.kb2-header__account-dropdown a:hover,
.kb2-header__account-dropdown button:hover { background: var(--kb2-bg); }
.kb2-header__account-dropdown .kb2-dropdown__logout { color: var(--kb2-error); border-top: 1px solid var(--kb2-border); }

/* ===== Date Navigation (2-stufig) ===== */
.kb2-date-nav {
  background: var(--kb2-white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  position: sticky;
  top: var(--kb2-header-h);
  z-index: 90;
}

/* Wochen-Tabs (obere Leiste) */
.kb2-week-tabs {
  display: flex;
  max-width: 1000px;
  margin: 0 auto;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 6px;
}
.kb2-week-tabs::-webkit-scrollbar { display: none; }

.kb2-week-tab {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--kb2-text-muted);
  white-space: nowrap;
  transition: all var(--kb2-transition);
  text-align: center;
}
.kb2-week-tab:hover { background: var(--kb2-bg); color: var(--kb2-text); }
.kb2-week-tab--active {
  border-color: var(--kb2-primary);
  background: rgba(255, 107, 53, 0.06);
  color: var(--kb2-primary);
}
.kb2-week-tab__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kb2-week-tab__dot--has-open {
  background: var(--kb2-success);
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.5);
}
.kb2-week-tab__dot--all-preorder {
  background: var(--kb2-primary);
}

/* Tages-Chips (untere Leiste) */
.kb2-day-strip {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
}

.kb2-day-strip__scroll {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 44px;
  overflow-x: auto;
  scrollbar-width: none;
}
.kb2-day-strip__scroll::-webkit-scrollbar { display: none; }

/* White fade edges - only visible when corresponding arrow is active */
.kb2-day-strip::before,
.kb2-day-strip::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40px;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--kb2-transition);
}
.kb2-day-strip::before {
  left: 0;
  background: linear-gradient(to right, var(--kb2-white) 30%, transparent);
}
.kb2-day-strip::after {
  right: 0;
  background: linear-gradient(to left, var(--kb2-white) 30%, transparent);
}
.kb2-day-strip--fade-left::before { opacity: 1; }
.kb2-day-strip--fade-right::after { opacity: 1; }

.kb2-day-strip__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 1px solid var(--kb2-border);
  border-radius: 50%;
  background: var(--kb2-white);
  cursor: pointer;
  font-size: 18px;
  color: var(--kb2-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: all var(--kb2-transition);
  box-shadow: var(--kb2-shadow);
}
.kb2-day-strip__arrow:hover { background: var(--kb2-bg); color: var(--kb2-text); }
.kb2-day-strip__arrow--hidden { opacity: 0; pointer-events: none; }
.kb2-day-strip__arrow--left { left: 8px; }
.kb2-day-strip__arrow--right { right: 8px; }

.kb2-date-chip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 2px solid transparent;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--kb2-text-muted);
  transition: all var(--kb2-transition);
  position: relative;
  min-width: 80px;
}
.kb2-date-chip:hover { background: var(--kb2-bg); }

.kb2-date-chip--active {
  border-color: var(--kb2-primary);
  background: rgba(255, 107, 53, 0.06);
  color: var(--kb2-primary);
}
.kb2-date-chip--active:hover { background: rgba(255, 107, 53, 0.1); }

.kb2-date-chip--past {
  opacity: 0.4;
  cursor: not-allowed;
}

.kb2-date-chip--closed {
  opacity: 0.6;
}

.kb2-date-chip__day {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
}

.kb2-date-chip__date {
  font-size: 11px;
  line-height: 1.2;
}

.kb2-date-chip__status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.kb2-date-chip__status--open {
  background: var(--kb2-success);
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.5);
}
.kb2-date-chip__status--closed {
  background: var(--kb2-error);
}
.kb2-date-chip__status--preorder {
  background: var(--kb2-primary);
}
.kb2-date-chip__status--past {
  background: #ccc;
}

/* Order deadline hint banner */
.kb2-deadline-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(52, 199, 89, 0.06);
  max-width: 1000px;
  margin: 0 auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--kb2-success);
}
.kb2-deadline-hint--urgent {
  background: rgba(255, 149, 0, 0.08);
  color: var(--kb2-warning);
}
.kb2-deadline-hint--closed {
  background: rgba(255, 59, 48, 0.06);
  color: var(--kb2-error);
}
.kb2-deadline-hint__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  animation: kb2-pulse-dot 1.5s ease-in-out infinite;
}
@keyframes kb2-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
.kb2-deadline-hint__text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kb2-deadline-hint__countdown {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* ===== Layout ===== */
.kb2-layout {
  flex: 1;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  padding: 0 16px;
  min-height: calc(100vh - var(--kb2-header-h) - var(--kb2-nav-h));
}

.kb2-main {
  padding: 20px 0 100px;
}

@media (min-width: 1024px) {
  .kb2-main {
    padding-bottom: 40px;
  }
}

/* ===== States ===== */
.kb2-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--kb2-text-muted);
}

.kb2-state__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.kb2-state__icon--error { background: rgba(255,59,48,0.1); color: var(--kb2-error); }
.kb2-state__icon--success { background: rgba(52,199,89,0.12); color: var(--kb2-success); width: 72px; height: 72px; font-size: 36px; }

.kb2-state__title { font-size: 20px; font-weight: 700; margin-bottom: 8px; color: var(--kb2-text); }
.kb2-state__text { max-width: 400px; margin: 0 auto; }

.kb2-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--kb2-border);
  border-top-color: var(--kb2-primary);
  border-radius: 50%;
  animation: kb2-spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes kb2-spin { to { transform: rotate(360deg); } }

/* ===== Product Grid (Lieferando-Stil) ===== */
.kb2-products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 480px) { .kb2-products-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .kb2-products-grid { grid-template-columns: repeat(3, 1fr); } }

/* ===== Product Card ===== */
.kb2-product {
  background: var(--kb2-white);
  border-radius: var(--kb2-radius);
  overflow: hidden;
  transition: transform var(--kb2-transition), box-shadow var(--kb2-transition);
  cursor: pointer;
  position: relative;
}
.kb2-product:hover {
  transform: translateY(-2px);
  box-shadow: var(--kb2-shadow-lg);
}

.kb2-product__image-wrap {
  position: relative;
  overflow: hidden;
}

.kb2-product__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--kb2-bg);
}

.kb2-product__image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #ddd;
  background: var(--kb2-bg);
  aspect-ratio: 4 / 3;
}

.kb2-product__add-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--kb2-primary);
  color: var(--kb2-white);
  border: none;
  font-size: 22px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(255,107,53,0.4);
  transition: transform var(--kb2-transition), background var(--kb2-transition);
  z-index: 2;
  line-height: 1;
}
.kb2-product__add-btn:hover {
  transform: scale(1.1);
  background: var(--kb2-primary-dark);
}

.kb2-product__body {
  padding: 12px 14px 14px;
}

.kb2-product__name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.3;
}

.kb2-product__desc {
  font-size: 13px;
  color: var(--kb2-text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.kb2-product__price {
  font-size: 16px;
  font-weight: 700;
  color: var(--kb2-primary);
}

/* ===== Buttons ===== */
.kb2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--kb2-radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--kb2-transition);
  white-space: nowrap;
}
.kb2-btn--primary { background: var(--kb2-primary); color: var(--kb2-white); }
.kb2-btn--primary:hover { background: var(--kb2-primary-dark); }
.kb2-btn--primary:disabled { background: #ccc; cursor: not-allowed; }
.kb2-btn--secondary { background: var(--kb2-white); color: var(--kb2-text); border: 1px solid var(--kb2-border); }
.kb2-btn--secondary:hover { background: var(--kb2-bg); }
.kb2-btn--ghost { background: transparent; color: var(--kb2-text-muted); }
.kb2-btn--ghost:hover { color: var(--kb2-text); }
.kb2-btn--lg { padding: 14px 28px; font-size: 16px; }

/* ===== Qty ===== */
.kb2-qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--kb2-border);
  border-radius: var(--kb2-radius-sm);
  overflow: hidden;
}
.kb2-qty__btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--kb2-bg);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: var(--kb2-text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--kb2-transition);
  font-family: inherit;
}
.kb2-qty__btn:hover { background: var(--kb2-border); }
.kb2-qty__value {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  background: var(--kb2-white);
}

/* ===== Cart Drawer (Off-Canvas rechts) ===== */
.kb2-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.kb2-drawer-backdrop--visible {
  opacity: 1;
  visibility: visible;
}

.kb2-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 90vw;
  max-width: 440px;
  z-index: 1050;
  background: var(--kb2-white);
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  overflow: hidden;
}
.kb2-drawer--open {
  transform: translateX(0);
}

.kb2-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--kb2-border);
  flex-shrink: 0;
}
.kb2-drawer__title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}
.kb2-drawer__header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.kb2-drawer__clear {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--kb2-error);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background var(--kb2-transition);
}
.kb2-drawer__clear:hover { background: rgba(255,59,48,0.06); }
.kb2-drawer__close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--kb2-bg);
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--kb2-text);
  transition: background var(--kb2-transition);
}
.kb2-drawer__close:hover { background: var(--kb2-border); }

.kb2-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  -webkit-overflow-scrolling: touch;
}

.kb2-drawer__footer {
  border-top: 1px solid var(--kb2-border);
  padding: 16px 20px;
  flex-shrink: 0;
  background: var(--kb2-white);
}

.kb2-drawer__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
}

.kb2-cart-panel__empty {
  text-align: center;
  padding: 60px 0;
  color: var(--kb2-text-muted);
  font-size: 14px;
}

body.kb2-drawer-open {
  overflow: hidden;
}

@media (max-width: 480px) {
  .kb2-drawer {
    width: 100vw;
    max-width: none;
  }
}

/* ===== Cart Item (shared) ===== */
.kb2-cart-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  align-items: flex-start;
}
.kb2-cart-item + .kb2-cart-item { border-top: 1px solid var(--kb2-bg); }

.kb2-cart-item__image {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--kb2-bg);
}

.kb2-cart-item__info { flex: 1; min-width: 0; }

.kb2-cart-item__name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.kb2-cart-item__name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 2px;
}

.kb2-cart-item__actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.kb2-cart-item__edit {
  width: 26px; height: 26px;
  border: none; background: none;
  cursor: pointer; color: var(--kb2-primary);
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; flex-shrink: 0;
  transition: background 0.15s ease;
  padding: 0;
}
.kb2-cart-item__edit:hover {
  background: rgba(255,107,53,0.08);
}
.kb2-cart-item__delete {
  width: 26px; height: 26px;
  border: none; background: none;
  cursor: pointer; color: var(--kb2-error);
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; flex-shrink: 0;
  transition: background 0.15s ease;
  padding: 0;
}
.kb2-cart-item__delete:hover {
  background: rgba(255,59,48,0.08);
}

.kb2-cart-item__options {
  font-size: 11px;
  color: var(--kb2-text-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kb2-cart-item__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.kb2-cart-item__price {
  font-size: 13px;
  font-weight: 600;
  color: var(--kb2-primary);
}

.kb2-cart-item__qty {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--kb2-border);
  border-radius: 6px;
  overflow: hidden;
}

.kb2-cart-item__qty-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: var(--kb2-bg);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--kb2-text);
  transition: background var(--kb2-transition);
  font-family: inherit;
}
.kb2-cart-item__qty-btn:hover { background: var(--kb2-border); }

.kb2-cart-item__qty-val {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--kb2-white);
}

.kb2-cart-item__note {
  font-size: 11px;
  color: var(--kb2-warning);
  font-style: italic;
  line-height: 1.3;
  margin-top: 2px;
}

/* Cart day group */
.kb2-cart-day-group { margin-bottom: 12px; }

.kb2-cart-day-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--kb2-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 5px 10px;
  border: 1.5px solid var(--kb2-primary);
  border-radius: 8px;
  background: rgba(255, 107, 53, 0.06);
  display: inline-block;
  margin-bottom: 4px;
}

/* ===== Mobile Cart Bottom-Bar ===== */
.kb2-cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--kb2-white);
  padding: 10px 16px;
  z-index: 200;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  border-top: 1px solid var(--kb2-border);
  animation: kb2-slideUp 0.3s ease;
}

@media (min-width: 601px) {
  .kb2-cart-bar { display: none !important; }
}

@keyframes kb2-slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.kb2-cart-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 600px;
  margin: 0 auto;
}

.kb2-cart-bar__info { display: flex; align-items: center; gap: 12px; }
.kb2-cart-bar__count { font-size: 13px; color: var(--kb2-text-muted); }
.kb2-cart-bar__total { font-size: 18px; font-weight: 700; }

/* Bottom Sheet CSS removed - replaced by off-canvas drawer */

/* ===== Product Modal ===== */
.kb2-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kb2-modal__backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
}

.kb2-modal__content {
  position: relative;
  background: var(--kb2-white);
  border-radius: var(--kb2-radius);
  max-width: 560px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  animation: kb2-modalIn 0.25s ease;
}
@keyframes kb2-modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modal close button now handled by topbar in product-options.js */

.kb2-modal__hero {
  width: 100%;
  position: relative;
  overflow: hidden;
  transition: height 0.15s ease;
}
.kb2-modal__image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--kb2-radius) var(--kb2-radius) 0 0;
  display: block;
  transition: height 0.15s ease;
}
.kb2-modal__hero--shrunk .kb2-modal__image {
  height: 60px;
}
.kb2-modal__hero-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(transparent, rgba(255,255,255,0.6));
  pointer-events: none;
}

.kb2-modal__header { padding: 16px 20px 8px; }
.kb2-modal__name { font-size: 20px; font-weight: 700; margin: 0; line-height: 1.3; }
.kb2-modal__price { font-size: 16px; font-weight: 600; color: var(--kb2-primary); }

.kb2-modal__desc {
  padding: 8px 20px;
  background: #f5f5f5;
  border-top: 1px solid var(--kb2-border);
}

.kb2-modal__desc-toggle { font-size: 13px; color: var(--kb2-text-muted); line-height: 1.5; }
.kb2-modal__desc-link { font-size: 12px; font-weight: 600; color: var(--kb2-primary); text-decoration: none; margin-left: 2px; }
.kb2-modal__desc-link:hover { text-decoration: underline; }
.kb2-modal__short-desc { font-size: 13px; color: var(--kb2-text-muted); line-height: 1.5; margin: 4px 0 0; }

.kb2-modal__ingredients { margin-top: 4px; }
.kb2-modal__ingredients summary {
  font-size: 13px; font-weight: 600; color: var(--kb2-warning);
  cursor: pointer; padding: 6px 0; list-style: none;
  display: flex; align-items: center; gap: 6px;
}
.kb2-modal__ingredients summary::before { content: '\26A0'; font-size: 14px; }
.kb2-modal__ingredients summary::after { content: '\25B6'; font-size: 9px; transition: transform 0.2s; margin-left: auto; }
.kb2-modal__ingredients[open] summary::after { transform: rotate(90deg); }
.kb2-modal__ingredients-content {
  font-size: 12px; color: var(--kb2-text-muted); line-height: 1.6;
  padding: 8px 12px; background: var(--kb2-bg); border-radius: var(--kb2-radius-sm); margin-top: 4px;
}
.kb2-modal__ingredients-content p { margin-bottom: 6px; }
.kb2-modal__ingredients-content p:last-child { margin-bottom: 0; }

.kb2-modal__options {
  padding: 0 20px;
  flex: 1;
}

/* Option groups */
.kb2-option-group {
  padding: 16px 0;
  border-top: 1px solid var(--kb2-border);
}
.kb2-option-group__label {
  font-size: 15px; font-weight: 600; margin-bottom: 4px;
  color: var(--kb2-text); display: flex; align-items: center; gap: 8px;
}
.kb2-option-group__number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--kb2-primary); color: var(--kb2-white);
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.kb2-option-group__desc { font-size: 13px; color: var(--kb2-text-muted); margin-bottom: 10px; margin-left: 32px; }
.kb2-option-group__swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.kb2-option-group--error .kb2-option-group__swatches {
  border: 2px solid #ef4444; border-radius: var(--kb2-radius-sm); padding: 8px;
}
.kb2-option-group__error { color: #ef4444; font-size: 12px; font-weight: 600; margin: 0 0 6px 32px; }

/* Swatches */
.kb2-swatch {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 8px; border: 2px solid var(--kb2-border); border-radius: var(--kb2-radius-sm);
  cursor: pointer; transition: all var(--kb2-transition);
  text-align: center; background: var(--kb2-white);
}
.kb2-swatch:hover { border-color: var(--kb2-primary-light); }
.kb2-swatch--selected { border-color: var(--kb2-primary); background: rgba(255,107,53,0.04); }

.kb2-swatch__image { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--kb2-bg); }
.kb2-swatch__label { font-size: 12px; font-weight: 500; line-height: 1.2; color: var(--kb2-text); word-break: break-word; }
.kb2-swatch__price { font-size: 11px; font-weight: 600; color: var(--kb2-primary); }

.kb2-swatch--qty-item { cursor: pointer; }
.kb2-swatch--qty-item:hover { border-color: var(--kb2-primary-light); }
.kb2-swatch--qty-item.kb2-swatch--selected { border-color: var(--kb2-primary); background: rgba(255,107,53,0.04); }

.kb2-swatch__qty, .kb2-swatch__qty--always-visible {
  display: flex; align-items: center; justify-content: center;
  gap: 2px; margin-top: auto; padding-top: 6px; width: 100%;
}
.kb2-swatch__qty-btn {
  width: 30px; height: 30px; border: none; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  padding: 0; line-height: 0;
}
.kb2-swatch__qty-btn--minus { background: var(--kb2-border); color: var(--kb2-text); }
.kb2-swatch__qty-btn--minus:hover { background: #d0d0d0; }
.kb2-swatch__qty-btn--minus:active { background: #bbb; }
.kb2-swatch__qty-btn--plus { background: var(--kb2-primary); color: var(--kb2-white); }
.kb2-swatch__qty-btn--plus:hover { background: var(--kb2-primary-dark); }
.kb2-swatch__qty-btn--plus:active { background: #c74a1e; }
.kb2-swatch__qty-value {
  width: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; pointer-events: none;
}

/* Text Swatch */
.kb2-text-swatch {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border: 2px solid var(--kb2-border); border-radius: var(--kb2-radius-sm);
  background: var(--kb2-white); cursor: pointer; font-family: inherit;
  font-size: 14px; font-weight: 500; color: var(--kb2-text); transition: all var(--kb2-transition);
}
.kb2-text-swatch:hover { border-color: var(--kb2-primary-light); }
.kb2-text-swatch--selected { border-color: var(--kb2-primary); background: rgba(255,107,53,0.06); color: var(--kb2-primary); }
.kb2-text-swatch__label { font-weight: 600; }

/* Modal footer */
.kb2-modal__footer {
  position: sticky; bottom: 0;
  background: var(--kb2-white);
  border-top: 1px solid var(--kb2-border);
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-radius: 0 0 var(--kb2-radius) var(--kb2-radius);
}
.kb2-modal__total { display: flex; flex-direction: column; gap: 2px; }
.kb2-modal__total span:first-child { font-size: 12px; color: var(--kb2-text-muted); font-weight: 500; }
.kb2-modal__total span:last-child { font-size: 20px; font-weight: 700; color: var(--kb2-text); }
.kb2-modal__actions { display: flex; align-items: center; gap: 10px; }

/* Summary in modal */
.kb2-summary { padding: 16px 0; }
.kb2-summary__title { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: var(--kb2-text); }
.kb2-summary__items {
  background: var(--kb2-bg); border-radius: var(--kb2-radius-sm);
  padding: 16px; margin-bottom: 16px;
}
.kb2-summary__row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; font-size: 14px; color: var(--kb2-text);
}
.kb2-summary__row + .kb2-summary__row { border-top: 1px solid var(--kb2-border); }
.kb2-summary__row--option { font-size: 13px; color: var(--kb2-text-muted); }
.kb2-summary__row--option span:last-child { font-weight: 500; color: var(--kb2-primary); }
.kb2-summary__row--qty { font-weight: 600; }
.kb2-summary__row--total {
  border-top: 2px solid var(--kb2-text) !important;
  font-weight: 700; font-size: 16px; padding-top: 12px; margin-top: 4px;
}
.kb2-summary__back { width: 100%; }

/* ===== Checkout ===== */
.kb2-checkout__title { font-size: 22px; font-weight: 700; margin-bottom: 24px; }

.kb2-checkout__summary {
  background: var(--kb2-white); border-radius: var(--kb2-radius);
  padding: 20px; margin-bottom: 24px; border: 1px solid var(--kb2-border);
}

.kb2-checkout__week-label {
  font-size: 13px; font-weight: 700; color: var(--kb2-primary);
  padding: 6px 12px; border: 2px solid var(--kb2-primary);
  border-radius: 10px; background: rgba(255, 107, 53, 0.06);
  margin-top: 12px; display: inline-block; margin-bottom: 8px;
}
.kb2-checkout__week-label:first-child { margin-top: 0; }

.kb2-checkout__day-label {
  font-size: 11px; font-weight: 700; color: var(--kb2-text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 4px 10px; border: 1.5px solid var(--kb2-border);
  border-radius: 8px; display: inline-block; margin: 6px 0 4px;
}

.kb2-checkout__summary-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; font-size: 14px;
}
.kb2-checkout__summary-item + .kb2-checkout__summary-item { border-top: 1px solid var(--kb2-bg); }
.kb2-checkout__summary-item--total {
  border-top: 2px solid var(--kb2-text) !important;
  font-weight: 700; font-size: 16px; padding-top: 12px; margin-top: 8px;
}
.kb2-checkout__summary-qty { color: var(--kb2-text-muted); font-size: 13px; }
.kb2-checkout__summary-options { font-size: 12px; color: var(--kb2-text-muted); margin-top: 2px; line-height: 1.4; }
.kb2-checkout__summary-note { font-size: 11px; color: var(--kb2-warning); font-style: italic; margin-top: 2px; }

.kb2-checkout__summary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.kb2-checkout__edit-btn {
  width: 26px; height: 26px;
  border: none; background: none;
  cursor: pointer; color: var(--kb2-primary);
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; flex-shrink: 0;
  transition: background 0.15s ease;
  padding: 0;
}
.kb2-checkout__edit-btn:hover {
  background: rgba(255,107,53,0.08);
}

.kb2-checkout__form {
  background: var(--kb2-white); border-radius: var(--kb2-radius);
  padding: 24px; border: 1px solid var(--kb2-border);
}
.kb2-checkout__form h3 { font-size: 17px; font-weight: 600; margin-bottom: 16px; }

.kb2-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kb2-form-group { margin-bottom: 14px; }
.kb2-form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--kb2-text-muted); margin-bottom: 4px; }
.kb2-form-group input,
.kb2-form-group textarea,
.kb2-form-group select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--kb2-border);
  border-radius: var(--kb2-radius-sm); font-family: inherit;
  font-size: 15px; color: var(--kb2-text); background: var(--kb2-white);
  transition: border-color var(--kb2-transition);
}
.kb2-form-group input[readonly] { background: #f0f0f0; color: var(--kb2-text-muted); cursor: not-allowed; }
.kb2-form-group input:focus,
.kb2-form-group textarea:focus,
.kb2-form-group select:focus { outline: none; border-color: var(--kb2-primary); box-shadow: 0 0 0 3px rgba(255,107,53,0.1); }

.kb2-checkout__actions {
  display: flex; justify-content: space-between; align-items: center; margin-top: 20px; gap: 12px;
}

/* ===== Auth Modal ===== */
.kb2-auth-modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 500; display: none; align-items: center; justify-content: center;
}
.kb2-auth-modal--open { display: flex; }

.kb2-auth-modal__backdrop {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4);
}
.kb2-auth-modal__content {
  position: relative; background: var(--kb2-white); border-radius: var(--kb2-radius);
  max-width: 420px; width: 92%; padding: 32px 28px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  animation: kb2-modalIn 0.25s ease; z-index: 1;
}
.kb2-auth-modal__close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border: none; background: var(--kb2-bg);
  border-radius: 50%; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--kb2-text);
}
.kb2-auth-modal__close:hover { background: var(--kb2-border); }
.kb2-auth-modal__title { font-size: 22px; font-weight: 700; margin-bottom: 20px; }

.kb2-auth-modal .kb2-form-group { margin-bottom: 16px; }
.kb2-auth-modal .kb2-form-group input { padding: 12px 14px; font-size: 15px; }
.kb2-auth-modal__submit { width: 100%; padding: 14px; margin-top: 8px; }

.kb2-auth-modal__error {
  display: none; padding: 10px 14px;
  background: rgba(255,59,48,0.08); border: 1px solid rgba(255,59,48,0.2);
  border-radius: var(--kb2-radius-sm); color: var(--kb2-error);
  font-size: 13px; font-weight: 500; margin-bottom: 12px;
}
.kb2-auth-modal__error--visible { display: block; }

.kb2-auth-modal__switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--kb2-text-muted); }
.kb2-auth-modal__switch a { color: var(--kb2-primary); text-decoration: none; font-weight: 600; cursor: pointer; }
.kb2-auth-modal__switch a:hover { text-decoration: underline; }

/* ===== Mobile Responsive ===== */
@media (max-width: 600px) {
  .kb2-modal { align-items: flex-end; }
  .kb2-modal__content {
    width: 100%; max-height: 92vh;
    border-radius: 16px 16px 0 0;
    animation: kb2-slideUp 0.3s ease;
  }
  .kb2-modal__image { height: 140px; border-radius: 16px 16px 0 0; }
  .kb2-modal__header { padding: 14px 16px 6px; }
  .kb2-modal__options { padding: 0 16px; }
  .kb2-modal__footer { padding: 12px 16px; border-radius: 0; }
  .kb2-swatch { padding: 8px 6px; }
  .kb2-swatch__image { width: 54px; height: 54px; }

  .kb2-form-row { grid-template-columns: 1fr; }
  .kb2-checkout__actions { flex-direction: column-reverse; }
  .kb2-checkout__actions .kb2-btn { width: 100%; }

  .kb2-auth-modal__content {
    width: 100%; max-width: none;
    border-radius: 16px 16px 0 0;
    position: absolute; bottom: 0;
    animation: kb2-slideUp 0.3s ease;
  }

  .kb2-summary__title { font-size: 18px; text-align: center; margin-bottom: 12px; }
  .kb2-summary__items { padding: 12px; }
  .kb2-summary__row { flex-wrap: wrap; padding: 10px 0; gap: 4px; }
  .kb2-summary__row--total { background: var(--kb2-bg); border-radius: var(--kb2-radius-sm); padding: 12px; margin-top: 8px; font-size: 18px; }
  .kb2-summary__back { padding: 14px; font-size: 15px; margin-top: 8px; }
}

/* ===== Orders View ===== */
.kb2-orders__title { font-size: 22px; font-weight: 700; margin-bottom: 24px; }
.kb2-orders__section-title { font-size: 16px; font-weight: 700; color: var(--kb2-text-muted); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; font-size: 13px; }
.kb2-orders__loading { text-align: center; padding: 40px 0; }
.kb2-orders__empty { text-align: center; padding: 30px 0; color: var(--kb2-text-muted); font-size: 14px; }
.kb2-orders__error { text-align: center; padding: 30px 0; color: var(--kb2-error); font-size: 14px; }
.kb2-orders__active { margin-bottom: 32px; }

.kb2-order-card {
  background: var(--kb2-white);
  border-radius: var(--kb2-radius);
  border: 1px solid var(--kb2-border);
  padding: 16px;
  margin-bottom: 12px;
}
.kb2-order-card--active { border-left: 3px solid var(--kb2-primary); }

.kb2-order-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.kb2-order-card__number { font-weight: 700; font-size: 15px; }
.kb2-order-card__date { font-size: 13px; color: var(--kb2-text-muted); margin-left: 8px; }
.kb2-order-card__header-right { display: flex; align-items: center; gap: 8px; }
.kb2-order-card__total-compact { font-weight: 700; font-size: 15px; }

.kb2-order-card__badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.kb2-order-card__badge--on-hold,
.kb2-order-card__badge--pending { background: rgba(255,149,0,0.1); color: var(--kb2-warning); }
.kb2-order-card__badge--processing { background: rgba(0,122,255,0.1); color: #007AFF; }
.kb2-order-card__badge--completed { background: rgba(52,199,89,0.1); color: var(--kb2-success); }
.kb2-order-card__badge--cancelled,
.kb2-order-card__badge--refunded { background: rgba(255,59,48,0.08); color: var(--kb2-error); }

/* Progress bar */
.kb2-progress-bar {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  gap: 0;
}
.kb2-progress-bar__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.kb2-progress-bar__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--kb2-border);
  transition: all 0.3s ease;
}
.kb2-progress-bar__step--active .kb2-progress-bar__dot { background: var(--kb2-primary); }
.kb2-progress-bar__step--current .kb2-progress-bar__dot {
  width: 16px;
  height: 16px;
  box-shadow: 0 0 0 3px rgba(255,107,53,0.2);
}
.kb2-progress-bar__label { font-size: 10px; font-weight: 600; color: var(--kb2-text-muted); white-space: nowrap; }
.kb2-progress-bar__step--active .kb2-progress-bar__label { color: var(--kb2-primary); }
.kb2-progress-bar__line {
  flex: 1;
  height: 2px;
  background: var(--kb2-border);
  min-width: 16px;
}

.kb2-order-card__items { margin-bottom: 8px; }
.kb2-order-card__item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  color: var(--kb2-text);
}
.kb2-order-card__item + .kb2-order-card__item { border-top: 1px solid var(--kb2-bg); }

.kb2-order-card__total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 15px;
  padding-top: 8px;
  border-top: 1px solid var(--kb2-border);
}

.kb2-order-card__toggle {
  display: block;
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--kb2-primary);
  padding: 8px 0 0;
  text-align: center;
}
.kb2-order-card__toggle:hover { text-decoration: underline; }

.kb2-order-card--expanded .kb2-order-card__details { display: block !important; }

/* ===== Confirmation Actions ===== */
#kb2-confirmation-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  width: 100%;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}
#kb2-confirmation-actions .kb2-btn {
  width: 100%;
  padding: 14px 28px;
  font-size: 16px;
  text-align: center;
  text-decoration: none;
}

/* ===== Footer ===== */
.kb2-footer {
  background: #fafafa;
  color: var(--kb2-text-muted);
  padding: 40px 0 20px;
  border-top: 1px solid var(--kb2-border);
}
.kb2-footer__inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px;
}
.kb2-footer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 30px;
}
.kb2-footer__heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--kb2-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  display: block;
  background: none;
  border: none;
  padding: 0;
  cursor: default;
  font-family: inherit;
  text-align: left;
  width: 100%;
}
.kb2-footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.kb2-footer__links li {
  margin-bottom: 8px;
}
.kb2-footer__links a {
  color: var(--kb2-text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color var(--kb2-transition);
}
.kb2-footer__links a:hover {
  color: var(--kb2-primary);
}
.kb2-footer__bottom {
  border-top: 1px solid var(--kb2-border);
  padding-top: 20px;
  font-size: 12px;
  text-align: center;
  color: #bbb;
}

/* Footer Accordion (Mobil) */
@media (max-width: 600px) {
  .kb2-footer__grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .kb2-footer__col {
    border-bottom: 1px solid var(--kb2-border);
  }
  .kb2-footer__heading {
    cursor: pointer;
    padding: 14px 0;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .kb2-footer__heading::after {
    content: '+';
    font-size: 18px;
    font-weight: 400;
    color: #bbb;
    transition: transform var(--kb2-transition);
  }
  .kb2-footer__heading[aria-expanded="true"]::after {
    content: '-';
  }
  .kb2-footer__links {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0;
  }
  .kb2-footer__col--open .kb2-footer__links {
    max-height: 200px;
    padding-bottom: 14px;
  }
}

/* ===== Utility ===== */
.kb2-sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0);
}
