/* ========================== */
/* RESET & GLOBAL STYLES      */
/* ========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", Arial, sans-serif;
  background: #fffdf5; /* putih krem biar terang */
  color: #333;
  padding-bottom: 140px; /* ruang untuk footer */
}
html {
  scroll-behavior: smooth;
}

h1, h2 {
  text-transform: uppercase;
}

h1 {
  text-align: center;
  color: #f9a825; /* kuning emas khas STJ */
  margin: 20px 0;
  font-size: 28px;
  font-weight: 800;
}

h2 {
  margin: 30px 20px 15px;
  font-size: 20px;
  font-weight: 700;
  color: #6d4c41; /* coklat garnish */
  border-bottom: 3px solid #f57f17;
  padding-bottom: 6px;
  scroll-margin-top: 130px;
}

/* ========================== */
/* NAVBAR & SEARCH BAR        */
/* ========================== */
#navbar {
  position: fixed;
  top: 0;
  z-index: 2000;
  background: #fff8e1; /* kuning muda */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 3px solid #f9a825;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}

#navbar::-webkit-scrollbar {
  display: none;
}

#navbar .links {
  display: flex;
  flex-wrap: nowrap;         
  gap: 10px;
  overflow-x: auto;          
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;     
}

#navbar .links::-webkit-scrollbar {
  display: none;
}

#navbar a {
  display: inline-block;
  line-height: 1.5;
  font-weight: 700;
  color: #5d4037; /* coklat tua */
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s;
  position: relative;
}



#navbar a:hover {
  background: #ffecb3; /* kuning lebih muda */
  color: #000;
}

#navbar .search input {
  padding: 10px 16px;
  font-size: 16px;
  border-radius: 10px;
  border: 2px solid #ffe082;
  background: #fff;
  color: #333;
  transition: border 0.2s;
  min-width: 200px;
}

#navbar .search input:focus {
  outline: none;
  border-color: #f9a825;
}

#navbar .search input::placeholder {
  color: #aaa;
}

/* Tambahin di style.css */
#navbar .links a {
  position: relative;
  padding-bottom: 5px; /* kasih ruang buat underline */
}

#navbar .links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: #f57f17; /* warna oranye */
  border-radius: 2px;
  transform: scaleX(0);          
  transform-origin: center;
  transition: transform 0.3s ease;
}

#navbar .links a.active::after {
  transform: scaleX(1);          /* aktif = underline muncul smooth */
}






/* ========================== */
/* MENU ITEM                  */
/* ========================== */
ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 15px;
  padding: 10px;
}

.menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(249,168,37,0.15);
  padding: 12px;
  transition: transform 0.25s, box-shadow 0.25s;
  height: 100%;
}

.menu-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(249,168,37,0.25);
}

.menu-photo {
  width: 100%;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 10px;
  background: #fff3cd; /* kuning soft */
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-info {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;  
  justify-content: flex-start; 
  gap: 4px; 
  margin-bottom: 8px;
}

.menu-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
  color: #5d4037;
}

.menu-price {
  font-size: 14px;
  color: #2e7d32; /* hijau harga */
  font-weight: 700;
}

/* ========================== */
/* QTY CONTROLS               */
/* ========================== */
.qty-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.qty-btn,
.qty-controls button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f9a825; /* kuning utama */
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
 transform: none !important;
  transition: background 0.2s ease, box-shadow 0.2s ease !important;
  /* cuma transisi warna & shadow, ga ada transform */
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.qty-btn:hover,
.qty-controls button:hover {
  background: #f57f17; /* oranye hover */
}

.qty-btn:active,
.qty-controls button:active {
  background: #e65100; /* lebih gelap pas ditekan */
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.25); /* efek ditekan */
transform: none !important; /* cegah scale pas ditekan */
}


.qty-display,
.qty-controls span {
  min-width: 30px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  color: #5d4037;
}


/* ========================== */
/* TABLE (legacy)             */
/* ========================== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(249,168,37,0.2);
  table-layout: fixed;
}

th, td {
  border: 1px solid #eee;
  padding: 10px;
  text-align: center;
  font-size: 14px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

th {
  background-color: #ffe082; /* kuning soft */
  color: #5d4037;
  font-weight: 700;
}

/* ========================== */
/* FOOTER TOTAL               */
/* ========================== */
.footer-total {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff8e1;
  border-top: 3px solid #f9a825;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.2);
  z-index: 999;
}

.footer-total .label {
  font-weight: 600;
  font-size: 16px;
  color: #5d4037;
}

.footer-total .amount {
  font-weight: 700;
  font-size: 18px;
  color: #f57f17;
}

.btn-checkout {
  background: #f9a825;
  color: white;
  border: none;
  padding: 10px 18px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.25s;
}

.btn-checkout:hover {
  background: #f57f17;
}

/* ========================== */
/* MODALS & ADD-ONS           */
/* ========================== */
.overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  animation: fadeIn 0.25s forwards;
}

@keyframes fadeIn { to { opacity: 1; } }

.modal {
  background: #fff;
  padding: 20px;
  border-radius: 14px;
  width: 340px;
  max-width: 90%;
  text-align: center;
  border: 2px solid #f9a825;
  box-shadow: 0 6px 14px rgba(0,0,0,0.2);
  position: relative;
}

.modal h3 {
  margin-top: 0;
  margin-bottom: 16px;
  color: #f57f17;
  font-size: 18px;
  font-weight: 700;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 15px 0;
}

.option-btn, .back-btn {
  padding: 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.25s;
}

.option-btn {
  background: #f9a825;
  color: #fff;
}

.option-btn:hover {
  background: #f57f17;
}

.back-btn {
  background: #6d4c41;
  color: #fff;
}

.back-btn:hover {
  background: #5d4037;
}

.option-list label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #fffde7;
  cursor: pointer;
  transition: background 0.2s;
}

.option-list label:hover {
  background: #fff59d;
}

.option-list input[type="checkbox"] {
  transform: scale(1.2);
  cursor: pointer;
}

/* ========================== */
/* RESPONSIVE                 */
/* ========================== */
@media (max-width: 480px) {
  ul {
    grid-template-columns: repeat(2, 1fr);
  }

  .menu-photo {
    height: 120px;
  }

  .menu-name {
    font-size: 13px;
  }

  .menu-price {
    font-size: 12px;
  }
}

@media (max-width: 768px) {
  ul {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 10px;
  }

  .menu-item {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    margin: 0;
    padding: 12px;
  }

  .menu-photo {
    width: 100%;
    height: 120px;
    margin: 0 0 10px 0;
  }

  .menu-info {
    width: 100%;
  }

  .qty-controls {
    margin-top: 8px;
    width: 100%;
    justify-content: center;
  }

  body {
    font-size: 14px;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 16px;
  }

  .menu-name {
    font-size: 14px;
  }

  .menu-price {
    font-size: 13px;
  }

  .menu-photo {
    width: 190px;
    height: 190px;
    font-size: 10px;
  }

  .qty-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .qty-display {
    font-size: 13px;
  }
}

/* ========================== */
/* TABLE WRAPPER SCROLL MOBILE*/
/* ========================== */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrapper table {
  min-width: 600px;
}

@media (max-width: 600px) {
  table, thead, tbody, th, td, tr {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    margin-bottom: 15px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    padding: 10px;
  }

  td {
    border: none;
    text-align: left;
    padding: 6px 10px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
  }

  td::before {
    content: attr(data-label);
    font-weight: bold;
    color: #f57f17;
  }
}

/* ========================== */
/* ORDER LIST / CARD STYLES   */
/* ========================== */
.order-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px;
}

.order-item {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 6px rgba(249,168,37,0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.order-info {
  flex: 1;
  min-width: 0;
}

.order-info strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
  word-break: break-word;
}

.order-info small {
  display: block;
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

.order-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 120px;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-controls button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #f9a825;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
}

.delete-btn {
  position: absolute;
  top: 2px !important;
  right: 2px !important;
  border: none;
  background: transparent;
  color: #000;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.note-input {
  width: 100%;
  margin: 6px 0;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 13px;
}

input, textarea, select {
  font-size: 16px !important;
}

/* menu bar horizontal */
.menu-bar {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  white-space: nowrap;
  padding: 10px;
  background: #fffde7;
  border-bottom: 1px solid #ffe082;
  position: fixed;
  top: 0;
  z-index: 10;
}
.menu-bar::-webkit-scrollbar {
  display: none;
}
.menu-btn {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: none;
  border-radius: 10px;
  background: #ffe082;
  font-weight: 600;
  cursor: pointer;
  color: #5d4037;

  display: flex;                /* tambahin */
  align-items: center;          /* teks tengah vertikal */
  justify-content: center;      /* teks tengah horizontal */
  text-align: center;           /* jaga-jaga multi-line */

}
.menu-btn.active::after {
  content: '';
  position: relative;
  bottom: 8px;
  left: 0;
  width: 100%;
  height: 7px;
  background: #f57f17;
  border-radius: 2px;
  z-index: 2;
}

.footer-total .total-box {
  display: flex;
  flex-direction: column;
}

.footer-total .label {
  font-weight: 600;
  font-size: 18px;
  color: #5d4037;
  margin-bottom: 2px;
}

.footer-total .amount {
  font-weight: 700;
  font-size: 18px;
  color: #f57f17;
}


.menu-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.order-photo {
  width: 70px;
  height: 70px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
}
.order-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-back {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  color: #ff9800;
  text-decoration: none;
  z-index: 10;
}
.page-back::before {
  content: "←";   /* aman di semua device */
  font-weight: 1000;
}
.page-back:hover {
  background: #ff9800;
  color: #fff;
}

.page-title {
  width: 100%;
  text-align: center;
  background: #ff9900d9;
  color: #ffffff9e;
  padding: 14px 0;
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  text-shadow: 0 0 5px #fff, 0 0 10px #ffd180, 0 0 15px #ff9800;
  animation: glowPulse 2s ease-in-out infinite;
  padding-left: 40px; /* ruang untuk tombol back */
  padding-right: 40px;
}
@keyframes glowPulse {
  0%, 100% { text-shadow: 0 0 2px #fff, 0 0 10px #ffd180, 0 0 15px #ff9800; }
  50% { text-shadow: 0 0 2px #fff, 0 0 20px #ffd180, 0 0 30px #ff5722; }
}

.order-title {
  width: 100%;
  text-align: center;
  background: #ff9900be;
  color: #ffffff9e;
  padding: 14px 0;
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  text-shadow: 0 0 5px #fff, 0 0 10px #ffd180, 0 0 15px #ff9800;
  animation: glowPulse 2s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { text-shadow: 0 0 0px #fff, 0 0 10px #ffd180, 0 0 15px #ff9800; }
  50% { text-shadow: 0 0 0px #fff, 0 0 20px #ffd180, 0 0 30px #ff5722; }
}

.menu-photo {
  position: relative;
}

.star-badge {
  position: absolute;
  top: -9px;
  right: -17px;
  font-size: 15px;
  animation: popIn 0.4s ease;
}

@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* style lain di atas ... */

/* ========== FIX ANTI ZOOM BUTTON ========== */
.qty-btn,
.qty-controls button {
  transform: none !important;
  animation: none !important; /* cegah ikut animasi */
}

/* ========================== */
/* SOLD OUT OVERLAY           */
/* ========================== */
.soldout-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.4); /* efek gelap */
  border-radius: 12px; /* ikut bentuk foto */
  z-index: 2;
}

.soldout-overlay img {
  width: 80%;  /* sesuaikan dengan PNG */
  max-width: 120px;
  object-fit: contain;
}

.qty-btn.disabled {
  background: #ccc !important;
  cursor: not-allowed;
  color: #666;
  box-shadow: none;
}

.menu-photo.soldout::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.6) url("img/soldout.png") center center no-repeat;
  background-size: 70%;
  border-radius: 12px;
}
/* === SweetAlert Loader Position Fix === */
.swal-loader-popup {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.swal2-html-container {
  margin: 0 !important;
  display: flex !important;
  justify-content: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f9a825;
  border-top: 4px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-top: 15px !important; /* geser ke bawah dikit */
}


@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* === FIX SweetAlert Scrollbar Flicker === */
body.swal2-shown {
  padding-right: 0 !important; /* cegah loncat kanan */
  overflow: hidden !important; /* matikan scroll sementara */
}

html {
  overflow-y: auto; /* pastikan scrollbar tetap stabil */
}
/* === FIX scrollbar glitch di dalam SweetAlert === */
.swal2-html-container {
  overflow: hidden !important;   /* matiin scroll di area isi popup */
  max-height: none !important;   /* biar ga kepotong */
  padding: 0 !important;
  margin: 0 !important;
}

.swal2-popup {
  overflow: visible !important;  /* pastiin popup ga munculin scroll sendiri */
}
