/* ==============================================================================
   KANTIN OS - MODERN STYLESHEET (INSPIRED BY RANGER AURA CLEAN DESIGN)
   ============================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-glow: rgba(37, 99, 235, 0.25);
  
  --emerald: #10b981;
  --emerald-dark: #059669;
  --emerald-light: #ecfdf5;
  
  --rose: #f43f5e;
  --rose-light: #fff1f2;
  
  --amber: #f59e0b;
  --amber-light: #fef3c7;
  
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;
  --white:     #ffffff;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: #f8fafc;
  color: var(--slate-800);
  line-height: 1.5;
  overflow-x: hidden;
  padding-bottom: 90px;
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

/* NAVBAR */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--slate-200);
  height: 56px;
  display: flex;
  align-items: center;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.brand-name {
  font-size: 18px;
  font-weight: 900;
  color: var(--slate-900);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.brand-accent {
  color: var(--primary);
}

.brand-sub {
  font-size: 10px;
  color: var(--slate-500);
  font-weight: 500;
}

/* Nav Cart Button */
.btn-cart {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--primary-glow);
  transition: all 0.2s ease;
}

.btn-cart:hover {
  background: var(--primary-hover);
}

.btn-cart:active {
  transform: scale(0.96);
}

.cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--amber);
  color: var(--slate-900);
  font-size: 10px;
  font-weight: 800;
}

/* HERO SECTION (COMPACT & SLEEK) */
.hero {
  margin-top: 10px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 60%, #172554 100%);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--white);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.hero h1 {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.3px;
}

.hero p {
  font-size: 11px;
  color: var(--slate-300);
  margin-top: 2px;
  line-height: 1.4;
}

/* SEARCH BOX */
.search-container {
  margin-bottom: 12px;
}

.search-wrap {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 11px 40px 11px 42px;
  font-size: 14px;
  font-weight: 500;
  color: var(--slate-800);
  background: var(--white);
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--slate-100);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate-500);
  cursor: pointer;
  display: none;
}

.search-clear.visible {
  display: flex;
}

/* Quick keywords */
.quick-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.quick-tags::-webkit-scrollbar { display: none; }

.quick-label {
  font-size: 11px;
  color: var(--slate-400);
  font-weight: 600;
  white-space: nowrap;
}

.tag-btn {
  padding: 5px 12px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-600);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tag-btn:hover {
  background: var(--primary-light);
  border-color: #bfdbfe;
  color: var(--primary);
}

/* CATEGORY PILLS */
.category-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 18px;
  scrollbar-width: none;
}
.category-bar::-webkit-scrollbar { display: none; }

.cat-pill {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--slate-200);
  background: var(--white);
  color: var(--slate-600);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.cat-pill.active {
  background: var(--slate-900);
  color: var(--white);
  border-color: var(--slate-900);
  box-shadow: var(--shadow-sm);
}

/* SECTION HEADER */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-500);
}

/* ITEMS GRID */
.items-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .items-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (min-width: 768px) {
  .items-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ITEM CARD */
.item-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.item-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #bfdbfe;
}

.item-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--slate-100);
  margin-bottom: 10px;
}

.item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.item-card:hover .item-img {
  transform: scale(1.06);
}

.stock-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--white);
  backdrop-filter: blur(4px);
}

.stock-tag.available {
  background: rgba(16, 185, 129, 0.9);
}

.stock-tag.empty {
  background: rgba(244, 63, 94, 0.9);
}

.item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}

.item-card-bottom {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.price-label {
  font-size: 9px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--slate-400);
  display: block;
}

.item-price {
  font-size: 16px;
  font-weight: 900;
  color: var(--slate-900);
  letter-spacing: -0.3px;
}

/* Button Pilih & Stepper */
.btn-select {
  padding: 6px 12px;
  background: var(--slate-900);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-select:hover {
  background: var(--primary);
}

.btn-select:active {
  transform: scale(0.95);
}

.stepper {
  display: flex;
  align-items: center;
  background: var(--primary-light);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 2px;
}

.step-btn {
  width: 26px;
  height: 26px;
  background: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-btn:hover {
  background: var(--primary);
  color: var(--white);
}

.step-qty {
  width: 24px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--slate-900);
}

/* EMPTY STATE */
.empty-state {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 40px 20px;
  text-align: center;
  grid-column: 1 / -1;
  box-shadow: var(--shadow-xs);
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--slate-800);
  margin-top: 10px;
}

.empty-state p {
  font-size: 12px;
  color: var(--slate-400);
  margin-top: 4px;
}

/* STICKY BOTTOM BAR */
.floating-bar {
  position: fixed;
  bottom: 16px;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}

.floating-inner {
  pointer-events: auto;
  width: 100%;
  max-width: 480px;
  background: var(--slate-900);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transform: translateY(120%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-bar.active .floating-inner {
  transform: translateY(0);
}

.floating-total {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.floating-btn {
  padding: 8px 16px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* MODALS & DRAWERS */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Cart Drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  z-index: 55;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.cart-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--slate-50);
}

.drawer-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--slate-900);
}

.close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--slate-400);
  cursor: pointer;
  padding: 4px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.cart-item-img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--white);
}

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

.cart-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--slate-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 11px;
  color: var(--slate-500);
}

.drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--slate-200);
  background: var(--white);
}

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.total-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--slate-500);
}

.total-val {
  font-size: 22px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.btn-checkout {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--primary-glow);
  transition: all 0.2s ease;
}

.btn-checkout:hover {
  background: var(--primary-hover);
}

/* QRIS MODAL */
.qris-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 92%;
  max-width: 360px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 60;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.qris-modal.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

/* Compact Horizontal Nominal Bar */
.nominal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-light);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin: 10px 0;
}

.nominal-tag {
  font-size: 9px;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--primary);
  display: block;
  line-height: 1;
}

.nominal-val {
  font-size: 18px;
  font-weight: 900;
  color: #1e3a8a;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.btn-copy-compact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: var(--white);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-copy-compact:hover {
  background: #dbeafe;
}

.qris-box {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.qris-img {
  width: 175px;
  height: auto;
  border-radius: var(--radius-sm);
  background: var(--white);
  padding: 4px;
  border: 1px solid var(--slate-200);
}

.form-group {
  margin-top: 14px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--slate-700);
  margin-bottom: 4px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  background: var(--slate-50);
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-md);
  outline: none;
}

.form-input:focus {
  background: var(--white);
  border-color: var(--primary);
}

.btn-confirm {
  width: 100%;
  padding: 12px;
  margin-top: 14px;
  background: var(--emerald);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
}

.btn-confirm:hover {
  background: var(--emerald-dark);
}

.btn-confirm:disabled {
  background: var(--slate-300);
  cursor: not-allowed;
  box-shadow: none;
}

/* SUCCESS RECEIPT */
.success-box {
  text-align: center;
  display: none;
  padding: 10px 0;
}

.success-box.active {
  display: block;
}

.receipt-card {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 12px;
  margin: 14px 0;
  text-align: left;
  font-size: 12px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--slate-600);
}
