/* QM Category Brands - Quality Motors storefront styling */
.qm-category-brands {
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 0.85rem;
  padding: 0.9rem 0.8rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.055);
  border-radius: 0.45rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.035);
}

.qm-category-brands,
.qm-category-brands * {
  box-sizing: border-box;
}

.qm-category-brands h4,
.qm-category-brands .qm-category-brands__title {
  margin: 0 0 0.55rem;
  padding: 0;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  color: #111;
}

.qm-category-brands h4 a,
.qm-category-brands .qm-category-brands__title a {
  color: inherit;
  text-decoration: none;
}

.qm-category-brands ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.qm-category-brands li {
  margin: 0;
  padding: 0;
}

.qm-category-brands li + li {
  margin-top: 0.12rem;
}

.qm-category-brands li > a {
  position: relative;
  display: block;
  width: 100%;
  padding: 0.18rem 0;
  color: #111;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.16s ease, padding-left 0.16s ease;
}

.qm-category-brands li > a:hover,
.qm-category-brands li > a:focus {
  color: #c89b22;
  padding-left: 0.16rem;
  text-decoration: none;
}

.qm-category-brands .qm-brand-count {
  margin-left: 0.18rem;
  color: #777;
  font-size: 0.68rem;
  font-weight: 400;
}

.qm-category-brands p {
  margin: 0;
  color: #666;
  font-size: 0.75rem;
  line-height: 1.4;
}

.qm-category-brands .brands-sort {
  width: 100%;
}

.qm-category-brands .brands-sort .select-title {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 0.3rem;
  background: #fff;
  color: #111;
  font-size: 0.75rem;
  text-align: left;
}

.qm-category-brands .brands-sort .dropdown-menu {
  width: 100%;
  min-width: 100%;
}

.qm-category-brands .brands-sort .dropdown-item {
  font-size: 0.75rem;
}

/* Brand/manufacturer page styling. PrestaShop's Classic manufacturer template
   renders these exact IDs, so the rules remain isolated to brand pages. */
#manufacturer-short_description,
#manufacturer-description {
  box-sizing: border-box;
  width: 100%;
  background: #fff;
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  color: #444;
}

body.qm-brand-page #main > h1 {
  position: relative;
  margin: 0;
  padding: 1.1rem 1.25rem 0.65rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom: 0;
  border-radius: 0.5rem 0.5rem 0 0;
  color: #111;
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

body.qm-brand-page #main > h1::after {
  content: '';
  display: block;
  width: 2.5rem;
  height: 2px;
  margin-top: 0.65rem;
  background: #c89b22;
  border-radius: 2px;
}

#manufacturer-short_description {
  margin: 0;
  padding: 0 1.25rem 0.8rem;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.55;
  color: #555;
}

#manufacturer-short_description:empty {
  padding-bottom: 0;
}

#manufacturer-description {
  position: relative;
  margin: 0 0 1rem;
  padding: 0 1.25rem 1.1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 0 0 0.5rem 0.5rem;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.035);
  font-size: 0.82rem;
  line-height: 1.62;
}

#manufacturer-description p {
  margin: 0 0 0.62rem;
  color: #4b4b4b;
  line-height: 1.62;
}

#manufacturer-description p:last-child {
  margin-bottom: 0;
}

#manufacturer-description h2,
#manufacturer-description h3,
#manufacturer-description h4 {
  margin: 1rem 0 0.45rem;
  color: #111;
  font-weight: 700;
  line-height: 1.3;
}

#manufacturer-description h2 {
  font-size: 1.02rem;
}

#manufacturer-description h3,
#manufacturer-description h4 {
  font-size: 0.9rem;
}

#manufacturer-description ul,
#manufacturer-description ol {
  margin: 0.45rem 0 0.75rem 1.1rem;
  padding: 0;
}

#manufacturer-description li {
  margin: 0.24rem 0;
  padding-left: 0.15rem;
}

#manufacturer-description li::marker {
  color: #c89b22;
}

#manufacturer-description a {
  color: #a97d16;
  font-weight: 600;
  text-decoration: none;
}

#manufacturer-description a:hover,
#manufacturer-description a:focus {
  color: #7e5d0f;
  text-decoration: underline;
}

#manufacturer-description.qm-brand-description--collapsible {
  padding-bottom: 3.8rem;
  transition: max-height 0.32s ease;
}

#manufacturer-description.qm-brand-description--collapsed {
  max-height: 16rem;
  overflow: hidden;
}

#manufacturer-description.qm-brand-description--collapsed::after {
  content: '';
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6rem;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 55%);
  border-radius: 0 0 0.5rem 0.5rem;
}

#manufacturer-description.qm-brand-description--expanded {
  max-height: none;
}

#manufacturer-description .qm-brand-description__toggle {
  position: absolute;
  z-index: 2;
  left: 1.25rem;
  bottom: 1rem;
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: #a97d16;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

#manufacturer-description .qm-brand-description__toggle::after {
  content: '›';
  display: inline-block;
  margin-left: 0.32rem;
  font-size: 1rem;
  line-height: 0;
  transform: rotate(90deg);
  transition: transform 0.16s ease;
}

#manufacturer-description.qm-brand-description--expanded .qm-brand-description__toggle::after {
  transform: rotate(-90deg);
}

#manufacturer-description .qm-brand-description__toggle:hover,
#manufacturer-description .qm-brand-description__toggle:focus {
  color: #7e5d0f;
  outline: none;
  text-decoration: underline;
}

@media (max-width: 767px) {
  .qm-category-brands {
    padding: 0.8rem;
  }

  body.qm-brand-page #main > h1 {
    padding: 0.95rem 1rem 0.6rem;
    font-size: 1.08rem;
  }

  #manufacturer-short_description {
    padding: 0 1rem 0.7rem;
    font-size: 0.84rem;
  }

  #manufacturer-description {
    padding: 0 1rem 1rem;
    font-size: 0.8rem;
  }

  #manufacturer-description.qm-brand-description--collapsible {
    padding-bottom: 3.6rem;
  }

  #manufacturer-description .qm-brand-description__toggle {
    left: 1rem;
  }
}

/* v1.0.6: commercial brand heading + existing PrestaShop brand logo */
body.qm-brand-page #main > h1 .qm-brand-page__title-text {
  display: block;
  max-width: 100%;
}

body.qm-brand-page #main > h1.qm-brand-page__title--with-logo {
  min-height: 5.4rem;
  padding-right: 7.4rem;
  display: flex;
  align-items: center;
}

body.qm-brand-page #main > h1 .qm-brand-page__logo {
  position: absolute;
  top: 50%;
  right: 1.15rem;
  width: 4.6rem;
  height: 3.5rem;
  padding: 0.38rem;
  transform: translateY(-50%);
  object-fit: contain;
  object-position: center;
  background: #fff;
  border: 1px solid rgba(200, 155, 34, 0.28);
  border-radius: 0.55rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.045);
}

body.qm-brand-page #main > h1.qm-brand-page__title--with-logo::after {
  position: absolute;
  left: 1.25rem;
  bottom: 0.66rem;
  margin-top: 0;
}

@media (max-width: 767px) {
  body.qm-brand-page #main > h1.qm-brand-page__title--with-logo {
    min-height: 4.6rem;
    padding-right: 5.15rem;
  }

  body.qm-brand-page #main > h1 .qm-brand-page__logo {
    right: 0.8rem;
    width: 3.55rem;
    height: 2.75rem;
    padding: 0.28rem;
  }

  body.qm-brand-page #main > h1.qm-brand-page__title--with-logo::after {
    left: 1rem;
    bottom: 0.58rem;
  }
}

/* v1.0.7: generated fallback intro for brands without a PrestaShop description. */
body.qm-brand-page .qm-brand-page__generated-intro {
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0 1.25rem 1rem;
  background: #fff;
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 0 0 0.5rem 0.5rem;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.035);
  color: #555;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.55;
}

body.qm-brand-page #main > h1 + .qm-brand-page__generated-intro {
  padding-top: 0.05rem;
}
