.pos-app {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: #f6f8fb;
  min-height: 100vh;
  color: #0f172a;
  padding-bottom: 90px;
}

:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --accent: #1f7ae0;
  --accent-strong: #0f5ab7;
  --text: #0f172a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

.pos-status {
  margin: 8px 16px 6px;
  padding: 8px 12px;
  background: #eef2ff;
  border: 1px solid #d9e3ff;
  border-radius: 10px;
  font-size: 13px;
}

.pos-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--card);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
}

.pos-topbar-title {
  font-weight: 800;
  letter-spacing: 0.3px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
}

.cart-btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

.cart-btn span {
  min-width: 28px;
  height: 28px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pos-screen {
  display: none;
  padding: 14px 16px 8px;
}

.pos-screen.active {
  display: block;
}

.pos-search input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 16px;
}

.pos-product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 16px;
}

.pos-product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.08s ease;
}

.pos-product:active {
  transform: scale(0.99);
}

.pos-product__name {
  font-weight: 700;
  font-size: 16px;
}

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

.pos-cart-list {
  margin-top: 6px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pos-cart-line {
  display: grid;
  grid-template-columns: 1fr 78px 84px 40px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.pos-cart-name {
  font-weight: 600;
}

.pos-cart-qty {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.pos-cart-price {
  font-weight: 700;
  text-align: right;
}

.pos-cart-remove {
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-weight: 800;
  cursor: pointer;
}

.pos-total-bar {
  margin: 10px 0 4px;
  font-weight: 700;
  color: var(--text);
}

.pos-total-tax {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.pos-sticky-pay-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
}

.pos-total-display {
  text-align: center;
  margin: 10px auto 18px;
}

.pos-total-display .label {
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.4px;
}

.pos-total-display .value {
  font-size: 32px;
  font-weight: 800;
}

.pos-payment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* Erzwinge 2x2-Raster für Zahlungsarten und Beleg-Optionen, auch wenn Theme-Styles eingreifen */
.pos-app .pos-payment-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

.pos-payment-detail-screen {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.pos-payment-detail-screen.active {
  display: flex;
}

.pos-payment-helper {
  font-size: 14px;
  color: var(--muted);
  margin: 0 auto 16px;
  width: 90%;
  max-width: 720px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.pos-stripe-element {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.pos-paypal-buttons {
  display: flex;
  justify-content: center;
}

.pos-paypal-buttons > div {
  width: 100%;
  max-width: 340px;
}

.pos-payments-back {
  margin-top: 10px;
}

.pos-payment-btn,
.primary-btn {
  padding: 16px;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.08s ease;
}

.pos-payment-btn {
  background: #eef2ff;
  color: var(--text);
  border: 1px solid #d8def0;
}

.pos-payment-btn:active,
.primary-btn:active {
  transform: scale(0.99);
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.pos-detail-card {
  min-height: 160px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.pos-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pos-payments-screen {
  display: none;
}

.pos-payments-screen.active {
  display: block;
}

/* Gemeinsames Layout für Screen 2–4:
   1. Gesamt / Rechnungssumme zentriert
   2. Funktionen mittig mit begrenzter Breite
   3. Zurück-Button darunter, über die ganze Breite dieser Spalte */

#pos-payments-screen .pos-total-display,
#pos-payment-detail-screen .pos-total-display,
#pos-receipt-screen .pos-total-display {
  max-width: 480px;
}

#pos-payments-screen .pos-payment-grid,
#pos-receipt-screen .pos-payment-grid {
  max-width: 480px;
  margin: 0 auto 16px;
}

#pos-payment-detail-screen .pos-detail-card,
#pos-payment-detail-screen .pos-detail-actions {
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

#pos-payment-detail-screen .pos-detail-actions {
  margin-top: 16px;
}

#pos-payments-back,
#pos-payment-detail-back,
#pos-receipt-back {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 16px auto 0;
}

#pos-payment-detail-confirm,
#pos-payment-detail-back {
  width: 100%;
}

.pos-receipt-grid .primary-btn,
.pos-receipt-grid .pos-payment-btn {
  font-size: 16px;
}

/* Sicherstellen, dass die Beleg-Optionen wie die Zahlungsarten im Grid erscheinen */
#pos-receipt-options {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

.pos-receipt-email {
  padding: 14px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pos-receipt-email__label {
  font-weight: 700;
  color: var(--text);
}

.pos-receipt-email input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
}

.pos-receipt-email__btn {
  width: 100%;
}

.pos-footer-pay {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  padding: 18px 16px;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.12);
  cursor: pointer;
}

.pos-footer-pay:active {
  background: var(--accent-strong);
}

@media (min-width: 920px) {
  .pos-app {
    max-width: none;
    margin: 0 auto;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  }

  .pos-topbar {
    border-radius: 16px 16px 0 0;
  }
}


/* Hofladen Self-POS Layout-Referenz: integrierte Warenkorb-Spalte statt Overlay */
.pos-app {
  --bg: #ead8bd;
  --card: #fff9ee;
  --accent: #b85c38;
  --accent-strong: #8f3f25;
  --text: #2e241c;
  --muted: #755c45;
  --border: #dec7a7;
  --shadow: 0 14px 40px rgba(90, 58, 34, .14);
  background: var(--bg);
  padding-bottom: 86px;
}

.pos-status {
  background: #dce8cf;
  border-color: #c3d9b2;
  color: #285f34;
  font-weight: 800;
}

.pos-topbar {
  background: #2e241c;
  color: #fff;
  box-shadow: none;
}

.pos-topbar-title {
  font-size: 18px;
  color: #fff;
}

.pos-topbar-title::before {
  content: 'Mühlenclub Self-POS · ';
}

.icon-btn {
  background: #fff9ee;
  color: #2e241c;
  border-color: #dec7a7;
}

.cart-btn {
  width: auto;
  min-width: 118px;
  background: #d99a2b;
  font-weight: 900;
}

.cart-btn span {
  background: #2e241c;
}

.pos-screen {
  padding: 8px 14px 8px;
}

.pos-main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 410px);
  gap: 14px;
  align-items: start;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}

.pos-catalog-panel,
.pos-cart-panel {
  min-width: 0;
  background: #fff9ee;
  border: 1px solid #dec7a7;
  border-radius: 22px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.pos-cart-panel {
  position: sticky;
  top: 74px;
  max-height: calc(100vh - 92px);
  overflow: auto;
}

.pos-cart-panel-header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pos-cart-panel h2 {
  margin: 0;
  font-size: 30px;
  color: #5a3a22;
}

.pos-cart-back {
  white-space: nowrap;
}

.pos-catalog-heading {
  margin: 0 0 8px;
}

.pos-catalog-heading h1 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(32px, 4vw, 42px);
  line-height: .95;
  color: #5a3a22;
}

.pos-scan-panel {
  background: #fff;
  border: 4px solid #d99a2b;
  border-radius: 24px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.pos-eyebrow {
  color: #b85c38;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.pos-scan-panel h1 {
  margin: 4px 0;
  font-size: 32px;
  line-height: 1;
  color: #5a3a22;
}

.pos-scan-panel p {
  margin: 0;
  color: #4f3d2f;
  font-weight: 700;
}

.pos-search {
  margin-top: 12px;
}

.pos-search input {
  border: 2px solid #d8bf98;
  border-radius: 18px;
  background: #fff;
  box-shadow: none;
  font-weight: 800;
}

.pos-info-grid {
  display: none;
}

.pos-info-grid > div {
  background: #fff9ee;
  border: 1px solid #dec7a7;
  border-radius: 16px;
  padding: 12px;
}

.pos-info-grid strong,
.pos-info-grid span {
  display: block;
}

.pos-info-grid span {
  margin-top: 4px;
  color: #66503f;
  font-size: 13px;
}

.pos-category-rail-wrap {
  margin-top: 6px;
}

.pos-category-label {
  color: #6b533f;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 6px;
}

.pos-category-rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding: 2px 2px 8px;
}

.pos-category-rail button {
  flex: 0 0 auto;
  min-width: 112px;
  border: 1px solid #d8bf99;
  border-radius: 16px;
  background: #fff9ee;
  padding: 10px 12px;
  color: #2e241c;
  font-size: 14px;
  font-weight: 900;
  text-align: left;
  scroll-snap-align: start;
}

.pos-category-rail button.active {
  background: #2e241c;
  border-color: #2e241c;
  color: #fff;
}

.pos-category-drawer[hidden] {
  display: none;
}

.pos-category-drawer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
}

.pos-category-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(46, 36, 28, .48);
}

.pos-category-drawer__panel {
  position: relative;
  z-index: 1;
  width: min(620px, calc(100vw - 32px));
  max-height: min(80vh, 720px);
  overflow: auto;
  background: #fff9ee;
  border: 2px solid #dec7a7;
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 24px 80px rgba(46, 36, 28, .32);
}

.pos-category-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pos-category-drawer__header h2 {
  margin: 0;
  color: #5a3a22;
  font-size: 30px;
}

.pos-category-close {
  width: 56px;
  height: 56px;
  border: 1px solid #dec7a7;
  border-radius: 16px;
  background: #fff;
  color: #2e241c;
  font-size: 32px;
  font-weight: 900;
  cursor: pointer;
}

.pos-category-menu-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pos-category-menu-list button {
  min-height: 64px;
  border: 2px solid #dec7a7;
  border-radius: 18px;
  background: #fff;
  color: #2e241c;
  padding: 14px 16px;
  text-align: left;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

.pos-category-menu-list button.active {
  background: #2e241c;
  border-color: #2e241c;
  color: #fff;
}

.pos-product-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.pos-product {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  min-height: 126px;
  padding: 12px;
  border: 2px solid #e3cba7;
  border-radius: 18px;
  background: #fff;
  box-shadow: none;
}

.pos-product__name {
  font-size: 16px;
  line-height: 1.15;
  color: #2e241c;
}

.pos-product__price {
  margin-top: auto;
  color: #5a3a22;
  font-size: 22px;
}

.pos-cart-list {
  border-top: 0;
  padding-top: 0;
}

.pos-cart-line {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  border: 2px solid #e3cba7;
  border-radius: 18px;
  padding: 12px;
}

.pos-cart-name {
  font-weight: 900;
}

.pos-cart-qty {
  min-height: 48px;
  font-weight: 900;
  text-align: center;
}

.pos-cart-price {
  text-align: left;
  font-size: 18px;
}

.pos-cart-remove {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
}

.pos-total-bar {
  margin-top: 14px;
}

.pos-total-tax {
  color: #755c45;
}

.pos-sticky-pay-inline,
.pos-footer-pay {
  background: #2f7d42;
}

.pos-footer-pay {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 0;
  width: auto;
  border-radius: 14px 14px 0 0;
}

body.pos-cart-mode .pos-info-grid,
body.pos-cart-mode .pos-category-rail-wrap {
  display: none;
}

body.pos-cart-mode .pos-scan-panel {
  padding: 12px;
  border-width: 3px;
}

body.pos-cart-mode .pos-scan-panel p {
  display: none;
}

body.pos-cart-mode .pos-product-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.pos-cart-mode .pos-cart-panel {
  border: 3px solid #d99a2b;
  box-shadow: 0 18px 60px rgba(46, 36, 28, .22);
}

body.pos-cart-only .pos-main-layout {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}

body.pos-cart-only .pos-catalog-panel {
  display: none;
}

body.pos-cart-only .pos-cart-panel {
  display: block;
  position: static;
  top: auto;
  width: 100%;
  max-height: none;
}

@media (max-width: 1050px) {
  .pos-main-layout {
    grid-template-columns: 1fr;
  }

  .pos-cart-panel {
    display: none;
    position: static;
    max-height: none;
  }

  body.pos-cart-mode .pos-cart-panel {
    display: block;
    order: -1;
  }

  .pos-product-list,
  body.pos-cart-mode .pos-product-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .pos-screen {
    padding: 10px;
  }

  .pos-catalog-panel,
  .pos-cart-panel {
    padding: 14px;
    border-radius: 22px;
  }

  .pos-scan-panel {
    grid-template-columns: 1fr;
  }

  .pos-info-grid,
  .pos-product-list,
  body.pos-cart-mode .pos-product-list {
    grid-template-columns: 1fr;
  }

  .pos-footer-pay {
    position: fixed;
  }
}


/* Produktbilder aus WooCommerce-Mediathek in POS-Kacheln */
.pos-product {
  grid-template-columns: 72px minmax(0, 1fr) 48px;
  align-items: center;
  min-height: 112px;
  gap: 12px;
}

.pos-product__add {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 16px;
  background: #2f7d42;
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(47, 125, 66, .18);
}

.pos-product__image {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  background: #f1dfc3;
  border: 1px solid #e3cba7;
}

.pos-product__image--empty {
  display: grid;
  place-items: center;
  font-size: 28px;
}

.pos-product__body {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.pos-product__meta {
  color: #755c45;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .pos-product {
    grid-template-columns: 58px minmax(0, 1fr) 44px;
  }

  .pos-product__image {
    width: 58px;
    height: 58px;
  }

  .pos-product__add {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 26px;
  }
}


/* Gelernte Kassenlogik: Warenkorb wie Einkaufsliste mit großen +/- Touchflächen */
.pos-cart-line-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
}

.pos-cart-qty-controls {
  display: grid;
  grid-template-columns: 54px minmax(54px, 1fr) 54px;
  gap: 8px;
  align-items: center;
}

.pos-cart-qty-step,
.pos-cart-qty-value {
  min-height: 48px;
  border-radius: 14px;
  font-size: 20px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pos-cart-qty-step {
  border: 0;
  background: #ead8bd;
  color: #2e241c;
  cursor: pointer;
}

.pos-cart-qty-value {
  border: 2px solid #e3cba7;
  background: #fff9ee;
  color: #2e241c;
}

.pos-cart-remove-label {
  display: inline-block;
}

.pos-cart-line--negative {
  border-color: #f2b8b5;
  background: #fff5f5;
}

.pos-cart-line--negative .pos-cart-name,
.pos-cart-line--negative .pos-cart-price {
  color: #b42318;
}

/* SelfPOS Konto/Pickup Bootstrap panel */
.pos-account-screen {
  max-width: 1100px;
  margin: 0 auto;
}

.pos-account-panel {
  display: grid;
  gap: 14px;
}

.pos-account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.pos-account-card {
  background: #fff9ee;
  border: 2px solid #e3cba7;
  border-radius: 20px;
  box-shadow: 0 12px 28px rgba(46,36,28,.08);
  padding: 18px;
  color: #2e241c;
}

.pos-account-card h2,
.pos-account-card h3 {
  margin: 0 0 10px;
  color: #5a3a22;
}

.pos-account-note,
.pos-account-card p {
  color: #755c45;
  margin: 0 0 12px;
}

.pos-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pos-account-action {
  border: 0;
  border-radius: 999px;
  background: #d99a2b;
  color: #24170f;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 10px 14px;
}

.pos-account-row {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid #ead8bd;
}

.pos-account-row:first-of-type {
  border-top: 0;
}

.pos-account-row span,
.pos-account-empty {
  color: #755c45;
  font-size: 14px;
}

@media (max-width: 780px) {
  .pos-account-grid {
    grid-template-columns: 1fr;
  }
}
