:root {
  --primary: #000000;
  --secondary: #ffffff;
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666666;
  --border: #e0e0e0;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ── Header ── */
#site-header {
  background: var(--primary);
  color: var(--secondary);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

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

#store-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
}

.brand-text { display: flex; flex-direction: column; gap: 2px; }
#store-name { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.5px; line-height: 1.2; }
.store-tagline { font-size: 0.78rem; opacity: 0.8; font-weight: 400; letter-spacing: 0.3px; }

.search-bar { flex: 1; min-width: 200px; }

.search-bar input {
  width: 100%;
  padding: 10px 16px;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 0.95rem;
  background: rgba(255,255,255,0.15);
  color: white;
  transition: all 0.2s;
}

.search-bar input::placeholder { color: rgba(255,255,255,0.6); }
.search-bar input:focus {
  outline: none;
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.4);
}

/* ── Category Nav ── */
#category-nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 8px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
#category-nav::-webkit-scrollbar { display: none; }

.cat-btn {
  padding: 8px 18px;
  border: 2px solid var(--border);
  border-radius: 50px;
  background: white;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.cat-btn:hover { border-color: var(--primary); color: var(--primary); }
.cat-btn.active { background: var(--primary); border-color: var(--primary); color: var(--secondary); }

/* ── Products Grid ── */
main { max-width: 1200px; margin: 0 auto; padding: 16px 24px 48px; }

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

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }

.product-card-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #f0f0f0;
  display: block;
}

.product-card-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #ccc;
}

.product-card-body { padding: 14px; }
.product-card-name { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.product-card-category { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.product-card-price { font-size: 1.1rem; font-weight: 700; color: var(--primary); }

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: var(--radius);
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.08);
  font-size: 1rem;
  cursor: pointer;
  z-index: 1;
  transition: background 0.2s;
}
.modal-close:hover { background: rgba(0,0,0,0.15); }

.modal-body { display: grid; grid-template-columns: 1fr 1fr; }

.modal-images {
  padding: 20px;
  background: #f8f8f8;
  border-radius: var(--radius) 0 0 var(--radius);
}

#modal-main-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 8px;
  background: white;
}

.thumbnails { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}
.thumb.active { border-color: var(--primary); }

.modal-details {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#modal-product-name { font-size: 1.4rem; font-weight: 700; line-height: 1.3; }
.price { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.description { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

/* ── Variants ── */
.variant-group { display: flex; flex-direction: column; gap: 8px; }

.variant-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.variant-options { display: flex; gap: 8px; flex-wrap: wrap; }

.variant-option {
  padding: 6px 14px;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}
.variant-option:hover { border-color: var(--primary); }
.variant-option.selected { background: var(--primary); border-color: var(--primary); color: var(--secondary); }

/* ── Quantity ── */
.quantity-row { display: flex; align-items: center; gap: 16px; }

.quantity-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.qty-control {
  display: flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.qty-control button {
  width: 36px;
  height: 36px;
  border: none;
  background: #f5f5f5;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s;
}
.qty-control button:hover { background: #e8e8e8; }
#qty-value { width: 40px; text-align: center; font-weight: 600; }

/* ── Order Buttons ── */
.order-buttons { display: flex; flex-direction: row; gap: 8px; margin-top: auto; flex-wrap: wrap; }

.order-btn {
  flex: 1;
  min-width: 130px;
  padding: 10px 14px;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.order-btn:active { transform: scale(0.98); }

.whatsapp-btn { background: #25D366; }
.whatsapp-btn:hover { background: #1da851; }
.whatsapp-btn::before {
  content: '';
  width: 22px;
  height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.call-btn { background: var(--primary); }
.call-btn:hover { filter: brightness(1.15); }
.call-btn::before {
  content: '';
  width: 22px;
  height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M6.6 10.8c1.4 2.8 3.8 5.1 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1-9.4 0-17-7.6-17-17 0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.3.2 2.5.6 3.6.1.3 0 .7-.2 1L6.6 10.8z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ── Footer ── */
#site-footer {
  border-top: 1px solid var(--border);
  background: white;
  padding: 24px 24px;
  margin-top: 32px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer-inner a { color: var(--primary); text-decoration: none; font-weight: 600; }
.footer-inner a:hover { text-decoration: underline; }
.footer-divider { opacity: 0.5; }

/* ── Empty & Skeleton ── */
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-muted); }

.skeleton {
  animation: shimmer 1.5s infinite;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .modal-body { grid-template-columns: 1fr; }
  .modal-images { border-radius: var(--radius) var(--radius) 0 0; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  main { padding: 12px 12px 48px; }
  #store-name { font-size: 1.1rem; }
  #category-nav { padding: 12px 12px 6px; }
  .header-inner { padding: 0; gap: 12px; }
  #site-header { padding: 12px 16px; }
  .product-card-name { font-size: 0.85rem; }
  .product-card-price { font-size: 1rem; }
  .product-card-body { padding: 10px; }
}
