/* Goose SEO Hub — category information panel, Autochip.lv, 48-1.
   Loaded in theme <head>, not in a category DOM fragment rewritten by CE.
   Styles apply only while GSH content is present on a category page. */

body#category:has(.gsh-category-description) :is(#js-product-list-header, #product-list-header, .product-list-header) {
  box-sizing: border-box;
  width: 100%;
  margin: 14px 0 26px;
  padding: clamp(20px, 3vw, 38px);
  border: 1px solid #9b2129 !important;
  border-radius: 20px !important;
  background: linear-gradient(145deg, rgba(13, 13, 16, .97), rgba(0, 0, 0, .96)) !important;
  box-shadow: 0 0 0 1px rgba(185, 27, 39, .12),
              0 10px 32px rgba(0, 0, 0, .24),
              0 0 22px rgba(180, 20, 35, .10) !important;
  color: #e8e8ea !important;
}

/* Neutralise the Classic theme's white heading card only inside our panel. */
body#category:has(.gsh-category-description) :is(#js-product-list-header, #product-list-header, .product-list-header) > .block-category.card.card-block {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 0 18px !important;
  min-height: 0;
}

body#category:has(.gsh-category-description) :is(#js-product-list-header, #product-list-header, .product-list-header) .block-category > h1.h1 {
  margin: 0 auto !important;
  color: #fff !important;
  font-size: clamp(23px, 2.9vw, 36px);
  font-weight: 800;
  line-height: 1.25;
  text-transform: none;
  text-align: center !important;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

body#category:has(.gsh-category-description) :is(#js-product-list-header, #product-list-header, .product-list-header) .block-category-inner:empty {
  display: none;
}

body#category:has(.gsh-category-description) .gsh-category-description {
  box-sizing: border-box;
  max-width: 960px;
  margin: 0 auto;
  padding: 0;
  background: transparent !important;
  color: #dfdfe2 !important;
  text-align: center !important;
  font-size: clamp(14px, 1.2vw, 16px);
  line-height: 1.7;
}

body#category:has(.gsh-category-description) .gsh-category-description p {
  color: inherit !important;
  font: inherit;
  line-height: inherit;
  margin: 0 auto 12px;
  max-width: 880px;
}

body#category:has(.gsh-category-description) .gsh-category-description .gsh-seo-intro {
  color: #fff;
  font-weight: 600;
}

body#category:has(.gsh-category-description) .gsh-category-description .gsh-seo-cta {
  color: #fff;
  font-weight: 650;
  margin-bottom: 0;
}

/* Optional factual ECU / engine details. No empty details are created. */
body#category:has(.gsh-category-description) .gsh-category-description details.gsh-seo-details {
  box-sizing: border-box;
  width: min(100%, 820px);
  margin: 19px auto;
  border: 1px solid rgba(184, 42, 52, .85) !important;
  border-radius: 13px;
  background: rgba(24, 19, 21, .82) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .025);
  overflow: hidden;
  color: #eaeaec;
  text-align: left;
}

body#category:has(.gsh-category-description) .gsh-category-description details.gsh-seo-details > summary.gsh-seo-details-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 40px !important;
  padding: 8px 16px !important;
  color: #fff;
  background: rgba(65, 8, 13, .33) !important;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  list-style: none;
  user-select: none;
}

body#category:has(.gsh-category-description) .gsh-category-description details.gsh-seo-details > summary::-webkit-details-marker {
  display: none;
}

body#category:has(.gsh-category-description) .gsh-category-description details.gsh-seo-details > summary::after {
  content: '';
  display: inline-block;
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  margin-right: 3px;
  border-right: 2px solid #e7e7e7;
  border-bottom: 2px solid #e7e7e7;
  transform: rotate(45deg);
  transition: transform .18s ease;
}

body#category:has(.gsh-category-description) .gsh-category-description details.gsh-seo-details[open] > summary::after {
  transform: rotate(225deg);
}

body#category:has(.gsh-category-description) .gsh-category-description details.gsh-seo-details > summary:hover,
body#category:has(.gsh-category-description) .gsh-category-description details.gsh-seo-details > summary:focus-visible {
  background: rgba(116, 19, 29, .40);
}

body#category:has(.gsh-category-description) .gsh-category-description details.gsh-seo-details > summary:focus-visible {
  outline: 2px solid #ef727c;
  outline-offset: -2px;
}

body#category:has(.gsh-category-description) .gsh-category-description .gsh-seo-details-body {
  padding: 18px 20px 8px;
  border-top: 1px solid rgba(175, 42, 52, .6);
  text-align: center;
}

body#category:has(.gsh-category-description) .gsh-category-description .gsh-seo-details-body p {
  margin: 0 auto 10px;
}

body#category:has(.gsh-category-description) .gsh-category-description .gsh-seo-note {
  color: #bfc0c4;
  font-size: .88em;
}

@media (max-width: 575.98px) {
  body#category:has(.gsh-category-description) :is(#js-product-list-header, #product-list-header, .product-list-header) {
    border-radius: 15px;
    padding: 20px 15px 22px;
    margin-bottom: 20px;
  }
  body#category:has(.gsh-category-description) :is(#js-product-list-header, #product-list-header, .product-list-header) > .block-category.card.card-block {
    margin-bottom: 15px !important;
  }
  body#category:has(.gsh-category-description) .gsh-category-description details.gsh-seo-details > summary.gsh-seo-details-title {
    padding: 8px 12px !important;
    font-size: 14px;
  }
  body#category:has(.gsh-category-description) .gsh-category-description .gsh-seo-details-body {
    padding: 14px 12px 8px;
  }
}
