/* Home index — category / product grid (scoped) */

:root {
  --mb-cat-maroon: #7c2d12;
  --mb-cat-saffron: #d97706;
  --mb-cat-ink: #1c1917;
  --mb-cat-muted: #78716c;
  --mb-cat-surface: #ffffff;
  --mb-cat-well: linear-gradient(165deg, #fffbf5 0%, #fef3e2 48%, #fde8cc 100%);
  --mb-cat-border: rgba(124, 45, 18, 0.1);
  --mb-cat-shadow: 0 2px 10px rgba(28, 25, 23, 0.06);
  --mb-cat-shadow-hover: 0 8px 24px rgba(124, 45, 18, 0.12);
  --mb-cat-radius: 16px;
}

/* ─── Section header ─── */
.mb-home-products-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  margin: 0 0 14px;
}

.mb-home-products-head__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--mb-cat-ink);
  line-height: 1.2;
}

.mb-home-products-head__sub {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--mb-cat-muted);
  line-height: 1.3;
}

.mb-home-products-head__count {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mb-cat-maroon);
  background: rgba(124, 45, 18, 0.08);
  border: 1px solid rgba(124, 45, 18, 0.12);
  padding: 5px 10px;
  border-radius: 999px;
}

/* ─── Filter pills ─── */
.mb-home-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 12px 16px;
  margin-top: 4px;
}

.mb-home-filters__label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--mb-cat-ink);
  letter-spacing: -0.01em;
}

.mb-home-filters__pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.mb-home-filters__pills::-webkit-scrollbar {
  display: none;
}

.mb-filter-pill {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid rgba(124, 45, 18, 0.14);
  background: var(--mb-cat-surface);
  color: var(--mb-cat-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.04);
}

.mb-filter-pill:hover {
  border-color: rgba(217, 119, 6, 0.45);
  background: #fffbf5;
}

.mb-filter-pill:active {
  transform: scale(0.97);
}

.mb-filter-pill.is-active {
  background: linear-gradient(135deg, var(--mb-cat-maroon) 0%, #9a3412 55%, var(--mb-cat-saffron) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 45, 18, 0.28);
}

.mb-filter-pill--reset.is-active {
  background: var(--mb-cat-surface);
  color: var(--mb-cat-muted);
  border-color: rgba(124, 45, 18, 0.12);
  box-shadow: none;
}

/* ─── Category tile grid ─── */
#products-load-root .mb-home-cat-grid {
  --bs-gutter-x: 10px;
  margin-top: 0;
}

#products-load-root.mb-home-cat-grid--filtering #products-container {
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

#products-load-root .mb-cat-tile-col {
  margin-bottom: 10px;
}

.mb-cat-tile {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
  -webkit-tap-highlight-color: transparent;
}

.mb-cat-tile:hover,
.mb-cat-tile:focus-visible {
  text-decoration: none;
  color: inherit;
}

.mb-cat-tile__card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--mb-cat-surface);
  border: 1px solid var(--mb-cat-border);
  border-radius: var(--mb-cat-radius);
  box-shadow: var(--mb-cat-shadow);
  overflow: hidden;
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}

.mb-cat-tile:hover .mb-cat-tile__card,
.mb-cat-tile:focus-visible .mb-cat-tile__card {
  transform: translateY(-3px);
  box-shadow: var(--mb-cat-shadow-hover);
  border-color: rgba(217, 119, 6, 0.22);
}

.mb-cat-tile:active .mb-cat-tile__card {
  transform: translateY(-1px) scale(0.98);
}

.mb-cat-tile__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--mb-cat-saffron), #ea580c);
  padding: 4px 7px;
  border-radius: 6px;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35);
}

.mb-cat-tile__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--mb-cat-well);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 12px 10px;
  overflow: hidden;
}

.mb-cat-tile__media::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.55));
  pointer-events: none;
}

.mb-cat-tile__img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: 88%;
  max-height: 88%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 4px 10px rgba(124, 45, 18, 0.12));
  transition: transform 0.25s ease;
}

.mb-cat-tile:hover .mb-cat-tile__img {
  transform: scale(1.04);
}

.mb-cat-tile__body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 10px 12px;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, #fffcf8 100%);
}

.mb-cat-tile__name {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--mb-cat-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  hyphens: auto;
}

/* Empty state */
.mb-cat-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--mb-cat-muted);
  font-size: 0.9375rem;
}

/* Skeleton tiles — match live cards */
#products-load-root .skeleton-panel--product-grid {
  margin-top: 0;
  padding: 0 12px;
}

#products-load-root .mb-cat-skeleton {
  border-radius: var(--mb-cat-radius);
  overflow: hidden;
  border: 1px solid rgba(124, 45, 18, 0.08);
  box-shadow: var(--mb-cat-shadow);
  background: #fff;
}

#products-load-root .mb-cat-skeleton__media {
  aspect-ratio: 1 / 1;
  background: linear-gradient(
    110deg,
    #fef3e2 8%,
    #fffbf5 18%,
    #fef3e2 33%
  );
  background-size: 200% 100%;
  animation: mb-cat-shimmer 1.4s ease-in-out infinite;
}

#products-load-root .mb-cat-skeleton__line {
  height: 10px;
  margin: 12px auto 14px;
  width: 68%;
  border-radius: 6px;
}

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

@media (max-width: 380px) {
  .mb-cat-tile__name {
    font-size: 0.75rem;
  }

  .mb-cat-tile__media {
    padding: 10px 8px 8px;
  }

  .mb-cat-tile__body {
    min-height: 40px;
    padding: 6px 8px 10px;
  }
}

@media (min-width: 992px) {
  .mb-home-products-head__title {
    font-size: 1.375rem;
  }

  .mb-cat-tile__name {
    font-size: 0.875rem;
  }
}

/* Section spacing */
.mb-home-products-section {
  margin-top: 24px;
  padding-bottom: 8px;
}

@media (max-width: 991.98px) {
  .mb-home-products-section {
    margin-top: 18px;
  }
}
