/**
 * Dynamic brand logo lockup — lives inside the single global header's logo
 * slot (template-parts/global-header.php), shown only when
 * eidim_store_get_current_brand_term() (functions.php) resolves the current
 * subdomain to a brand. There is no second header and no duplicate row:
 * this just swaps what sits in the existing logo column.
 */

.eidim-header__main-inner--brand {
  grid-template-columns: minmax(350px, 390px) minmax(270px, 1fr) auto;
}

.eidim-header__brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.eidim-header__brand-mark-link {
  display: inline-flex;
  align-items: center;
}

.eidim-header__brand-mark {
  display: block;
  width: auto;
  max-width: 152px;
  height: auto;
  max-height: 47px;
  object-fit: cover;
}

.eidim-header__brand-mark--text {
  color: #fff;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 1.3px;
  white-space: nowrap;
}

.eidim-header__brand-divider {
  width: 1px;
  height: 30px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, .3);
}

.eidim-header__brand-lockup .eidim-header__brand {
  width: 150px;
  height: 56px;
}

/* Matches the base header's own 1120px narrowing (see eidim-global-header.css)
 * instead of introducing an earlier, mismatched collapse point — the base
 * header stays a single-row 3-column grid all the way down to 820px, and
 * the brand lockup needs to follow that same rhythm, just with a bit more
 * room in the first column for the two logos. */
@media (max-width: 1120px) {
  .eidim-header__main-inner--brand {
    grid-template-columns: minmax(245px, 290px) minmax(220px, 1fr) auto;
  }

  .eidim-header__brand-mark {
    max-width: 110px;
    max-height: 34px;
  }

  .eidim-header__brand-lockup .eidim-header__brand {
    width: 150px;
    height: 56px;
  }
}

/* At 820px the base header collapses .eidim-header__main-inner to a
 * 2-column / 2-row grid (logo top-left, actions top-right, search spanning
 * row 2). That assumed the plain, single-class .eidim-header__main-inner
 * rule would just apply here too — it doesn't: .eidim-header__main-inner
 *--brand is a two-class selector, so it beats the plain one-class rule on
 * specificity regardless of which one is inside the narrower @media block.
 * The 1120px override above (still the closest match below 1120px, since
 * nothing between 820-1120px redeclares it) kept forcing a 3-column grid
 * on brand pages straight through the 820px breakpoint, so the header
 * never actually collapsed to mobile there — cramming the logo, the empty
 * leftover search-column slot, and the actions (account/cart/menu) into a
 * row that assumed only 2 columns, which is what pushed the cart icon out
 * of view. Redeclared here to actually collapse it, same as the plain
 * header. */
@media (max-width: 820px) {
  .eidim-header__main-inner--brand {
    grid-template-columns: 1fr auto;
  }
}

@media (max-width: 767px) {
  .eidim-header__brand-lockup {
    gap: 10px;
  }

  .eidim-header__brand-divider {
    height: 24px;
  }
}

/* v3.0.91 — more legible EIDIM logo in the dual-brand header. */
.eidim-header__brand-lockup .eidim-header__brand { flex:0 0 auto; }
.eidim-header__brand-lockup .eidim-header__brand img { display:block; width:100%; height:100%; max-width:100%; object-fit:cover; mix-blend-mode:normal; }
@media (max-width:767px) {
  .eidim-header__brand-mark { max-width:105px; max-height:36px; }
  .eidim-header__brand-lockup .eidim-header__brand { width:128px; height:54px; }
}
@media (max-width:400px) {
  .eidim-header__brand-lockup { gap:7px; }
  .eidim-header__brand-mark { max-width:91px; }
  .eidim-header__brand-lockup .eidim-header__brand { width:115px; height:49px; }
}

/* v3.1.78 — reserve independent space for the dual brand lockup and signed-in
 * account actions on small phones. Prevent the avatar from overlapping EIDIM. */
@media (max-width: 600px) {
  .eidim-header .eidim-header__main-inner--brand {
    grid-template-columns: minmax(0, 1fr) max-content;
    column-gap: 8px;
  }
  .eidim-header .eidim-header__brand-lockup {
    min-width: 0;
    width: 100%;
    gap: 6px;
    overflow: hidden;
  }
  .eidim-header .eidim-header__brand-mark-link { flex: 0 1 38%; min-width: 0; }
  .eidim-header .eidim-header__brand-mark { width: 100%; max-width: 100%; max-height: 32px; object-fit: contain; }
  .eidim-header .eidim-header__brand-divider { flex: 0 0 1px; }
  .eidim-header .eidim-header__brand-lockup .eidim-header__brand {
    flex: 0 1 56%;
    min-width: 0;
    width: auto;
    max-width: 110px;
    height: 43px;
  }
  .eidim-header .eidim-header__brand-lockup .eidim-header__brand img { object-fit: contain; }
  .eidim-header .eidim-header__actions { gap: 7px; flex-shrink: 0; min-width: 0; }
  .eidim-header .eidim-header__account-wrap--logged-in .eidim-header__account-toggle {
    padding: 2px !important;
    min-height: 36px;
    gap: 2px !important;
  }
  .eidim-header .eidim-header__account-wrap--logged-in .eidim-header__user-avatar {
    width: 30px !important;
    height: 30px !important;
  }
  .eidim-header .eidim-header__account-wrap--logged-in .eidim-header__logged-in-name,
  .eidim-header .eidim-header__logged-in-chevron { display: none !important; }
  .eidim-header .eidim-header__mobile-toggle { width: 38px; height: 38px; }
}
@media (max-width: 400px) {
  .eidim-header .eidim-header__main-inner--brand { column-gap: 5px; }
  .eidim-header .eidim-header__brand-lockup { gap: 5px; }
  .eidim-header .eidim-header__brand-mark-link { flex-basis: 36%; }
  .eidim-header .eidim-header__brand-lockup .eidim-header__brand { flex-basis: 58%; max-width: 100px; }
  .eidim-header .eidim-header__actions { gap: 5px; }
  .eidim-header .eidim-header__account-wrap--logged-in .eidim-header__user-avatar { width: 28px !important; height: 28px !important; }
  .eidim-header .eidim-header__mobile-toggle { width: 36px; height: 36px; }
}
