:root {
  --merah: #c1121f;
  --merah-gelap: #991b1b;
  --kuning-muda: #fffbeb;
  --kuning-border: #fcd34d;
  --biru-lengkap: #0ea5e9;
  --biru-gelap: #0284c7;
  --border: #e5e7eb;
  --bg: #ffffff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  scroll-behavior: smooth; /* Tambah smooth scroll agar navigasi lebih halus */
}

body {
  background: var(--bg);
  color: #111827;
  line-height: 1.5;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  min-height: 100vh;
  position: relative;
}

header {
  text-align: center;
  padding: 24px 16px 16px;
  background: linear-gradient(135deg, var(--merah) 0%, var(--merah-gelap) 100%);
  color: white;
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.logo {
  width: 72px;
  margin: 0 auto 8px;
  display: block;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  object-fit: cover;
}

header h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

header p {
  font-size: 14px;
  opacity: 0.9;
  margin-top: 4px;
}

section {
  padding: 20px 16px;
  opacity: 0; /* Siapkan untuk animasi fadeIn */
  animation: fadeIn 0.4s ease-out forwards;
}

section+section {
  border-top: 1px solid var(--border);
}

h2 {
  font-size: 20px;
  margin: 8px 0 6px;
  color: var(--merah-gelap);
  line-height: 1.2;
}

h3 {
  font-size: 18px;
  margin: 0 0 12px;
  color: var(--merah-gelap);
  position: relative;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--kuning-border);
  display: inline-block;
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: #ffe8cc;
  color: #b45309;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.menu ul {
  list-style: none;
}

.menu .item {
  display: flex;
  justify-content: space-between;
  padding: 10px 8px;
  font-size: 15px;
  border-bottom: 1px dashed #ddd;
  align-items: center;
  transition: background-color 0.2s;
}

.menu .item:hover {
  background-color: var(--kuning-muda);
  border-radius: 8px;
}

.menu .item:last-child {
  border-bottom: none;
}

.price {
  color: var(--merah);
  font-weight: 700;
  font-size: 15px;
  min-width: 80px;
  text-align: right;
}

form {
  background: var(--kuning-muda);
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--kuning-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  opacity: 0;
  animation: fadeIn 0.4s ease-out forwards;
  animation-delay: 0.3s;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0 0 16px;
}

legend {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--merah-gelap);
  display: block;
  padding-left: 4px;
  border-left: 3px solid var(--merah);
}

label {
  font-size: 13px;
  font-weight: 600;
  display: block;
  color: #4b5563;
  margin-top: 8px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.radio-label:hover {
  background-color: #fff;
}

.radio-label input {
  width: auto;
  margin: 0;
}

input,
select,
textarea {
  width: 100%;
  margin: 6px 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-color: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--merah);
  box-shadow: 0 0 0 2px rgba(193, 18, 31, 0.1);
}

textarea {
  min-height: 72px;
  resize: vertical;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
  border-color: #e5e7eb;
}

.pickup {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 12px;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.pickup:hover {
  background-color: #fff;
}

.pickup input {
  width: auto;
  margin: 0;
}

#getLokasiBtn {
  background: var(--biru-lengkap);
  margin-bottom: 12px;
  color: #fff;
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  width: 100%; /* Pastikan tombol penuh lebar */
}

#getLokasiBtn:hover {
  background: var(--biru-gelap);
}

#getLokasiBtn:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}

#map {
  border: 1px solid #ddd;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.jarak-ongkir {
  font-size: 14px;
  color: #4b5563;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.text-merah {
  color: var(--merah);
  font-weight: 700;
}

.preview {
  background: #fff;
  border: 1px dashed #ddd;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  opacity: 0;
  animation: fadeIn 0.4s ease-out forwards;
  animation-delay: 0.4s;
}

.preview .row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.preview .total {
  font-weight: 700;
  color: var(--merah);
  border-top: 1px solid #eee;
  padding-top: 8px;
  margin-top: 8px;
  font-size: 15px;
}

button[type="submit"] {
  width: 100%;
  padding: 16px;
  background: var(--merah);
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(193, 18, 31, 0.2);
}

button[type="submit"]:hover {
  background: var(--merah-gelap);
  box-shadow: 0 4px 12px rgba(193, 18, 31, 0.3);
}

button[type="submit"]:active {
  transform: scale(0.98);
  box-shadow: 0 1px 4px rgba(193, 18, 31, 0.2);
}

button[type="submit"]:disabled {
  background: #ef4444;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.map-info {
  font-size: 14px;
  background: #f9fafb;
  border-left: 4px solid var(--merah);
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-style: normal;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

iframe {
  width: 100%;
  height: 200px;
  border: none;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

footer {
  text-align: center;
  font-size: 12px;
  color: #777;
  padding: 18px 16px;
  border-top: 1px solid var(--border);
  background: #f9fafb;
  line-height: 1.6;
}

footer a {
  transition: color 0.2s;
  color: inherit;
}

footer a:hover {
  color: var(--merah-gelap);
  text-decoration: underline;
}

.hidden {
  display: none;
}

@media (max-width: 360px) {
  header h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 18px;
  }

  button[type="submit"] {
    font-size: 15px;
    padding: 14px;
  }

  .menu .item {
    font-size: 14px;
  }
}

.leaflet-routing-container {
  display: none;
}

.leaflet-routing-line {
  stroke-width: 4px;
  stroke: #166534;
  stroke-opacity: 0.9;
}

.marker-toko, .marker-pemesan {
  z-index: 1000;
}

.input-error {
  border-color: var(--merah);
  box-shadow: 0 0 0 2px rgba(193, 18, 31, 0.2);
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Atur delay animasi section */
.hero { animation-delay: 0.1s; }
.menu { animation-delay: 0.2s; }
.order { animation-delay: 0.3s; }
.location { animation-delay: 0.4s; }

.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pop {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}
