/* Brand directory parity with the product archive sidebar. */
.brand-directory-page .catalog-filter-heading {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 0 0 20px;
  color: #079bd3 !important;
  font-size: clamp(24px, 1.75vw, 34px) !important;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
}
.brand-directory-page .catalog-filter-heading::before { content: none !important; }
.brand-directory-page .catalog-filter-heading::after {
  content: '' !important;
  display: block;
  flex: 0 0 clamp(24px, 1.75vw, 34px);
  width: clamp(24px, 1.75vw, 34px);
  height: clamp(24px, 1.75vw, 34px);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23079bd3' stroke-width='1.6'%3E%3Crect x='2' y='2' width='10' height='10' rx='1.5'/%3E%3Crect x='19' y='2' width='10' height='10' rx='1.5'/%3E%3Crect x='2' y='19' width='10' height='10' rx='1.5'/%3E%3Ccircle cx='23.5' cy='23.5' r='4.5'/%3E%3Cpath d='m27 27 4 4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.brand-directory-page .brand-categories {
  margin: 8px 0 0;
  padding: 0;
  border-top: 0;
}
.brand-directory-page .brand-categories > li {
  position: relative;
  padding: 16px 28px 16px 0;
  border-bottom: 1px solid #ccc;
}
.brand-directory-page .brand-categories > li > a,
.brand-directory-page .brand-categories > li > details > summary {
  border-bottom: 0 !important;
}
.brand-directory-page .brand-categories > li > a {
  display: block;
  width: 100%;
  padding: 0;
  color: #18222b !important;
  font-size: clamp(18px, 1.375vw, 26px);
  font-weight: 600 !important;
  line-height: 1.25;
}
.brand-directory-page .brand-categories > li > a::after {
  content: '›';
  position: absolute;
  right: 3px;
  top: 50%;
  color: #18222b !important;
  font-size: 26px;
  line-height: 1;
  transform: translateY(-50%);
  transition: color .2s ease, transform .2s ease;
}
.brand-directory-page .brand-categories > li > a:hover,
.brand-directory-page .brand-categories > li > a:focus-visible,
.brand-directory-page .brand-categories > li.current-cat > a,
.brand-directory-page .brand-categories > li > a.is-selected,
.brand-directory-page .brand-categories > li > a:hover::after,
.brand-directory-page .brand-categories > li > a:focus-visible::after,
.brand-directory-page .brand-categories > li.current-cat > a::after { color: #079bd3 !important; }
.brand-directory-page .brand-categories > li > a:hover::after,
.brand-directory-page .brand-categories > li > a:focus-visible::after { transform: translate(3px, -50%); }
.brand-directory-page .brand-category-parent { padding: 0 !important; }
.brand-directory-page .brand-category-parent > details { margin: 0; }
.brand-directory-page .brand-category-parent > details > summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 0;
  padding: 16px 28px 16px 0;
  color: #18222b;
  cursor: pointer;
  list-style: none;
}
.brand-directory-page .brand-category-parent > details > summary::-webkit-details-marker { display: none; }
.brand-directory-page .brand-category-parent > details > summary::after {
  content: '';
  position: absolute;
  right: 5px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
  transition: color .2s ease, transform .2s ease;
}
.brand-directory-page .brand-category-parent > details[open] > summary::after {
  color: #079bd3;
  transform: translateY(-65%) rotate(135deg);
}
.brand-directory-page .brand-category-parent > details > summary > .brand-category-link {
  display: block;
  width: 100%;
  padding: 0;
  border: 0 !important;
  color: #18222b !important;
  font-size: clamp(18px, 1.375vw, 26px);
  font-weight: 600 !important;
  line-height: 1.25;
}
.brand-directory-page .brand-category-parent.current-cat > details > summary > .brand-category-link,
.brand-directory-page .brand-category-parent > details > summary > .brand-category-link.is-selected,
.brand-directory-page .brand-category-parent > details > summary > .brand-category-link:hover,
.brand-directory-page .brand-category-parent > details > summary > .brand-category-link:focus-visible { color: #079bd3 !important; }
.brand-directory-page .brand-category-children {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 0 12px 18px;
  border: 0;
  list-style: none;
}
.brand-directory-page .brand-category-children .brand-category-item {
  margin: 0;
  padding: 0;
  border: 0;
}
.brand-directory-page .brand-category-children .brand-category-link {
  position: relative;
  display: block;
  width: 100%;
  padding: 10px 28px 10px 16px;
  border-top: 1px solid #e7ecef;
  color: #52616b !important;
  font-size: clamp(15px, 1vw, 18px);
  font-weight: 500 !important;
  line-height: 1.3;
}
.brand-directory-page .brand-category-children .brand-category-link::before {
  content: '';
  position: absolute;
  left: 1px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  transform: translateY(-50%);
}
.brand-directory-page .brand-category-children .brand-category-link::after {
  content: '›';
  position: absolute;
  right: 4px;
  top: 50%;
  font-size: 20px;
  transform: translateY(-50%);
}
.brand-directory-page .brand-category-children .brand-category-link:hover,
.brand-directory-page .brand-category-children .brand-category-link:focus-visible,
.brand-directory-page .brand-category-children .brand-category-link.is-selected,
.brand-directory-page .brand-category-children .current-cat > .brand-category-link { color: #079bd3 !important; }

.brand-directory-page .brand-archive-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
}
.brand-directory-page .brand-archive-cards .brand-card {
  display: block;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dce7ec;
  border-radius: 6px;
  background: #fff;
  color: #18222b;
  text-decoration: none;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.brand-directory-page .brand-archive-cards .brand-card:hover,
.brand-directory-page .brand-archive-cards .brand-card:focus-visible {
  border-color: #8fd8ef;
  box-shadow: 0 18px 38px rgba(18,49,67,.12);
  transform: translateY(-3px);
}
.brand-directory-page .brand-archive-cards .brand-card .card-img {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1.45;
  min-height: 0;
  padding: 18px;
  background: #f7f9fb;
}
.brand-directory-page .brand-archive-cards .brand-card .card-img img {
  width: 82%;
  height: 72%;
  object-fit: contain;
}
.brand-directory-page .brand-archive-cards .brand-card .card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  padding: 12px 16px;
}
.brand-directory-page .brand-archive-cards .brand-card h3 {
  margin: 0;
  color: #18222b;
  font-size: clamp(16px, 1.1vw, 21px);
  line-height: 1.25;
}
.brand-directory-page .brand-archive-cards .brand-card span {
  flex: 0 0 auto;
  color: #079bd3;
  font-size: 24px;
  line-height: 1;
}

@media (max-width: 1024px) {
  .brand-directory-page .catalog-filter-heading { display: none !important; }
  .brand-directory-page .catalog-filter-toggle {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    width: 64px;
    height: 55px;
    min-height: 0;
    padding: 0;
    border: 0;
    background: linear-gradient(270deg, #fff 72%, rgb(255 255 255 / 88%));
    color: #079bd3;
  }
  .brand-directory-page .catalog-filter-toggle > span:first-child {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .brand-directory-page .catalog-filter-icon { width: 40px; height: 40px; }
  body.catalog-categories-ready .brand-directory-page .brand-categories:not(.is-open) {
    display: flex !important;
    flex-wrap: nowrap;
    gap: 0;
    width: 100%;
    height: 55px;
    margin: 0;
    padding: 0 70px 0 4px;
    border: 1px solid #e2e5e8;
    border-radius: 2px;
    background: #fff;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: thin;
  }
  body.catalog-categories-ready .brand-directory-page .brand-categories:not(.is-open) > li {
    flex: 0 0 auto;
    display: block;
    padding: 0;
    border: 0;
  }
  body.catalog-categories-ready .brand-directory-page .brand-categories:not(.is-open) > li > a {
    display: block;
    width: auto;
    padding: 0 12px;
    font-size: 15px;
    line-height: 53px;
    white-space: nowrap;
  }
  body.catalog-categories-ready .brand-directory-page .brand-categories:not(.is-open) > li > details > summary {
    min-height: 53px;
    padding: 0;
  }
  body.catalog-categories-ready .brand-directory-page .brand-categories:not(.is-open) > li > details > summary::after,
  body.catalog-categories-ready .brand-directory-page .brand-categories:not(.is-open) > li > details > .brand-category-children { display: none !important; }
  body.catalog-categories-ready .brand-directory-page .brand-categories:not(.is-open) > li > details > summary > a {
    display: block;
    width: auto;
    padding: 0 12px;
    font-size: 15px;
    line-height: 53px;
    white-space: nowrap;
  }
  body.catalog-categories-ready .brand-directory-page .brand-categories:not(.is-open) > li > a::after { display: none !important; }
  body.catalog-categories-ready .brand-directory-page .brand-categories.is-open {
    position: absolute;
    top: 63px;
    left: 0;
    right: 0;
    z-index: 3;
    display: block !important;
    max-height: min(65dvh, 600px);
    margin: 0;
    padding: 8px 16px;
    border: 1px solid #e2e5e8;
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 10px 24px rgb(8 44 107 / 14%);
    overflow-y: auto;
  }
  body.catalog-categories-ready .brand-directory-page .brand-categories.is-open > li {
    display: block;
    padding: 0;
    border-bottom: 1px solid #e2e5e8;
  }
  body.catalog-categories-ready .brand-directory-page .brand-categories.is-open > li > a {
    width: 100%;
    padding: 14px 28px 14px 0;
    font-size: 18px;
    line-height: 1.3;
    white-space: normal;
  }
  body.catalog-categories-ready .brand-directory-page .brand-categories.is-open > .brand-category-parent > details > summary {
    min-height: 0;
    padding: 14px 28px 14px 0;
  }
  body.catalog-categories-ready .brand-directory-page .brand-categories.is-open > .brand-category-parent > details > summary > a {
    font-size: 18px;
    line-height: 1.3;
    white-space: normal;
  }
  body.catalog-categories-ready .brand-directory-page .brand-categories.is-open .brand-category-children {
    display: grid !important;
    padding-bottom: 10px;
  }
}

@media (max-width: 900px) {
  .home .brand-section .brand-logos .brand-logo-link {
    box-sizing: border-box;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px;
    min-width: 0;
    padding: 14px 12px 12px;
    color: #191919;
    text-align: center;
  }
  .home .brand-section .brand-logos .brand-logo-link img {
    width: 92%;
    height: 100% !important;
    min-height: 0;
    padding: 0;
    background: transparent;
    object-fit: contain;
  }
  .home .brand-section .brand-logos .brand-logo-link b {
    font-size: clamp(13px, 3.6vw, 18px);
    font-weight: 600;
    line-height: 1.2;
  }
}

@media (max-width: 480px) {
  .home .brand-section .brand-logos { gap: 10px; }
  .home .brand-section .brand-logos .brand-logo-link { padding: 10px 8px; }
}

@media (max-width: 900px) {
  .brand-directory-page .brand-archive-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .brand-directory-page .brand-archive-cards { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .brand-directory-page .brand-categories > li > a::after { transition: none; }
}
