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

:root {
  --orange: #ea580c;
  --orange-light: #fed7aa;
  --bg: #fef7ed;
  --text: #1c1917;
  --text-light: #78716c;
  --white: #ffffff;
  --green: #16a34a;
  --red: #dc2626;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
}

/* Header */
header {
  background: var(--orange);
  color: var(--white);
  padding: 20px 16px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(234,88,12,0.3);
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

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

/* Main content */
main {
  padding: 16px;
  padding-bottom: 200px;
  max-width: 500px;
  margin: 0 auto;
}

/* Section titles */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 24px 0 12px;
  color: var(--text);
}

/* Free text input */
.free-input-wrapper {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.free-input-wrapper input {
  flex: 1;
  padding: 14px 16px;
  font-size: 1.1rem;
  border: 2px solid #d6d3d1;
  border-radius: 12px;
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}

.free-input-wrapper input:focus {
  border-color: var(--orange);
}

.free-input-wrapper button {
  padding: 14px 20px;
  font-size: 1.3rem;
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  flex-shrink: 0;
}

/* Categories */
.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.category-btn {
  padding: 10px 16px;
  font-size: 1rem;
  border: 2px solid var(--orange-light);
  border-radius: 20px;
  background: var(--white);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.category-btn.active {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
}

/* Product grid */
.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.product-btn {
  padding: 14px 12px;
  font-size: 1.05rem;
  background: var(--white);
  border: 2px solid #e7e5e4;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  box-shadow: var(--shadow);
}

.product-btn:active {
  transform: scale(0.97);
}

.product-btn.added {
  border-color: var(--green);
  background: #f0fdf4;
}

/* Cart */
.cart {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 2px solid #e7e5e4;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  z-index: 100;
  max-height: 55dvh;
  display: flex;
  flex-direction: column;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.cart-header h2 {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-badge {
  background: var(--orange);
  color: var(--white);
  font-size: 0.85rem;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 700;
}

.cart-toggle {
  font-size: 1.4rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  transition: transform 0.3s;
}

.cart-toggle.open {
  transform: rotate(180deg);
}

.cart-items {
  overflow-y: auto;
  padding: 0 16px;
  display: none;
}

.cart-items.open {
  display: block;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f5f5f4;
  font-size: 1.05rem;
}

.cart-item button {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--red);
  cursor: pointer;
  padding: 4px 8px;
}

.cart-actions {
  padding: 12px 16px;
  display: flex;
  gap: 8px;
}

.btn-send {
  flex: 1;
  padding: 16px;
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

.btn-send:disabled {
  background: #a8a29e;
  cursor: not-allowed;
}

.btn-clear {
  padding: 16px;
  font-size: 1.15rem;
  background: #fef2f2;
  color: var(--red);
  border: 2px solid #fecaca;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: var(--text);
  color: var(--white);
  padding: 24px 32px;
  border-radius: 16px;
  font-size: 1.2rem;
  text-align: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}


/* Lucide icon sizes */
.icon-header {
  width: 24px;
  height: 24px;
  vertical-align: -4px;
  stroke-width: 2.5;
}

.icon-sm {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
}

.icon-cat {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  stroke-width: 2;
}

.icon-btn {
  width: 20px;
  height: 20px;
  vertical-align: -4px;
}

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

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

header {
  position: sticky;
  top: 0;
  z-index: 100;
}

header > div {
  position: relative;
}

/* Empty state */
.empty-cart {
  padding: 16px;
  text-align: center;
  color: var(--text-light);
  font-size: 1rem;
}

/* Hide sections when no category */
.products-section {
  display: none;
}

.products-section.visible {
  display: block;
}

/* Quantity controls */
.qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-controls button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #d6d3d1;
  background: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.qty-controls span {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
}

/* Note input */
.note-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  margin-top: 6px;
  background: #fafaf9;
}
