* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #25d366;
  --primary-dark: #128c7e;
  --ink: #1f2937;
  --muted: #6b7280;
  --bg: #f3f4f6;
  --card: #ffffff;
  --border: #e5e7eb;
  --danger: #ef4444;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

.header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.cart-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  padding: 6px;
}

.cart-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.hero {
  background: linear-gradient(135deg, #128c7e, #25d366);
  color: #fff;
  padding: 36px 0 40px;
  text-align: center;
}

.hero h1 {
  font-size: 1.7rem;
  margin-bottom: 8px;
}

.hero p {
  opacity: 0.95;
}

main.container {
  padding-top: 28px;
  padding-bottom: 48px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-img {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.4rem;
  font-weight: 800;
}

.card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-body h3 {
  font-size: 1rem;
}

.card-body p {
  color: var(--muted);
  font-size: 0.85rem;
  flex: 1;
}

.price {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary-dark);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s, transform 0.05s;
}

.btn:active {
  transform: translateY(1px);
}

.btn:hover {
  filter: brightness(1.05);
}

.btn-primary {
  background: var(--primary-dark);
  color: #fff;
}

.btn-whatsapp {
  background: var(--primary);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 18px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 30;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(380px, 100%);
  background: var(--card);
  z-index: 40;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head,
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 2px 8px;
}

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

.drawer-foot {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.05rem;
}

.cod-note {
  color: var(--muted);
  font-size: 0.8rem;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.cart-item-name {
  flex: 1;
  font-size: 0.9rem;
}

.cart-item-price {
  color: var(--muted);
  font-size: 0.85rem;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px 6px;
}

.qty-control button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  width: 20px;
  color: var(--ink);
}

.qty-control span {
  min-width: 18px;
  text-align: center;
  font-size: 0.9rem;
}

.remove-item {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--danger);
  font-size: 0.9rem;
}

.cart-empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal {
  background: var(--card);
  border-radius: var(--radius);
  width: min(440px, 100%);
  max-height: 90vh;
  overflow-y: auto;
}

.modal form {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal label {
  font-size: 0.85rem;
  font-weight: 600;
}

.modal input,
.modal textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  margin-bottom: 6px;
}

.modal input:focus,
.modal textarea:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
}

.error-msg {
  color: var(--danger);
  font-size: 0.8rem;
  min-height: 1em;
}

.success {
  padding: 28px 24px;
  text-align: center;
  position: relative;
}

.success-close {
  position: absolute;
  top: 8px;
  right: 8px;
}

.success-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.success h2 {
  margin-bottom: 10px;
}

.success p {
  color: var(--muted);
  margin-bottom: 8px;
}

.success-hint {
  font-size: 0.85rem;
  margin-bottom: 18px !important;
}

.success .btn {
  margin-top: 10px;
}

@media (max-width: 480px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .card-img {
    height: 110px;
    font-size: 1.6rem;
  }

  .card-body {
    padding: 10px;
  }
}
