/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:           #FAFAF8;
  --surface:      #FFFFFF;
  --surface-2:    #F5F4F2;
  --border:       #E7E5E4;
  --text:         #1C1917;
  --text-muted:   #78716C;
  --accent:       #F97316;
  --accent-hover: #EA6B00;
  --accent-light: #FFF7ED;
  --accent-text:  #9A3412;
  --success:      #16A34A;
  --purple:       #7C3AED;
  --purple-light: #F5F3FF;
  --danger:       #DC2626;
  --r:            12px;
  --r-sm:         8px;
  --sh-sm:        0 1px 3px rgba(0,0,0,.07);
  --sh-md:        0 4px 16px rgba(0,0,0,.09);
  --sh-lg:        0 8px 32px rgba(0,0,0,.12);
  --sidebar-w:    240px;
  --header-h:     64px;
  --cart-w:       360px;
}

/* ── Reset / Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Nunito Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Rubik', system-ui, sans-serif;
  line-height: 1.25;
  font-weight: 600;
}

img { max-width: 100%; display: block; }

button, a { cursor: pointer; }

input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
}

/* ── Utilities ─────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ── Header ────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  box-shadow: var(--sh-sm);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
}

.site-logo-name {
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  white-space: nowrap;
}

.search-wrap {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 40px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.925rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249,115,22,.15);
  background: var(--surface);
}

.search-input::placeholder { color: var(--text-muted); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-family: 'Rubik', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.cart-btn:hover { background: var(--accent-hover); }
.cart-btn:active { transform: scale(0.97); }

.cart-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.cart-count {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: #fff;
  color: var(--accent);
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── Layout ────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: calc(100vh - var(--header-h));
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 8px 10px;
}

.cat-list { list-style: none; }

.cat-item button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font-size: 0.925rem;
  font-weight: 500;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.cat-item button:hover { background: var(--surface-2); }

.cat-item button.active {
  background: var(--accent-light);
  color: var(--accent-text);
  font-weight: 700;
}

.cat-item button .cat-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.cat-item button.active .cat-count { color: var(--accent); }

/* ── Main Content ──────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 24px 20px;
  min-width: 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.3rem;
  color: var(--text);
}

.section-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Category Tabs (mobile) ───────────────────────────── */
.cat-tabs-wrap {
  display: none;
  overflow-x: auto;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.cat-tabs-wrap::-webkit-scrollbar { display: none; }

.cat-tab {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s;
}

.cat-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.cat-tab:hover:not(.active) { border-color: var(--accent); color: var(--accent); }

/* ── Products Grid ─────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--surface);
  border-radius: var(--r);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  cursor: default;
}

.product-card:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}

.product-img-wrap {
  position: relative;
  aspect-ratio: 1;
  background: var(--surface-2);
  overflow: hidden;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-img-wrap img {
  transform: scale(1.04);
}

.product-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--border);
}

.product-img-placeholder svg { width: 48px; height: 48px; }

.offer-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.offer-badge svg { width: 12px; height: 12px; }

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

.product-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.product-price {
  font-family: 'Rubik', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.product-price-original {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-price-offer {
  color: var(--accent);
}

.add-btn {
  margin-top: 10px;
  width: 100%;
  height: 38px;
  border: none;
  border-radius: var(--r-sm);
  background: var(--accent-light);
  color: var(--accent-text);
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s;
}

.add-btn:hover { background: var(--accent); color: #fff; }
.add-btn:active { transform: scale(0.97); }
.add-btn svg { width: 16px; height: 16px; }

/* ── Combos Section ───────────────────────────────────── */
.combos-section { margin-top: 40px; }

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

.combo-card {
  background: var(--surface);
  border-radius: var(--r);
  border: 1.5px solid var(--purple-light);
  overflow: hidden;
  display: flex;
  gap: 0;
  transition: box-shadow 0.2s, transform 0.2s;
}

.combo-card:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}

.combo-img-wrap {
  width: 100px;
  flex-shrink: 0;
  background: var(--surface-2);
  overflow: hidden;
}

.combo-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.combo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--purple-light);
  color: var(--purple);
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  width: fit-content;
}

.combo-name {
  font-size: 0.95rem;
  font-weight: 700;
}

.combo-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex: 1;
}

.combo-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.combo-price {
  font-family: 'Rubik', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.combo-add-btn {
  height: 32px;
  padding: 0 12px;
  border: none;
  border-radius: 6px;
  background: var(--purple-light);
  color: var(--purple);
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s, color 0.15s;
}

.combo-add-btn:hover { background: var(--purple); color: #fff; }

/* ── Cart Overlay ─────────────────────────────────────── */
.cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 40;
  backdrop-filter: blur(2px);
}

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

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(var(--cart-w), 100vw);
  background: var(--surface);
  box-shadow: var(--sh-lg);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.cart-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.cart-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.cart-close:hover { background: var(--border); color: var(--text); }
.cart-close svg { width: 18px; height: 18px; }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: var(--text-muted);
  text-align: center;
}

.cart-empty svg { width: 56px; height: 56px; opacity: 0.3; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.cart-item-img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-unit {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}

.qty-btn:hover { border-color: var(--accent); color: var(--accent); }

.qty-btn.remove:hover { border-color: var(--danger); color: var(--danger); }

.qty-val {
  font-family: 'Rubik', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.cart-item-price {
  font-family: 'Rubik', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 60px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Cart Footer ──────────────────────────────────────── */
.cart-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-total-label { font-size: 0.9rem; color: var(--text-muted); }

.cart-total-amount {
  font-family: 'Rubik', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
}

.cart-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.btn-whatsapp {
  height: 48px;
  border: none;
  border-radius: var(--r-sm);
  background: #25D366;
  color: #fff;
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s;
  text-decoration: none;
}

.btn-whatsapp:hover { background: #20BA5A; }

.btn-whatsapp svg { width: 22px; height: 22px; flex-shrink: 0; }

.btn-clear-cart {
  height: 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.15s;
}

.btn-clear-cart:hover { border-color: var(--danger); color: var(--danger); }

/* ── No results ───────────────────────────────────────── */
.no-results {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  display: none;
}

.no-results svg { width: 48px; height: 48px; margin: 0 auto 12px; opacity: 0.3; }

/* ── Scroll to top ───────────────────────────────────── */
.scroll-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 25;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--text);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.scroll-top-btn.visible { opacity: 1; pointer-events: auto; }
.scroll-top-btn svg { width: 20px; height: 20px; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .cat-tabs-wrap { display: flex; }
  .main-content { padding: 16px; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .combos-grid { grid-template-columns: 1fr; }
  .site-logo-name { display: none; }
  .cart-btn span.label { display: none; }
}

@media (max-width: 480px) {
  .products-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .product-body { padding: 10px; }
}

@media (max-width: 380px) {
  .products-grid { grid-template-columns: 1fr; }
}

/* ── Reduced motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
