.ast-article-single:has(.mt-brands-nav) {
  padding-top: 0 !important;
}

/* ==========================================================================
   Brands A-Z Grid — [mt_brands] shortcode
   ========================================================================== */
.mt-brands a {
  text-decoration: none !important;
}

/* Letter navigation bar */
.mt-brands-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 40px;
  padding: 16px 16px;
  position: sticky;
  top: var(--site-header-height, 0px);
  background: #fff;
  border-radius: 12px;
  z-index: 10;
}

.ast-primary-sticky-header-active .mt-brands-nav {
  top: calc(var(--site-header-height, 125px) - 45px);
}

.mt-brands-nav-pill {
  align-items: center;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  color: #333;
  display: inline-flex;
  font-size: 14px;
  font-weight: 600;
  height: 36px;
  justify-content: center;
  min-width: 36px;
  padding: 0 10px;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.mt-brands-nav-pill:hover {
  background: #000;
  border-color: #000;
  color: #fff;
}

/* Letter group section */
.mt-brands-letter-group {
  margin-bottom: 48px;
  scroll-margin-top: calc(var(--site-header-height, 0px) + 80px);
}

.mt-brands-letter-heading {
  border-bottom: 2px solid #000;
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 24px;
  padding-bottom: 8px;
}

/* Brand grid */
.mt-brands-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(var(--mt-brands-columns, 4), 1fr);
}

/* Brand card */
.mt-brand-card {
  align-items: center;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  color: #333;
  display: flex;
  gap: 16px;
  padding: 16px;
  text-decoration: none;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.mt-brand-card:hover {
  border-color: #ccc;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  color: #333;
}

/* Logo area */
.mt-brand-card-logo {
  align-items: center;
  background: #f9f9f9;
  border-radius: 8px;
  display: flex;
  flex-shrink: 0;
  height: 64px;
  justify-content: center;
  overflow: hidden;
  width: 64px;
}

.mt-brand-card-img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.mt-brand-card-placeholder {
  color: #999;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Card text info */
.mt-brand-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.mt-brand-card-name {
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mt-brand-card-count {
  color: #888;
  font-size: 13px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tablet: ≤1279px */
@media (max-width: 1279px) {
  .mt-brands-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile: ≤1023px */
@media (max-width: 1023px) {
  .mt-brands-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mt-brands-nav {
    gap: 6px;
    margin-bottom: 24px;
    padding: 12px;
  }

  .mt-brands-nav-pill {
    font-size: 13px;
    height: 32px;
    min-width: 32px;
    padding: 0 8px;
  }

  .mt-brands-letter-group {
    margin-bottom: 32px;
  }

  .mt-brands-letter-heading {
    font-size: 20px;
    margin-bottom: 16px;
  }

  .mt-brand-card {
    gap: 12px;
    padding: 12px;
  }

  .mt-brand-card-logo {
    height: 48px;
    width: 48px;
  }

  .mt-brand-card-name {
    font-size: 14px;
  }

  .mt-brand-card-count {
    font-size: 12px;
  }
}
