/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

/* ── Tokens ── */
:root {
  --navy:       #1B3068;
  --navy-lt:    #22408A;
  --teal:       #C49428;
  --teal-lt:    #D4A938;
  --ground:     #F3F4F6;
  --surface:    #FFFFFF;
  --text:       #111827;
  --text-2:     #4B5563;
  --text-3:     #9CA3AF;
  --rule:       #E5E7EB;
  --wa:         #25D366;
  --wa-dark:    #1DA851;
  --radius:     6px;
  --shadow:     0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
}

/* ── Base ── */
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--ground);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.header-logo {
  height: 42px;
  width: auto;
  display: block;
}
.logo-mark {
  background: var(--navy);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .04em;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-mark.sm { width: 28px; height: 28px; font-size: 11px; }
.logo-text { font-size: 16px; color: var(--navy); }
.logo-text strong { color: var(--teal); font-weight: 700; }

/* Search */
.header-search {
  display: flex;
  width: 100%;
  max-width: 520px;
  justify-self: center;
}
.header-search input {
  flex: 1;
  padding: 8px 14px;
  border: 1.5px solid var(--rule);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--ground);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
.header-search input::placeholder { color: var(--text-3); }
.header-search input:focus { border-color: var(--navy); background: #fff; }
.header-search button {
  padding: 8px 14px;
  background: var(--navy);
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #fff;
  cursor: pointer;
  transition: background .2s;
}
.header-search button:hover { background: var(--navy-lt); }

/* Nav */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-self: end;
}
.header-nav a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color .2s, background .2s;
}
.header-nav a:hover, .header-nav a.active { color: var(--navy); background: var(--ground); }
.btn-whatsapp {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--wa) !important;
  color: #fff !important;
  font-weight: 600;
  padding: 7px 14px !important;
}
.btn-whatsapp:hover { background: var(--wa-dark) !important; }

/* ── Hero Slider ── */
.hero-slider {
  position: relative;
  overflow: hidden;
  background: #fff;
  line-height: 0;
  max-height: 540px;
  margin: -20px -24px 20px;
  width: calc(100% + 48px);
}
.slide { display: none; width: 100%; animation: slideFade .5s ease; }
.slide.active { display: block; }
.slide img {
  width: 100%;
  height: auto;
  display: block;
}
@keyframes slideFade { from { opacity: 0; } to { opacity: 1; } }

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.35);
  color: #fff;
  border: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
  z-index: 10;
}
.slider-btn:hover { background: rgba(0,0,0,.6); }
.slider-prev { left: 14px; }
.slider-next { right: 14px; }

.slider-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(255,255,255,.45);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background .2s, transform .2s;
}
.dot.active { background: #fff; transform: scale(1.25); }

@media (max-width: 600px) {
  .slider-btn { width: 30px; height: 30px; font-size: 20px; }
  .slider-prev { left: 8px; }
  .slider-next { right: 8px; }
}

/* ── Layout ── */
.page-layout {
  flex: 1;
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 0;
}

/* ── Sidebar ── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--rule);
  padding: 20px 0;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 14px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 8px;
}
.sidebar-header h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-2);
}
.sidebar-close { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-2); }

.cat-nav {
  display: flex;
  flex-direction: column;
  padding: 0 8px;
}
.cat-item {
  text-align: left;
  background: none;
  border: none;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s, color .15s;
  width: 100%;
}
.cat-item:hover { background: var(--ground); color: var(--text); }
.cat-item.active { background: #E8F0FE; color: var(--navy-lt); font-weight: 600; }
.cat-item.parent { font-weight: 600; color: var(--text); font-size: 13px; margin-top: 8px; }
.cat-item.child { padding-left: 24px; font-size: 13px; }

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

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.btn-menu {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
}
.toolbar-title {
  font-weight: 700;
  font-size: 18px;
  color: var(--navy);
}
.toolbar-count {
  font-size: 13px;
  color: var(--text-3);
  margin-left: auto;
}

/* ── Product Grid ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.product-grid.is-home { display: block; }

/* ── Homepage category sections ── */
.cat-section { margin-bottom: 40px; }
.cat-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--rule);
}
.cat-section-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -.01em;
}
.see-all-btn {
  font-size: 13px;
  color: var(--teal);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background .15s, color .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.see-all-btn:hover { background: #E8F8F6; color: var(--teal-lt); }
.product-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* Loading */
.loading-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-3);
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--rule);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-3);
}
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text-2); }

/* Product Card */
.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.card-img {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--ground);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.product-card:hover .card-img img { transform: scale(1.04); }
.card-img .no-img {
  width: 48px; height: 48px;
  opacity: .2;
}
.card-body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-brand {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal);
}
.card-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-cat {
  font-size: 11px;
  color: var(--text-3);
  margin-top: auto;
  padding-top: 6px;
}
.card-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--rule);
}
.card-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 7px;
  background: var(--wa);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s;
}
.card-wa:hover { background: var(--wa-dark); }
.card-wa svg { flex-shrink: 0; }

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.pagination button {
  padding: 8px 14px;
  border: 1px solid var(--rule);
  background: var(--surface);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  transition: background .15s;
}
.pagination button:hover { background: var(--ground); }
.pagination button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.pagination button:disabled { opacity: .4; cursor: default; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border-radius: 8px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-close {
  position: absolute;
  top: 12px; right: 16px;
  background: none; border: none;
  font-size: 26px; color: var(--text-3);
  cursor: pointer; line-height: 1;
  z-index: 1;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 0; }
.modal-img {
  aspect-ratio: 16/9;
  background: var(--ground);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
}
.modal-img img { width: 100%; height: 100%; object-fit: contain; }
.modal-info { padding: 24px; }
.modal-brand {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 6px;
}
.modal-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 8px;
}
.modal-cat {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 24px;
}
.modal-cta-block {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.modal-cta-block p {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 12px;
}
.modal-wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: var(--wa);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  transition: background .2s;
}
.modal-wa-btn:hover { background: var(--wa-dark); }
.modal-related h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.related-card {
  cursor: pointer;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow .15s;
}
.related-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.related-card .rimg {
  aspect-ratio: 1;
  background: var(--ground);
  overflow: hidden;
}
.related-card .rimg img { width: 100%; height: 100%; object-fit: cover; }
.related-card .rname {
  font-size: 11px;
  padding: 5px 6px;
  color: var(--text-2);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Footer ── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,.7);
  padding: 28px 20px;
  text-align: center;
  margin-top: auto;
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.footer-brand {
  display: flex; align-items: center; gap: 8px;
  color: #fff; font-size: 15px;
}
.footer-brand strong { color: #fff; }
.footer-tagline { font-size: 13px; }
.footer-logo { height: 36px; width: auto; background: #fff; padding: 5px 12px; border-radius: 6px; }
.footer-wa {
  color: var(--wa);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.footer-wa:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform .25s ease;
    height: 100vh;
    padding-top: 64px;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .btn-menu { display: flex; }
  .main-content { padding: 16px; }
  .hero-slider { margin: -16px -16px 16px; width: calc(100% + 32px); }
  .toolbar-title { font-size: 15px; }
}
@media (max-width: 600px) {
  .header-inner { grid-template-columns: auto auto; }
  .header-search { display: none; }
  .header-logo { height: 32px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-name { font-size: 17px; }
}
