/* Shared approved floating white cards: home recommendations and brand directory. */
:is(.brand-section,.brand-directory) .brand-grid {
  grid-template-columns:repeat(8,minmax(0,1fr));
  gap:14px;
  align-items:start;
}
:is(.brand-section,.brand-directory) .brand-card {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:minmax(24px,auto) 60px minmax(20px,auto);
  gap:2px;
  align-items:start;
  width:100%;
  min-width:0;
  min-height:0;
  padding:0 8px 8px;
  border:1px solid #dcd7e4;
  border-radius:10px;
  background:#fff;
  color:#53585f;
  box-shadow:0 3px 0 #e5dced,0 7px 12px #4a32651a;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease;
}
:is(.brand-section,.brand-directory) .brand-card[hidden] { display:none; }
:is(.brand-section,.brand-directory) .brand-card:is(:hover,:focus-visible) {
  transform:translateY(-4px);
  border-color:#ac88d5;
  color:#53585f;
  box-shadow:0 4px 0 #c8b0e5,0 12px 18px #6b429c33;
}
:is(.brand-section,.brand-directory) .brand-card:active {
  transform:translateY(-1px);
  box-shadow:0 2px 0 #c8b0e5,0 5px 10px #6b429c26;
}
/* Keep long staff-authored labels in flow; short cards remain about 118px tall. */
:is(.brand-section,.brand-directory) .brand-tag {
  grid-row:1;
  position:relative;
  top:-1px;
  left:auto;
  right:auto;
  width:min(96px,80%);
  justify-self:center;
  min-width:0;
  margin:0;
  padding:0 6px;
  border-radius:0 0 7px 7px;
  background:#ffa63d;
  color:#fff;
  font-size:11px;
  font-weight:500;
  line-height:22px;
  box-shadow:none;
  overflow-wrap:anywhere;
}
:is(.brand-section,.brand-directory) .brand-visual {
  grid-row:2;
  width:100%;
  height:60px;
  min-height:0;
  margin:0;
  padding:7px 4px;
  flex:none;
}
:is(.brand-section,.brand-directory) .brand-visual .ali-image-frame { --ali-image-height:46px; }
:is(.brand-section,.brand-directory) .brand-visual>.brand-logo {
  max-width:100%;
  max-height:46px;
  object-fit:contain;
}
:is(.brand-section,.brand-directory) .brand-card .brand-wordmark {
  font-size:18px;
  line-height:1.2;
}
:is(.brand-section,.brand-directory) .brand-name {
  grid-row:3;
  display:block;
  min-width:0;
  min-height:20px;
  padding:0;
  color:#53505c;
  font-size:12px;
  line-height:20px;
  overflow-wrap:anywhere;
}
@media(max-width:800px) {
  :is(.brand-section,.brand-directory) .brand-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media(max-width:500px) {
  :is(.brand-section,.brand-directory) .brand-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
}
@media(prefers-reduced-motion:reduce) {
  :is(.brand-section,.brand-directory) .brand-card { transition:none; }
  :is(.brand-section,.brand-directory) .brand-card:is(:hover,:focus-visible,:active) { transform:none; }
}
