:root {
  --dark: #241a12;
  --bronze: #9c3f1c;
  --red: #6b5e4f;
  --cream: #f6efe5;
  --gray: #6b6b6b;
  --border: #e7dccb;
  --wa: #25d366;
  --wa-dark: #1da851;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--dark);
}

a { color: inherit; }

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--dark);
  color: var(--dark);
}
.btn-outline.active {
  background: var(--bronze);
  border-color: var(--bronze);
  color: #fff;
}

.btn-whatsapp {
  background: var(--wa);
  color: #fff;
}
.btn-whatsapp:hover { background: var(--wa-dark); }

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo { height: 46px; }
.header-actions { display: flex; gap: 10px; align-items: center; }

/* Toolbar */
.toolbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 71px;
  z-index: 19;
}
.toolbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
}
#searchInput {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  margin-bottom: 12px;
}
#searchInput:focus { outline: none; border-color: var(--bronze); }

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.tab-btn {
  flex: none;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--dark);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.tab-btn.active {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}

/* Main / grid */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}
.results-count {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 12px;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.empty-state {
  text-align: center;
  color: var(--gray);
  padding: 60px 0;
}

.grouped-wrap .group-grid {
  margin-bottom: 30px;
}
.group-heading {
  font-size: 17px;
  font-weight: 800;
  margin: 22px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--bronze);
}
.grouped-wrap .group-heading:first-child {
  margin-top: 0;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f1ece3;
  cursor: pointer;
  overflow: hidden;
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--bronze);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}
.card-photo-count {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
}
.card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  min-height: 38px;
}
.card-stock {
  font-size: 12px;
  color: var(--gray);
}
.card-prices { margin-top: auto; }
.price-public {
  font-size: 18px;
  font-weight: 800;
  color: var(--dark);
}
.price-wholesale {
  font-size: 13px;
  color: var(--red);
  font-weight: 700;
  display: none;
}
.mayoreo-on .price-wholesale { display: block; }
.card-wa {
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  padding: 8px;
}
.card-aviso {
  font-size: 10.5px;
  line-height: 1.4;
  color: #8a5a1e;
  background: #fdf3e2;
  border: 1px solid #f0dcb2;
  border-radius: 6px;
  padding: 6px 8px;
  margin-top: 4px;
}

/* Contact */
.contact-section {
  background: var(--dark);
  color: #fff;
  padding: 50px 20px;
  margin-top: 30px;
}
.contact-inner {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}
.contact-inner h2 { margin-bottom: 6px; }
.contact-inner p { color: #cfc9c0; margin-bottom: 22px; }
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}
.contact-form input,
.contact-form textarea {
  padding: 11px 14px;
  border-radius: var(--radius);
  border: none;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}
.contact-form button { margin-top: 4px; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 18px;
  font-size: 12.5px;
  color: var(--gray);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10,8,6,.92);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] {
  display: none;
}
.lightbox img {
  max-width: 88vw;
  max-height: 82vh;
  border-radius: 6px;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 22px;
  background: none;
  border: none;
  color: #fff;
  font-size: 34px;
  cursor: pointer;
  line-height: 1;
}
.lightbox-nav {
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  font-size: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  margin: 0 18px;
}
.lightbox-nav:hover { background: rgba(255,255,255,.25); }

@media (max-width: 640px) {
  .logo { height: 36px; }
  .header-actions { gap: 6px; }
  .btn { padding: 8px 12px; font-size: 13px; }
}
