* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f7f5f1;
  color: #2a2a2a;
  line-height: 1.45;
}

.demo-banner-top {
  background: #fef3c7;
  color: #92400e;
  text-align: center;
  padding: 8px 14px;
  font-size: 0.85rem;
  border-bottom: 2px solid #f59e0b;
  font-weight: 600;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: #1f2937;
  color: #f9fafb;
}

.brand h1 { margin: 0; font-size: 1.35rem; }
.tagline { margin: 2px 0 0; font-size: 0.85rem; opacity: 0.75; }

.controls { display: flex; gap: 12px; align-items: center; }

.currency-toggle { display: flex; border: 1px solid #4b5563; border-radius: 6px; overflow: hidden; }
.currency-toggle button {
  background: transparent;
  color: #f9fafb;
  border: 0;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
}
.currency-toggle button.active { background: #f59e0b; color: #1f2937; }

.cart-button {
  background: #f59e0b;
  color: #1f2937;
  border: 0;
  padding: 9px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
.badge {
  background: #1f2937;
  color: #f9fafb;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
  font-size: 0.8rem;
}

.filters {
  display: flex;
  gap: 12px;
  padding: 16px 28px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
  align-items: center;
}
.filters input, .filters select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
}
#search { flex: 1; min-width: 220px; }
.rate-note { margin: 0; font-size: 0.85rem; color: #6b7280; }

main { padding: 24px 28px; }

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

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; color: #6b7280; }
.card h3 { margin: 0; font-size: 1.05rem; }
.card .cat { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: #9ca3af; }
.card .desc { font-size: 0.9rem; color: #4b5563; flex-grow: 1; }
.card .price { font-size: 1.15rem; font-weight: 700; color: #047857; }
.card .stock { font-size: 0.85rem; color: #6b7280; }
.card .stock.low { color: #b45309; }
.card .stock.out { color: #b91c1c; }

.qty-row { display: flex; gap: 8px; align-items: center; }
.qty-row input {
  width: 90px;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
}
.qty-row button {
  flex: 1;
  background: #1f2937;
  color: #f9fafb;
  border: 0;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.qty-row button:disabled { background: #9ca3af; cursor: not-allowed; }

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 100%;
  height: 100%;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  box-shadow: -8px 0 24px rgba(0,0,0,0.08);
  transform: translateX(110%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.cart-panel.open { transform: translateX(0); }

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #e5e7eb;
}
.cart-header h2 { margin: 0; font-size: 1.1rem; }
#cart-close {
  background: none;
  border: 0;
  font-size: 1.6rem;
  cursor: pointer;
  color: #6b7280;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px;
}
.cart-items .row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.9rem;
}
.cart-items .row button {
  background: none;
  border: 0;
  color: #b91c1c;
  cursor: pointer;
  font-size: 0.85rem;
}

.cart-summary {
  padding: 12px 18px;
  border-top: 1px solid #e5e7eb;
  font-size: 1.05rem;
}

.order-form {
  padding: 14px 18px 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.order-form h3 { margin: 0 0 4px; font-size: 0.95rem; }
.order-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  color: #4b5563;
  gap: 3px;
}
.order-form input, .order-form textarea {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
}

.send-row { display: flex; gap: 8px; margin-top: 6px; }
.btn-wa, .btn-mail {
  flex: 1;
  color: #fff;
  border: 0;
  padding: 10px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}
.btn-wa { background: #25d366; }
.btn-mail { background: #047857; }
.btn-wa:disabled, .btn-mail:disabled { background: #9ca3af; cursor: not-allowed; }

.order-status { margin: 6px 0 0; font-size: 0.85rem; min-height: 1.2em; }
.order-status.success { color: #047857; }
.order-status.error { color: #b91c1c; }

footer {
  text-align: center;
  padding: 20px;
  color: #6b7280;
  font-size: 0.85rem;
}
footer .legal { font-size: 0.75rem; opacity: 0.75; margin-bottom: 14px; }

.demo-banner-bottom {
  margin: 14px auto 0;
  max-width: 720px;
  padding: 12px 16px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  color: #92400e;
  font-size: 0.85rem;
  text-align: left;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .topbar { flex-direction: column; gap: 10px; align-items: flex-start; }
  .filters { flex-direction: column; align-items: stretch; }
  .cart-panel { width: 100%; }
}
