/* WarungKu - CSS kustom pelengkap Tailwind CDN */

* { -webkit-tap-highlight-color: transparent; }

body { overscroll-behavior-y: none; }

::-webkit-scrollbar { width: 0; height: 0; }

.card {
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  border-radius: .75rem;
  font-weight: 500;
  font-size: .875rem;
  padding: .625rem 1rem;
  transition: transform .1s ease, opacity .15s ease;
  border: none;
  cursor: pointer;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: #16523F; color: #fff; }
.btn-accent  { background: #E3A23C; color: #fff; }
.btn-danger  { background: #C0453A; color: #fff; }
.btn-outline { background: #fff; border: 2px solid #16523F; color: #16523F; }
.btn-subtle  { background: #f5f4f0; color: #44403c; }
.btn-sm { padding: .375rem .75rem; font-size: .75rem; }
.btn-lg { padding: .875rem 1.25rem; font-size: 1rem; }
.btn-block { width: 100%; }

.input {
  width: 100%;
  border-radius: .75rem;
  border: 1px solid #e7e5e4;
  background: #fafaf9;
  padding: .625rem .75rem;
  font-size: .875rem;
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.input:focus { background: #fff; border-color: #16523F; }
.input-label { display: block; font-size: .75rem; font-weight: 500; color: #78716c; margin-bottom: .25rem; }

.badge { display: inline-flex; align-items: center; padding: .125rem .5rem; border-radius: 9999px; font-size: 11px; font-weight: 500; }
.badge-gray  { background: #f5f4f0; color: #78716c; }
.badge-green { background: #d1fae5; color: #047857; }
.badge-red   { background: #fee2e2; color: #dc2626; }
.badge-amber { background: #fef3c7; color: #b45309; }
.badge-blue  { background: #e0f2fe; color: #0369a1; }

.chip {
  padding: .375rem .75rem;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  background: #f0efe9;
  color: #78716c;
}
.chip.active { background: #16523F; color: #fff; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.4);
}
@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
}
.modal-box {
  background: #fff;
  width: 100%;
  max-width: 28rem;
  border-radius: 1.5rem 1.5rem 0 0;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideup .2s ease;
}
@media (min-width: 640px) {
  .modal-box { border-radius: 1rem; }
}
@keyframes slideup { from { transform: translateY(16px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =====================================================================
   Loading overlay global — muncul otomatis di setiap proses POST/GET/
   submit/fetch (lihat assets/js/loading-overlay.js). Transparan dengan
   sedikit blur supaya konten di belakangnya masih samar terlihat
   (tidak seperti layar putih polos yang terasa "patah").
   ===================================================================== */
.wk-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 200; /* di atas modal (.modal-overlay = z-index 50) */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 20, 0.32);
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.wk-loading-overlay.wk-show {
  opacity: 1;
  visibility: visible;
}
.wk-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
  padding: 1.5rem 2.1rem;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 36px rgba(14, 58, 44, 0.22), 0 2px 8px rgba(0,0,0,.06);
  transform: scale(.9) translateY(4px);
  transition: transform .22s cubic-bezier(.34,1.56,.64,1);
}
.wk-loading-overlay.wk-show .wk-loading-card {
  transform: scale(1) translateY(0);
}
.wk-spinner {
  position: relative;
  width: 2.9rem;
  height: 2.9rem;
}
.wk-spinner::before,
.wk-spinner::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 3px solid transparent;
}
.wk-spinner::before {
  border-top-color: #16523F;
  border-right-color: #16523F;
  animation: wk-spin .8s cubic-bezier(.5,0,.5,1) infinite;
}
.wk-spinner::after {
  border-bottom-color: #E3A23C;
  opacity: .55;
  animation: wk-spin 1.3s linear infinite reverse;
}
@keyframes wk-spin {
  to { transform: rotate(360deg); }
}
.wk-loading-text {
  font-size: .78rem;
  font-weight: 600;
  color: #44403c;
  letter-spacing: .01em;
}

/* ============================== MODE CETAK STRUK ============================== */
/* Saat window.print() dipanggil (tombol "Print Struk"), sembunyikan       */
/* SELURUH halaman kecuali isi struk di #receipt-print-area.               */
@media print {
  body * {
    visibility: hidden;
  }
  #receipt-print-area,
  #receipt-print-area * {
    visibility: visible;
  }
  #receipt-print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 72mm; /* lebar umum kertas thermal printer kasir */
    padding: 4mm;
    font-size: 11px;
  }
  .no-print {
    display: none !important;
  }
  .modal-overlay {
    position: static !important;
    background: none !important;
    display: block !important;
  }
  .modal-box {
    box-shadow: none !important;
    max-height: none !important;
    max-width: none !important;
  }
}
