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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1366px;
  margin: 20px auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #4caf50, #45a049);
  color: #fff;
  padding: 30px 20px;
  text-align: center;
  position: relative;
}

.header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><defs><pattern id='grain' width='100' height='100' patternUnits='userSpaceOnUse'><circle cx='20' cy='20' r='1' fill='white' opacity='0.1'/><circle cx='80' cy='40' r='1' fill='white' opacity='0.1'/><circle cx='40' cy='80' r='1' fill='white' opacity='0.1'/></pattern></defs><rect width='100' height='100' fill='url(%23grain)'/></svg>");
  opacity: 0.3;
}

.header h1,
.info-box {
  position: relative;
  z-index: 1;
}

.header h1 {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  margin-bottom: 10px;
}

.info-box {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 15px;
  border-radius: 15px;
  margin-top: 20px;
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
}

.lang-switch {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin: 24px 20px;
}

.lang-switch button {
  background: linear-gradient(135deg, #81c784, #66bb6a);
  border: none;
  border-radius: 25px;
  padding: 12px 20px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.cashier-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 20px;
}

.cashier-toolbar .lang-switch {
  margin: 0;
}

.cashier-day-actions {
  display: flex;
  gap: 10px;
}

.cashier-day-action {
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  padding: 10px 18px;
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.cashier-day-action:disabled {
  opacity: 0.6;
  cursor: wait;
}

.cashier-day-action--open {
  background: #15803d;
}

.cashier-day-action--close {
  background: #1e3a8a;
}

.cashier-day-status {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 12px;
  color: #334155;
  font-weight: 800;
  white-space: nowrap;
}

.lang-switch button.active {
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
}

.content {
  padding: 20px;
}

.category {
  margin-bottom: 28px;
  background: #fafafa;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.category h2 {
  background: linear-gradient(135deg, #f1f8e9, #e8f5e8);
  padding: 18px 20px;
  font-size: clamp(1.1rem, 4vw, 1.5rem);
  border-bottom: 3px solid #4caf50;
}

.menu-grid {
  display: grid;
  gap: 15px;
  padding: 20px;
}

.menu-item {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.category--formules {
  border: 2px solid #4caf50;
  box-shadow: 0 8px 24px rgba(34, 139, 34, 0.16);
}

.category--formules h2 {
  background: linear-gradient(135deg, #dff5df, #c8edca);
}

.menu-item--quick-add {
  background: #f0fdf4;
  border: 1px dashed #4caf50;
}

.item-info {
  flex: 1;
  min-width: 0;
}

@media (min-width: 700px) {
  .category--formules .menu-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .category--formules .menu-item {
    grid-column: span 4;
  }

  .category--formules .menu-item--quick-add {
    grid-column: span 3;
    min-height: 76px;
    padding: 10px 12px;
  }

  .category--formules .menu-item--quick-add .item-name {
    font-size: 0.95rem;
  }

  .category--formules .menu-item--quick-add .item-desc {
    display: none;
  }

  .category--formules .menu-item--quick-add .qty-button {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    font-size: 19px;
  }

  .category--formules .menu-item--quick-add .qty-display {
    min-width: 36px;
    padding: 7px 8px;
  }
}

.item-name {
  font-weight: 600;
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  margin-bottom: 4px;
}

.item-price {
  color: #4caf50;
  font-weight: 700;
  font-size: clamp(1rem, 3vw, 1.2rem);
}

.item-desc {
  margin-top: 6px;
  color: #667085;
  font-size: 0.9rem;
  line-height: 1.45;
}

.item-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.qty-button {
  background: linear-gradient(135deg, #4caf50, #45a049);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  touch-action: manipulation;
}

.qty-display {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 8px 14px;
  min-width: 46px;
  text-align: center;
  font-weight: 700;
}

.cart-summary {
  position: sticky;
  bottom: 0;
  background: linear-gradient(135deg, #4caf50, #45a049);
  color: #fff;
  padding: 20px;
  margin: 30px -20px -20px -20px;
  text-align: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.cashier-summary {
  position: sticky;
  top: 0;
  bottom: auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 22px;
  border-radius: 14px;
}

.cashier-summary .total-price {
  margin-bottom: 0;
  white-space: nowrap;
}

.cashier-summary .submit-btn {
  flex: 1 1 auto;
  max-width: 360px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.total-price {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 700;
  margin-bottom: 16px;
}

.form-section {
  background: #f8f9fa;
  padding: 30px 20px;
  margin: 0 -20px;
}

.form-section h2 {
  text-align: center;
  margin-bottom: 25px;
  font-size: clamp(1.2rem, 4vw, 1.6rem);
}

.form-grid {
  display: grid;
  gap: 18px;
  max-width: 600px;
  margin: 0 auto;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-field label {
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
}

.form-field input {
  padding: 14px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 16px;
  background: #fff;
}

.form-field input:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.anti-bot-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.submit-btn {
  background: linear-gradient(135deg, #4caf50, #45a049);
  border: none;
  border-radius: 25px;
  padding: 18px 40px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  min-height: 56px;
  touch-action: manipulation;
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.reprint-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: #166534;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.cashier-after-payment-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.cashier-after-payment-actions .reprint-btn {
  margin-top: 0;
}

.next-order-btn {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: #1d4ed8;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.payment-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 12px;
  background: #fff;
  border: 2px solid #22c55e;
}

.payment-panel h4 {
  grid-column: 1 / -1;
  color: #166534;
  font-size: 1.15rem;
}

.terminal-reference {
  display: grid;
  gap: 6px;
  color: #166534;
  font-weight: 700;
}

.terminal-reference input {
  min-height: 46px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

.payment-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.payment-choice {
  min-height: 74px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
}

.payment-choice.cash { background: #15803d; }
.payment-choice.card { background: #1d4ed8; }
.payment-choice.voucher { background: #b45309; }
.payment-choice.other { background: #475569; }
}

.print-receipt {
  display: none;
}

.cash-register-page .z-print-button {
  grid-column: 1 / -1;
  min-height: 64px;
  border: 0;
  border-radius: 12px;
  background: #1e3a8a;
  color: #fff;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
}

@media (min-width: 769px) {
  body {
    background: #eef4ef;
  }

  .container {
    margin: 14px auto;
    border-radius: 16px;
  }

  .header {
    padding: 20px 28px;
  }

  .header h1 {
    font-size: 2rem;
    margin-bottom: 4px;
  }

  .info-box {
    margin-top: 10px;
    padding: 10px 14px;
  }

  .lang-switch {
    margin: 14px 24px;
  }

  .cashier-toolbar {
    margin: 14px 24px;
  }

  .content {
    padding: 20px 24px;
  }

  .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
  }

  .category--formules .menu-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .menu-item {
    min-height: 112px;
    padding: 14px;
  }

  .qty-button {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    font-size: 22px;
  }

  .qty-display {
    min-width: 48px;
    padding: 10px 12px;
    font-size: 1.05rem;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 900px;
  }

  .submit-btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .cashier-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .cashier-day-actions,
  .cashier-toolbar .lang-switch {
    justify-content: center;
  }

  .category--formules .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category--formules .menu-item--quick-add {
    min-height: 78px;
  }
}

.result-message {
  margin-top: 20px;
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
}

.result-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.pickup-card {
  margin-top: 20px;
  padding: 22px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  border: 1px solid #86efac;
  box-shadow: 0 12px 30px rgba(34, 197, 94, 0.12);
}

.pickup-card h3 {
  margin-bottom: 10px;
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  color: #166534;
  text-align: center;
}

.pickup-number {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 18px 0;
  padding: 18px;
  border-radius: 14px;
  background: #fff;
  border: 2px dashed #22c55e;
}

.pickup-number-label {
  font-size: 0.95rem;
  color: #166534;
  font-weight: 600;
}

.pickup-number-value {
  font-size: clamp(1.4rem, 4vw, 2rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #15803d;
}

.pickup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.pickup-item {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  padding: 12px 14px;
}

.pickup-item strong {
  display: block;
  margin-bottom: 6px;
  color: #166534;
  font-size: 0.9rem;
}

.pickup-note {
  margin-top: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  color: #166534;
  text-align: center;
  font-weight: 600;
}

.map-section {
  margin-top: 40px;
  padding: 30px 20px;
  text-align: center;
}

.map-section h2 {
  margin-bottom: 25px;
  font-size: clamp(1.2rem, 4vw, 1.6rem);
}

.map-container {
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.legal-section {
  margin-top: 24px;
  padding: 22px 20px 10px;
  text-align: left;
}

.legal-card {
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.legal-card h3 {
  margin-bottom: 10px;
  color: #166534;
  font-size: clamp(1.05rem, 3vw, 1.25rem);
}

.legal-card p {
  margin-bottom: 10px;
  color: #475467;
}

.legal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  min-height: 46px;
}

@media (max-width: 768px) {
  .container {
    margin: 10px;
    border-radius: 15px;
  }

  .header {
    padding: 22px 16px;
  }

  .lang-switch {
    gap: 10px;
    margin: 18px 16px;
  }

  .lang-switch button {
    flex: 1 1 0;
    min-height: 42px;
    padding: 10px 12px;
    font-size: 15px;
  }

  .cashier-toolbar {
    align-items: flex-start;
    gap: 8px;
    margin: 10px 12px;
  }

  .cashier-day-actions {
    flex: 1;
    flex-wrap: wrap;
    gap: 6px;
  }

  .cashier-day-action {
    min-height: 46px;
    padding: 8px 12px;
    font-size: 0.92rem;
  }

  .cashier-day-status {
    order: 3;
    width: 100%;
    min-height: auto;
    padding: 0 2px;
    font-size: 0.86rem;
  }

  .cashier-toolbar .lang-switch {
    flex: 0 0 auto;
    gap: 6px;
  }

  .cashier-toolbar .lang-switch button {
    min-width: 66px;
    min-height: 46px;
    padding: 8px 9px;
    font-size: 0.8rem;
  }

  .content {
    padding: 14px;
  }

  .category {
    margin-bottom: 18px;
  }

  .category h2 {
    padding: 12px 14px;
  }

  .menu-grid {
    gap: 8px;
    padding: 10px;
  }

  .menu-item {
    padding: 10px 12px;
  }

  .cart-summary {
    padding: 14px 16px;
    margin: 20px -14px -14px -14px;
  }

  .cashier-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 0 0 16px;
    box-shadow: 0 4px 16px rgba(21, 128, 61, 0.24);
  }

  .cashier-summary .total-price,
  .cashier-summary .submit-btn {
    max-width: none;
    width: 100%;
  }

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

  .payment-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-section {
    padding: 20px 14px;
    margin: 0 -14px;
  }

  .submit-btn {
    width: 100%;
    padding: 14px 20px;
    min-height: 50px;
    font-size: 16px;
  }
}

@media (max-width: 699px) {
  .category--formules .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category--formules .menu-item {
    min-height: 104px;
  }

  .category--formules .menu-item--quick-add {
    min-height: 82px;
    padding: 9px 10px;
  }

  .category--formules .menu-item--quick-add .item-desc {
    display: none;
  }

  .category--formules .menu-item--quick-add .item-name {
    font-size: 0.9rem;
  }

  .category--formules .menu-item--quick-add .qty-button {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
  }

  .category--formules .menu-item--quick-add .qty-display {
    min-width: 34px;
    padding: 6px 7px;
  }
}

@page {
  size: 80mm auto;
  margin: 0;
}

@media print {
  body {
    background: #fff;
  }

  body * {
    visibility: hidden;
  }

  #printReceipt,
  #printReceipt * {
    visibility: visible;
  }

  #printReceipt {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 80mm;
    padding: 4mm;
    color: #000;
    font-family: Arial, sans-serif;
    font-size: 11pt;
    line-height: 1.35;
  }

  #printReceipt h1 {
    margin: 0 0 3mm;
    font-size: 15pt;
    text-align: center;
  }

  .receipt-brand {
    font-size: 17pt;
    font-weight: 800;
    text-align: center;
  }

  #printReceipt p {
    margin: 1.5mm 0;
  }

  .receipt-rule {
    border-top: 1px dashed #000;
    margin: 3mm 0;
  }

  .receipt-item,
  .receipt-total,
  .receipt-summary,
  .receipt-meta {
    display: flex;
    justify-content: space-between;
    gap: 3mm;
  }

  .receipt-item span:first-child {
    flex: 1;
  }

  .receipt-table-head {
    font-size: 8pt;
    font-weight: 700;
    white-space: pre-wrap;
  }

  .receipt-total {
    font-size: 13pt;
    font-weight: 700;
  }

  .receipt-thanks {
    text-align: center;
    font-weight: 700;
  }

  .receipt-legal {
    font-size: 7.5pt;
    text-align: center;
  }

  .cash-register-page,
  .cash-register-page * {
    visibility: visible;
  }

  .cash-register-page {
    position: static;
    width: 80mm;
    margin: 0;
    box-shadow: none;
  }

  .cash-register-page .lang-switch,
  .cash-register-page button,
  .cash-register-page label,
  .cash-register-page .category:not(.z-report) {
    display: none !important;
  }

  .cash-register-page .content,
  .cash-register-page .z-report,
  .cash-register-page .menu-grid {
    display: block;
    padding: 0;
    margin: 0;
    box-shadow: none;
    background: #fff;
  }

  .cash-register-page .z-legal {
    display: block;
    font-size: 8pt;
    text-align: center;
    margin-bottom: 3mm;
  }
}

@media (max-width: 480px) {
  .container {
    margin: 6px;
    border-radius: 12px;
  }

  .header {
    padding: 18px 12px;
  }

  .content {
    padding: 10px;
  }

  .menu-grid {
    gap: 6px;
    padding: 8px;
  }

  .menu-item {
    padding: 8px 10px;
  }

  .qty-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 19px;
  }

  .qty-display {
    min-width: 34px;
    padding: 6px;
    font-size: 14px;
  }

  .cart-summary {
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    margin: 16px -10px -10px -10px;
  }

  .form-section {
    padding: 16px 10px;
    margin: 0 -10px;
  }

  .cashier-summary .submit-btn {
    min-height: 62px;
    font-size: 17px;
  }
}
