/* ===== GLOBAL RESET ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== layout dua kolom untuk menu admin ===== */
.menu-container {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.menu-container > .card {
  flex: 0 0 calc(50% - 10px);
  max-width: calc(50% - 10px);
  min-width: 280px;
  display: flex;
  flex-direction: column;
}
.list-card { overflow-x: auto; }
.form-card input,
.form-card select,
.form-card textarea,
.form-card .form-actions { width: 100%; }

/* responsive: stack jadi 100% di layar kecil */
@media (max-width: 768px) {
  .menu-container > .card { flex: 0 0 100%; max-width: 100%; }
  .menu-container { gap: 12px; }
}

/* ===== global style ===== */
body {
  font-family: 'Poppins', sans-serif;
  background: #f8f8f8;
  margin: 0;
}
header {
  background: #111;
  color: #fff;
  padding: 20px;
  text-align: center;
}
header h1 { margin: 0; }

.btn {
  background: #ff4d4d;
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}

/* ===== checkout bar ===== */
.checkout-bar-admin, .checkout-bar-user {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  padding: 0.8rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.checkout-bar-admin { background: #ff4d4d; color: #fff; }
.checkout-bar-user { background: #fff; border-top: 1px solid #ddd; }

/* ===== tabel ===== */
table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid #ddd; padding: 8px; text-align: center; }

/* ===== notif ===== */
.notif { position: relative; font-size: 20px; color: #fff; text-decoration: none; }
.notif .badge {
  position: absolute;
  top: -8px;
  right: -10px;
  background: #ff4d4d;
  color: #fff;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: bold;
}

/* ===== kolom aksi tabel pesanan ===== */
#orders td:last-child {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  padding: 8px;
}
#orders td:last-child select {
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
  width: 100%;
  max-width: 120px;
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
#orders td:last-child select:hover { border-color: #999; }
#orders td:last-child button {
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  background: #ff4d4d;
  color: #fff;
  cursor: pointer;
  width: 100%;
  font-size: 13px;
  transition: all 0.2s;
}
#orders td:last-child button:hover { opacity: 0.85; }

/* responsive table */
@media screen and (max-width: 768px) {
  #orders table, #orders thead, #orders tbody, #orders th, #orders td, #orders tr { display: block; }
  #orders thead tr { display: none; }
  #orders tbody tr {
    margin-bottom: 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 8px;
  }
  #orders tbody td {
    text-align: right;
    padding: 6px 8px;
    position: relative;
  }
  #orders tbody td::before {
    content: attr(data-label);
    position: absolute;
    left: 8px;
    width: 50%;
    text-align: left;
    font-weight: bold;
  }
  #orders td:last-child { align-items: flex-start; }
}

/* ===== layout dasar pelanggan ===== */
.site-header {
  text-align: center;
  padding: 1rem;
  background: #4b2e2e;
  color: white;
}

/* search bar */
.search-bar { padding: 1rem; text-align: center; }
.search-bar input {
  width: 80%;
  max-width: 400px;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 20px;
}

/* kategori */
.categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
}
.cat-btn {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 20px;
  background: #eee;
  cursor: pointer;
}
.cat-btn.active { background: #4b2e2e; color: white; }

/* grid menu */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  padding: 1rem;
}
.menu-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}
.menu-card:hover { transform: translateY(-3px); }
.card-img { position: relative; }
.card-img img { width: 100%; height: 140px; object-fit: cover; }
.diskon {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #ff4d4d;
  color: white;
  font-size: 13px;
  font-weight: bold;
  padding: 4px 6px;
  border-radius: 6px;
}
.card-body { padding: 0.8rem; text-align: center; }
.card-body h3 { margin: 0; font-size: 16px; font-weight: bold; text-transform: capitalize; }
.card-body .desc { font-size: 13px; color: #555; margin: 4px 0; min-height: 32px; line-height: 1.4; }
.card-body .price { font-size: 15px; font-weight: bold; color: #4b2e2e; margin-bottom: 8px; }
.btn-add {
  display: inline-block;
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  background: #4b2e2e;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn-add:hover { background: #6a3e3e; transform: scale(1.05); }

/* ===== sidebar keranjang ===== */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 300px;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 8px rgba(0,0,0,0.2);
  padding: 1rem;
  transition: right 0.4s ease;
  overflow-y: auto;
  z-index: 999;
}
.cart-sidebar.active { right: 0; }
.cart-sidebar h2 { margin-top: 0; font-size: 18px; font-weight: bold; text-align: center; padding-bottom: 10px; border-bottom: 2px solid #eee; }

/* ===== item keranjang ===== */
.cart-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid #eee; font-size: 14px; }
.cart-item:last-child { border-bottom: none; }
.item-info { display: flex; gap: 6px; font-size: 14px; font-weight: bold; color: #333; }
.item-meta { display: flex; align-items: center; gap: 8px; }
.item-price { font-size: 14px; color: #4b2e2e; font-weight: bold; }
.btn-remove { background: #ff4d4d; border: none; color: white; font-size: 12px; padding: 4px 8px; border-radius: 6px; cursor: pointer; transition: opacity 0.2s; }
.btn-remove:hover { opacity: 0.85; }

/* ===== meta & footer keranjang ===== */
.cart-meta { margin: 12px 0; }
.cart-meta label { display: block; font-size: 13px; margin: 6px 0 2px; font-weight: bold; color: #444; }
.cart-meta select, .cart-meta textarea { width: 100%; padding: 6px; border: 1px solid #ccc; border-radius: 6px; font-size: 13px; }
.cart-meta textarea { min-height: 60px; resize: vertical; }
.cart-footer { border-top: 2px solid #eee; padding-top: 10px; text-align: center; }
.cart-footer span { display: block; margin-bottom: 8px; font-weight: bold; color: #4b2e2e; }
.cart-footer button {
  width: 48%;
  padding: 8px;
  margin: 2px 1%;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}
#btnClear { background: #ccc; color: #333; }
#btnPay { background: #4b2e2e; color: #fff; }
#btnClear:hover { background: #bbb; }
#btnPay:hover { background: #6a3e3e; }

/* ===== tombol keranjang bulat di header ===== */
#btnCheckout {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: #ee0303;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  z-index: 1000;
}
#btnCheckout:hover { transform: scale(1.1); background: #6a3e3e; }
#btnCheckout::after {
  content: attr(data-count);
  position: absolute;
  top: -5px; right: -5px;
  width: 18px; height: 18px;
  background: #ff4d4d; color: #fff;
  font-size: 12px; font-weight: bold;
  text-align: center; line-height: 18px;
  border-radius: 50%; display: none;
  transition: all 0.2s ease;
}
#btnCheckout[data-count]:not([data-count="0"])::after { display: block; animation: pop 0.3s ease; }
@keyframes pop { 0% { transform: scale(0); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* ===== MODAL PEMBAYARAN ===== */
.modal {
  display: none;
  position: fixed;
  top:0; left:0;
  width:100%; height:100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  position: relative;
}
.modal-content h3 {
  margin-top: 0;
  color:#4b2e2e;
  font-size: 18px;
}
.modal-content p {
  font-size: 14px;
  margin:0.8rem 0;
  color:#555;
}
#qrisImg {
  width:200px;
  height:200px;
  object-fit:contain;
  margin:1rem auto;
  display:block;
}
.btn-close {
  position:absolute;
  top:8px;
  right:8px;
  font-weight:bold;
  font-size:14px;
  cursor:pointer;
  color:#555;
  padding:4px 6px;
  border-radius:6px;
  background:#eee;
  transition: all 0.2s ease;
}
.btn-close:hover {
  color:#000;
  background:#ddd;
}
.btn-qris {
  padding:10px 15px;
  margin:10px 0;
  border:none;
  background:#4b2e2e;
  color:#fff;
  border-radius:8px;
  font-weight:bold;
  cursor:pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn-qris:hover { background:#6a3e3e; transform: scale(1.05); }
.cash-info { margin-top:15px; border-top:1px solid #ddd; padding-top:15px; }
.cash-text { font-weight:bold; color:#4b2e2e; font-size:14px; }

/* ===== LOGIN ADMIN ETHAN COFFEE ===== */
.login-container {
  max-width: 400px;
  margin: 6% auto;
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  text-align: center;
  font-family: 'Poppins', sans-serif;
}
.login-container h2 {
  margin-bottom: 20px;
  color: #4b2e2e;
}
.login-container input {
  width: 100%;
  padding: 12px;
  margin: 8px 0 16px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 14px;
}
.login-container button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: #4b2e2e;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.login-container button:hover {
  background: #6a3e3e;
  transform: scale(1.03);
}
.login-error {
  color: #ff4d4d;
  font-size: 13px;
  margin-bottom: 12px;
}

/* responsive login */
@media (max-width: 480px) {
  .login-container { margin: 12% 10px; padding: 20px; }
}

.btn-grey {
  background: #eee;
  color: #000;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s;
}

.btn-grey:hover {
  background: #ccc;
}
