.brands-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin: 2rem 0;
  max-width: 800px;
  justify-content: center;
  align-items: center;
}

.brand-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  width: 120px;
  flex: 0 0 auto;
  position: relative;
  cursor: pointer;
}

.brand-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

/* Tooltip Styling */
.brand-card::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 20, 0.95);
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1.4;
  width: 480px;
  max-width: 90vw;
  text-align: left;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(241, 196, 15, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  transform: translateX(-50%) translateY(-10px);
  z-index: 1000;
  pointer-events: none;
  margin-bottom: 8px;
}

/* Tooltip arrow */
.brand-card::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid rgba(20, 20, 20, 0.95);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1001;
  pointer-events: none;
}

.brand-card:hover::before,
.brand-card:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.brand-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin: 0 auto 0.5rem;
  border-radius: 6px;
  display: block;
}

.brand-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: #f1c40f;
  margin: 0;
}

.brand-description {
  display: none;
}

@media (max-width: 768px) {
  .brands-grid {
    gap: 1rem;
  }

  .brand-card {
    width: 100px;
    min-height: 120px;
  }

  .brand-logo {
    width: 60px;
    height: 60px;
  }

  .brand-name {
    font-size: 0.8rem;
  }

  /* Mobile tooltip adjustments */
  .brand-card::before {
    width: 250px;
    font-size: 1rem;
    padding: 10px 14px;
  }
}

@media (max-width: 480px) {
  .brand-card::before {
    width: 220px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}
