/* Accessoires lives inside the existing navigation and header cards. */
.qmam-menu-item {
  position: relative;
  display: flex;
  align-items: stretch;
}

.qmam-menu-item__link {
  display: flex;
  align-items: center;
}

.qmam-menu-item__toggle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.qmam-menu-item__toggle span {
  display: block;
  transition: transform .18s ease;
}

/* Classic desktop menus already expose submenus on hover/focus. Keeping the
 * separate control for mobile avoids crowding the header search field. */
.top-menu[data-depth="0"] > .qmam-menu-item > .qmam-menu-item__toggle,
#top-menu > .qmam-menu-item > .qmam-menu-item__toggle {
  display: none;
}

.qmam-menu-item.is-open .qmam-menu-item__toggle span {
  transform: rotate(180deg);
}

.qmam-integrated-panel {
  display: none;
  position: absolute;
  z-index: 90;
  top: 100%;
  left: 0;
  width: min(720px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid #e4e7ec;
  border-radius: 0 0 14px 14px;
  background: #fff;
  color: #111827;
  box-shadow: 0 20px 45px rgba(15, 23, 42, .2);
}

.qmam-menu-item.is-open > .qmam-integrated-panel {
  display: block;
}

.qmam-integrated-panel__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.qmam-integrated-panel__link {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  color: #111827;
  font-weight: 650;
  text-decoration: none;
}

.qmam-integrated-panel__link:hover,
.qmam-integrated-panel__link:focus-visible {
  border-color: currentColor;
  color: #b51222;
}

.qmam-integrated-panel__link .material-icons {
  color: #c51d2d;
  font-size: 21px;
}

.qmam-integrated-panel__all {
  display: inline-block;
  margin-top: 12px;
  color: #b51222;
  font-weight: 750;
}

.qmam-menu-item--flat {
  margin-left: 4px;
}

.qmam-menu-item--flat > .qmam-menu-item__link {
  padding: 10px 12px;
  color: inherit;
  font-weight: 750;
  text-decoration: none;
}

/* One header tile replaces separate windscreen and lock tiles. */
.qmam-hero-tile > span:last-child,
.qmam-hero-tile strong,
.qmam-hero-tile small {
  display: block;
}

.qmam-hero-tile small {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.25;
  opacity: .72;
}

/* PartsFinder-like category presentation on the accessory landing page. */
.qmam-catalog {
  max-width: 1180px;
  margin: 0 auto;
}

.qmam-catalog__header {
  max-width: 760px;
  margin-bottom: 24px;
}

.qmam-catalog__eyebrow {
  margin: 0 0 6px;
  color: #c51d2d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.qmam-catalog__header h1 {
  margin: 0 0 8px;
}

.qmam-catalog__intro {
  margin: 0;
  color: #5f6b7a;
}

.qmam-finder {
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  background: #f7f8fa;
}

.qmam-finder__search {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 620px;
  margin-bottom: 14px;
  padding: 0 13px;
  border: 1px solid #cfd5dd;
  border-radius: 9px;
  background: #fff;
}

.qmam-finder__search input {
  width: 100%;
  min-height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
}

.qmam-finder__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qmam-filter {
  padding: 9px 13px;
  border: 1px solid #cfd5dd;
  border-radius: 999px;
  background: #fff;
  color: #283342;
  font-weight: 700;
  cursor: pointer;
}

.qmam-filter.is-active {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.qmam-catalog__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.qmam-catalog__card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 98px;
  padding: 17px;
  border: 1px solid #e2e6eb;
  border-radius: 12px;
  background: #fff;
  color: #111827;
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.qmam-catalog__card:hover,
.qmam-catalog__card:focus-visible {
  border-color: #aeb7c3;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .09);
  transform: translateY(-1px);
}

.qmam-catalog__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #fce9ec;
  color: #c51d2d;
}

.qmam-catalog__copy {
  flex: 1;
  min-width: 0;
}

.qmam-catalog__copy strong,
.qmam-catalog__copy small {
  display: block;
}

.qmam-catalog__copy small {
  margin-top: 4px;
  color: #687382;
}

.qmam-catalog__arrow {
  font-size: 20px;
}

.qmam-catalog__empty {
  padding: 18px;
  border-radius: 10px;
  background: #f7f8fa;
}

[data-qmam-card][hidden],
[data-qmam-empty][hidden] {
  display: none !important;
}

@media (hover: hover) and (pointer: fine) {
  .qmam-menu-item:hover > .qmam-integrated-panel,
  .qmam-menu-item:focus-within > .qmam-integrated-panel {
    display: block;
  }
}

@media (min-width: 992px) {
  /* The classic header has a fixed menu lane next to its search field. */
  .top-menu[data-depth="0"].qmam-menu-host,
  #top-menu.qmam-menu-host {
    gap: 10px !important;
  }
}

@media (max-width: 991px) {
  .qmam-integrated-panel {
    left: auto;
    right: 0;
  }

  .qmam-catalog__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .top-menu[data-depth="0"] > .qmam-menu-item > .qmam-menu-item__toggle,
  #top-menu > .qmam-menu-item > .qmam-menu-item__toggle {
    display: inline-grid;
  }

  .qmam-menu-item {
    flex-wrap: wrap;
  }

  .qmam-menu-item__link {
    flex: 1;
  }

  .qmam-integrated-panel {
    position: static;
    width: 100%;
    border-radius: 0 0 10px 10px;
    box-shadow: none;
  }

  .qmam-integrated-panel__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .qmam-integrated-panel__grid,
  .qmam-catalog__grid {
    grid-template-columns: 1fr;
  }

  .qmam-finder {
    padding: 14px;
  }
}
