/* EMII Brands v1.1 — self-contained, CSS-only, RTL-friendly. */
.emii-brands-widget {
  --emii-brand-columns: 8;
  --emii-brand-mobile-visible: 2.5;
  --emii-brand-gap: 12px;
  --emii-brand-logo-height: 82px;
  --emii-brand-radius: 16px;
  --emii-brand-padding: 9px;
  --emii-brand-bg: #fff;
  --emii-brand-surface: #f7f8fc;
  --emii-brand-border: #e9ebf1;
  --emii-brand-text: #263241;
  --emii-brand-text-size: 13px;
  --emii-brand-accent: #6325e6;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  direction: rtl;
}
.emii-brands-widget,
.emii-brands-widget * { box-sizing: border-box; }
.emii-brands-widget .emii-brands-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  min-width: 0;
}
.emii-brands-widget .emii-brands-header::before {
  content: "";
  flex: 0 0 4px;
  align-self: stretch;
  min-height: 31px;
  border-radius: 8px;
  background: var(--emii-brand-accent);
}
.emii-brands-widget .emii-brands-header-content { min-width: 0; }
.emii-brands-widget .emii-brands-heading {
  margin: 0;
  padding: 0;
  color: var(--emii-brand-text);
  font-family: inherit;
  font-size: clamp(18px, 1.45vw, 22px);
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -.15px;
}
.emii-brands-widget .emii-brands-subtitle {
  margin: 3px 0 0;
  padding: 0;
  color: #7a8291;
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.7;
}
.emii-brands-widget .emii-brands-list {
  display: grid;
  grid-template-columns: repeat(var(--emii-brand-columns), minmax(0, 1fr));
  align-items: stretch;
  gap: var(--emii-brand-gap);
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.emii-brands-widget .emii-brand-item {
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.emii-brands-widget .emii-brand-link {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 11px;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: var(--emii-brand-padding);
  border: 1px solid var(--emii-brand-border);
  border-radius: var(--emii-brand-radius);
  background: var(--emii-brand-bg);
  color: var(--emii-brand-text);
  text-decoration: none;
  box-shadow: 0 3px 14px -11px rgba(34, 42, 66, .16);
  -webkit-tap-highlight-color: transparent;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.emii-brands-widget .emii-brand-link:visited { color: var(--emii-brand-text); }
.emii-brands-widget .emii-brand-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: var(--emii-brand-logo-height);
  min-height: var(--emii-brand-logo-height);
  padding: 12px;
  overflow: hidden;
  background: var(--emii-brand-surface);
  border-radius: max(7px, calc(var(--emii-brand-radius) - 5px));
  transition: background-color .18s ease;
}
.emii-brands-widget .emii-brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  border: 0;
  box-shadow: none;
}
.emii-brands-widget .emii-brand-fallback {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 52px;
  height: 52px;
  max-width: 100%;
  max-height: 100%;
  border-radius: 13px;
  background: #ece5ff;
  background: color-mix(in srgb, var(--emii-brand-accent) 10%, white);
  color: var(--emii-brand-accent);
  font-family: inherit;
  font-size: 26px;
  font-weight: 800;
}
.emii-brands-widget .emii-brand-name {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0 3px 4px;
  color: var(--emii-brand-text);
  font-family: inherit;
  font-size: var(--emii-brand-text-size);
  font-weight: 700;
  line-height: 1.55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
/* Outline: no extra tinted box around the actual logo. */
.emii-brands--style-outline .emii-brand-link {
  box-shadow: none;
  gap: 9px;
}
.emii-brands--style-outline .emii-brand-visual {
  background: transparent;
  border-radius: 0;
  padding: 8px;
}
.emii-brands--style-outline .emii-brand-fallback { background: #f5f2fe; }
@media (hover: hover) and (pointer: fine) {
  .emii-brands-widget .emii-brand-link:hover {
    border-color: #d2c1ff;
    border-color: color-mix(in srgb, var(--emii-brand-accent) 30%, white);
    box-shadow: 0 12px 26px -17px rgba(49, 28, 105, .35);
    transform: translateY(-3px);
  }
  .emii-brands--style-soft .emii-brand-link:hover .emii-brand-visual {
    background: #f1edff;
    background: color-mix(in srgb, var(--emii-brand-accent) 8%, white);
  }
  .emii-brands--style-outline .emii-brand-link:hover { box-shadow: 0 9px 24px -19px rgba(49, 28, 105, .3); }
}
.emii-brands-widget .emii-brand-link:focus-visible {
  outline: 2px solid var(--emii-brand-accent);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .emii-brands-widget .emii-brand-link,
  .emii-brands-widget .emii-brand-visual { transition: none; }
  .emii-brands-widget .emii-brand-link:hover { transform: none; }
}
@media (max-width: 1024px) {
  .emii-brands-widget { --emii-brand-columns: 4; }
}
@media (max-width: 767px) {
  .emii-brands-widget {
    --emii-brand-columns: 3;
    --emii-brand-logo-height: 73px;
    --emii-brand-gap: 10px;
    --emii-brand-padding: 7px;
  }
  .emii-brands-widget .emii-brands-header { gap: 9px; margin-bottom: 13px; }
  .emii-brands-widget .emii-brands-header::before { flex-basis: 3px; min-height: 28px; }
  .emii-brands-widget .emii-brands-heading { font-size: 17px; }
  .emii-brands-widget .emii-brands-subtitle { font-size: 11px; }
  .emii-brands-widget .emii-brand-link { gap: 8px; }
  .emii-brands-widget .emii-brand-visual { padding: 9px; }
  .emii-brands-widget .emii-brand-name { font-size: min(var(--emii-brand-text-size), 13px); padding-bottom: 3px; }
  .emii-brands--mobile-scroll .emii-brands-list {
    display: grid;
    grid-template-columns: none;
    grid-template-rows: 1fr;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (var(--emii-brand-mobile-visible) - 1) * var(--emii-brand-gap)) / var(--emii-brand-mobile-visible));
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 1px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-block: 2px 6px;
  }
  .emii-brands--mobile-scroll .emii-brands-list::-webkit-scrollbar { display: none; }
  .emii-brands--mobile-scroll .emii-brand-item { scroll-snap-align: start; }
}
