/* Backhaus Rosso — POS-Shell wie Manuelle Bestellung (#orders/manuelle-bestellung)
   Nur Layout. Welcome, Checkout-Logik und Bestellzentrale unangetastet. */

#shopApp.sf-pos-shell {
  --sf-order-bar-h: 0px;
  padding-bottom: 0;
  height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  background: #f5f5f5;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

#shopApp.sf-pos-shell .sf-shop-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* Wizard-Chrome ausblenden */
#shopApp.sf-pos-shell .sf-shop-header,
#shopApp.sf-pos-shell .sf-stepper,
#shopApp.sf-pos-shell .sf-footer,
#shopApp.sf-pos-shell #orderBar,
#shopApp.sf-pos-shell .sf-categories-sticky,
#shopApp.sf-pos-shell #stepPanel2 .sf-step-card__head,
#shopApp.sf-pos-shell .sf-shop-toolbar,
#shopApp.sf-pos-shell #stepPanel2 .sf-step-nav,
#shopApp.sf-pos-shell #step2Back,
#shopApp.sf-pos-shell #changeBranchBtn,
#shopApp.sf-pos-shell .sf-cart-toggle {
  display: none !important;
}

#shopApp.sf-pos-shell .sf-shop-shell.is-branch-step .sf-pos-cart {
  display: flex !important;
}

#shopApp.sf-pos-shell .sf-shop-shell.is-branch-step .sf-shop-main {
  width: auto;
  max-width: none;
  margin: 0;
}

/* Filial-Karten nur als Datenquelle */
#shopApp.sf-pos-shell #stepPanel1 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
}

#shopApp.sf-pos-shell #stepPanel2,
#shopApp.sf-pos-shell #stepPanel2[hidden] {
  display: flex !important;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#shopApp.sf-pos-shell #stepPanel2 .sf-step-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

#shopApp.sf-pos-shell #stepPanel2 .sf-step-card__body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}

/* Topbar wie POS */
#shopApp.sf-pos-shell .pos-topbar {
  background: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
  z-index: 100;
  flex-wrap: nowrap;
}

#shopApp.sf-pos-shell .pos-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #212529;
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 16px;
  border-right: 1px solid #e0e0e0;
}

#shopApp.sf-pos-shell .select-filiale,
#shopApp.sf-pos-shell .select-category {
  padding: 8px 14px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  min-width: 160px;
  max-width: 200px;
  flex-shrink: 0;
}

#shopApp.sf-pos-shell .select-category {
  min-width: 180px;
}

#shopApp.sf-pos-shell .select-filiale:hover,
#shopApp.sf-pos-shell .select-category:hover {
  border-color: #c62828;
}

#shopApp.sf-pos-shell .select-filiale:focus,
#shopApp.sf-pos-shell .select-category:focus {
  outline: none;
  border-color: #c62828;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
}

#shopApp.sf-pos-shell .manuelle-product-search {
  padding: 8px 14px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  min-width: 180px;
  max-width: 280px;
  flex: 1 1 180px;
}

#shopApp.sf-pos-shell .manuelle-product-search:focus {
  outline: none;
  border-color: #c62828;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
}

#shopApp.sf-pos-shell .pos-topbar-spacer {
  flex: 1 1 auto;
  min-width: 8px;
}

#shopApp.sf-pos-shell .pos-topbar .sf-shop-header__account-wrap {
  position: relative;
  flex-shrink: 0;
}

#shopApp.sf-pos-shell .pos-topbar .sf-topbar-btn {
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #212529;
  cursor: pointer;
  white-space: nowrap;
}

#shopApp.sf-pos-shell .pos-topbar .sf-topbar-btn:hover {
  border-color: #c62828;
}

#shopApp.sf-pos-shell .select-category.is-idle {
  display: none;
}

/* Fläche: Produkte + Warenkorb */
#shopApp.sf-pos-shell .pos-interface {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#shopApp.sf-pos-shell .pos-main {
  display: flex;
  gap: 8px;
  flex: 1;
  overflow: hidden;
  padding: 8px;
  align-items: stretch;
  min-height: 0;
}

#shopApp.sf-pos-shell .sf-shop-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#shopApp.sf-pos-shell .pos-products-section,
#shopApp.sf-pos-shell .sf-shop-main .sf-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

#shopApp.sf-pos-shell #stepPanel2,
#shopApp.sf-pos-shell #stepPanel2 .sf-step-card,
#shopApp.sf-pos-shell #stepPanel2 .sf-step-card__body {
  width: 100%;
  min-width: 0;
}

#shopApp.sf-pos-shell .products-grid-container {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
  background: #fafafa;
  border-radius: 8px;
  width: 100%;
  min-width: 0;
}

#shopApp.sf-pos-shell .sf-products--pos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  padding: 4px;
  background: transparent;
  border-radius: 0;
  min-height: 0;
  width: 100%;
  min-width: 0;
}

#shopApp.sf-pos-shell .sf-pos-card:hover {
  border: 2px solid #c62828;
  box-shadow: 0 4px 12px rgba(198, 40, 40, 0.15);
}

#shopApp.sf-pos-shell .sf-pos-card.is-search-hidden {
  display: none;
}

/* Warenkorb rechts 280px */
#shopApp.sf-pos-shell .sf-pos-cart {
  width: 280px;
  min-width: 280px;
  max-width: 280px;
  height: auto;
  flex-shrink: 0;
  position: relative;
  top: auto;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding-bottom: 0;
  height: 100%;
  align-self: stretch;
}

#shopApp.sf-pos-shell .sf-pos-cart__title {
  display: none;
}

#shopApp.sf-pos-shell .sf-pos-cart__header {
  padding: 8px;
  background: #fff;
  gap: 4px;
}

#shopApp.sf-pos-shell .sf-pos-cart__checkout {
  flex: 1;
  height: 30px;
  padding: 6px 12px;
  font-size: 12px;
}

#shopApp.sf-pos-shell .pos-footer {
  background: #e8e8e8;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
  border-top: 1px solid #d0d0d0;
  flex-shrink: 0;
  min-height: 48px;
}

#shopApp.sf-pos-shell .pos-footer__left,
#shopApp.sf-pos-shell .pos-footer__right {
  flex: 1;
  display: flex;
  align-items: center;
}

#shopApp.sf-pos-shell .pos-footer__right {
  justify-content: flex-end;
}

#shopApp.sf-pos-shell .pos-footer__copy {
  font-size: 9px;
  color: #6c757d;
}

#shopApp.sf-pos-shell .pos-footer-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#shopApp.sf-pos-shell .pos-footer-date {
  font-size: 9px;
  color: #6c757d;
  line-height: 1.2;
}

#shopApp.sf-pos-shell .pos-footer-clock {
  font-size: 10px;
  font-weight: 700;
  color: #6c757d;
  line-height: 1.2;
}

/* Kasse als Overlay wie POS-Checkout-Modal */
#shopApp.sf-pos-shell #stepPanel3 {
  position: fixed;
  inset: 0;
  z-index: 10000;
  margin: 0;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
}

#shopApp.sf-pos-shell #stepPanel3[hidden] {
  display: none !important;
}

#shopApp.sf-pos-shell #stepPanel3.is-active,
#shopApp.sf-pos-shell #stepPanel3:not([hidden]) {
  display: flex !important;
}

#shopApp.sf-pos-shell #stepPanel3 .sf-step-card {
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  overflow: auto;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#shopApp.sf-pos-shell #stepPanel3 .sf-step-card__head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
}

#shopApp.sf-pos-shell #checkoutModalBack {
  margin-bottom: 8px;
}

@media (max-width: 899px) {
  #shopApp.sf-pos-shell {
    height: auto;
    max-height: none;
    overflow: auto;
  }

  #shopApp.sf-pos-shell .pos-topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }

  #shopApp.sf-pos-shell .pos-title {
    font-size: 15px;
    border-right: none;
    padding-right: 0;
    width: 100%;
  }

  #shopApp.sf-pos-shell .pos-main {
    flex-direction: column;
  }

  #shopApp.sf-pos-shell .sf-pos-cart {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: auto;
    max-height: min(42vh, 320px);
    position: sticky;
    bottom: 0;
  }

  #shopApp.sf-pos-shell .select-filiale,
  #shopApp.sf-pos-shell .select-category,
  #shopApp.sf-pos-shell .manuelle-product-search {
    min-width: 0;
    max-width: none;
    flex: 1 1 140px;
  }
}
