/* Vitrine das categorias ACDC. As margens e os intervalos acompanham a grade. */
body.acdc-theme.template-category {
  --catalog-paper: #fafafa;
  --catalog-ink: #222;
  --catalog-gutter: 52px;
  --catalog-gap: 26px;
  --catalog-row-gap: 52px;
  --catalog-heading-top: 122px;
  --catalog-heading-size: 36px;
  --catalog-nav-gap: 26px;
  --catalog-chip-gap: 10px;
  --catalog-chip-padding: 14px;
}

body.acdc-theme.template-category .acdc-catalog-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body.acdc-theme.template-category :is(.acdc-clean-category-header, .category-controls, .acdc-clean-category-grid) {
  background: var(--catalog-paper) !important;
  color: var(--catalog-ink);
}

body.acdc-theme.template-category :is(.acdc-clean-category-header, .category-controls, .acdc-clean-category-grid) > .container {
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  margin-inline: auto !important;
  padding-inline: var(--catalog-gutter) !important;
}

body.acdc-theme.template-category .acdc-clean-category-header {
  padding: var(--catalog-heading-top) 0 0 !important;
}

body.acdc-theme.template-category .acdc-clean-category-header--offers {
  padding-top: 0 !important;
}

body.acdc-theme.template-category #acdc-clean-category-title {
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  font: 400 var(--catalog-heading-size)/1 "DM Sans", Arial, sans-serif !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  color: var(--catalog-ink) !important;
  overflow-wrap: anywhere;
}

body.acdc-theme.template-category .acdc-clean-category-header:has(.acdc-clean-category-nav[data-overflow="true"]) #acdc-clean-category-title {
  padding-right: 94px !important;
}

body.acdc-theme.template-category .acdc-clean-category-nav {
  margin: var(--catalog-nav-gap) 0 0 !important;
}

body.acdc-theme.template-category #acdc-catalog-category-rail {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: var(--catalog-chip-gap) !important;
  padding: 0 !important;
  scrollbar-width: none;
}

body.acdc-theme.template-category #acdc-catalog-category-rail > a {
  display: inline-flex !important;
  align-items: center;
  flex: none !important;
  padding: 4px var(--catalog-chip-padding) !important;
  min-height: 31px !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: #fff !important;
  color: var(--catalog-ink) !important;
  font: 400 14px/1.6 "DM Sans", Arial, sans-serif !important;
  text-decoration: none !important;
  white-space: nowrap;
}

body.acdc-theme.template-category #acdc-catalog-category-rail > a:is(:hover, [aria-current="page"]) {
  background: #efeff1 !important;
}

body.acdc-theme.template-category #acdc-catalog-category-rail > a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

body.acdc-theme.template-category .acdc-clean-category-nav[data-overflow="true"] .acdc-catalog-scroll-controls:not([hidden]) {
  display: flex !important;
  top: calc(-1 * var(--catalog-nav-gap) - var(--catalog-heading-size) / 2 - 22px);
}

body.acdc-theme.template-category .acdc-catalog-scroll-controls button {
  width: 44px;
  height: 44px;
}

body.acdc-theme.template-category .category-controls .category-controls-row {
  min-height: 44px !important;
  padding: 0 !important;
  margin: 0 !important;
  gap: 18px !important;
  align-items: center;
  border: 0 !important;
  background: transparent !important;
}

body.acdc-theme.template-category .category-controls .acdc-category-products-count {
  margin-right: auto;
  color: #656565 !important;
}

body.acdc-theme.template-category .category-controls .category-control-item {
  flex: 0 0 auto !important;
  width: auto !important;
  padding: 0 !important;
}

body.acdc-theme.template-category .category-controls .category-control-item > a {
  margin: 0 !important;
  min-height: 40px !important;
  padding: 0 2px !important;
  background: transparent !important;
  border: 0 !important;
  color: #464646 !important;
}

body.acdc-theme.template-category .category-body.acdc-clean-category-grid > .container {
  margin-top: 6px !important;
  padding-top: 0 !important;
}

body.acdc-theme.template-category .acdc-clean-category-products > .row {
  margin-inline: 0 !important;
}

body.acdc-theme.template-category .acdc-clean-category-products > .row > [data-acdc-pagination] {
  padding: 0 !important;
  min-width: 0;
}

body.acdc-theme.template-category .acdc-clean-category-grid .js-product-table.row-grid {
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  gap: var(--catalog-row-gap) var(--catalog-gap) !important;
  margin: 0 !important;
  align-items: start;
  background: transparent !important;
}

body.acdc-theme.template-category .acdc-clean-category-grid .row-grid > .item-product {
  grid-column: span 4;
  min-width: 0;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Contar apenas produtos mantém a sequência também após "carregar mais". */
@media (min-width: 1024px) {
  body.acdc-theme.template-category .acdc-clean-category-grid .row-grid > .item-product:is(
    :nth-child(7n + 4 of .item-product), :nth-child(7n + 5 of .item-product),
    :nth-child(7n + 6 of .item-product), :nth-child(7n of .item-product)
  ) {
    grid-column: span 3;
  }
}

body.acdc-theme.template-category .acdc-clean-category-grid .item-product > .item {
  position: relative;
  background: transparent !important;
}

body.acdc-theme.template-category .acdc-clean-category-grid .item-product .item-image {
  height: auto !important;
  aspect-ratio: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #f0eff4 !important;
  box-shadow: none !important;
}

body.acdc-theme.template-category .acdc-clean-category-grid .item-image .js-item-image-padding {
  position: relative !important;
  width: 100% !important;
  height: 0 !important;
  padding-bottom: 140% !important;
}

/* O tema já trata tapetes e revestimentos com foto de borda a borda. */
body.acdc-theme.template-category .acdc-clean-category-grid .item-image img.product-item-image {
  object-fit: contain !important;
  object-position: center !important;
  padding: 0 !important;
  background: #fff !important;
  mix-blend-mode: multiply;
  transition: opacity .7s ease;
}

body.acdc-theme.template-category .acdc-clean-category-grid .item-product .item-description {
  margin: 0 !important;
  padding: 10px 0 0 !important;
  text-align: left !important;
  background: transparent !important;
}

body.acdc-theme.template-category .acdc-clean-category-grid .item-description > .item-link {
  display: flex !important;
  flex-flow: row wrap !important;
  align-items: baseline !important;
  justify-content: space-between;
  gap: 4px 12px !important;
  text-decoration: none;
}

body.acdc-theme.template-category .acdc-clean-category-grid .item-description .item-name {
  display: block !important;
  flex: 1 1 min(46%, 8rem);
  min-width: 0;
  min-height: 0 !important;
  margin: 0 !important;
  font: 400 14px/1.25 "DM Sans", Arial, sans-serif !important;
  letter-spacing: 1px !important;
  text-transform: none !important;
  overflow: visible !important;
  overflow-wrap: anywhere;
  white-space: normal !important;
  color: var(--catalog-ink) !important;
  opacity: 1 !important;
}

body.acdc-theme.template-category .acdc-clean-category-grid .item-description :is(.item-price-container, .acdc-price-on-request) {
  flex: 0 1 auto;
  max-width: 100%;
  min-width: 0;
  margin: 0 0 0 auto !important;
  padding: 0 !important;
  text-align: right;
}

body.acdc-theme.template-category .acdc-clean-category-grid .item-description :is(.item-price, .acdc-price-on-request) {
  font: 400 14px/1.25 "DM Sans", Arial, sans-serif !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  color: var(--catalog-ink) !important;
}

body.acdc-theme.template-category .acdc-clean-category-grid .item-description .item-price-container > .d-block {
  margin: 0 !important;
}

body.acdc-theme.template-category .acdc-clean-category-grid .item-description > .item-link > :not(.item-name, .item-price-container, .acdc-price-on-request) {
  flex-basis: 100%;
}

/* No desktop, a legenda ocupa só a base da imagem; os botões mantêm seus alvos. */
@media (min-width: 1201px) {
  body.acdc-theme.template-category .acdc-clean-category-grid .item-product > .item {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  body.acdc-theme.template-category .acdc-clean-category-grid .item-product :is(.item-image, .item-description) {
    grid-area: 1 / 1;
  }

  body.acdc-theme.template-category .acdc-clean-category-grid .item-product .item-description {
    position: relative;
    z-index: 4;
    align-self: end;
    padding: 28px 22px 22px !important;
    background: linear-gradient(transparent, rgba(250, 250, 250, .9) 55%) !important;
    pointer-events: none;
  }

  body.acdc-theme.template-category .acdc-clean-category-grid .item-description > * {
    pointer-events: auto;
  }
}

@media (max-width: 1024px) {
  body.acdc-theme.template-category {
    --catalog-gutter: 40px;
    --catalog-gap: 20px;
    --catalog-row-gap: 40px;
    --catalog-heading-top: 65px;
    --catalog-nav-gap: 20px;
  }
}

@media (max-width: 767px) {
  body.acdc-theme.template-category {
    --catalog-gutter: 20px;
    --catalog-gap: 20px;
    --catalog-row-gap: 30px;
    --catalog-heading-top: 18px;
    --catalog-heading-size: 24px;
    --catalog-nav-gap: 14px;
    --catalog-chip-gap: 6px;
    --catalog-chip-padding: 10px;
  }

  body.acdc-theme.template-category #acdc-catalog-category-rail > a {
    min-height: 30px !important;
    background: #f4f4f5 !important;
  }

  body.acdc-theme.template-category #acdc-catalog-category-rail > a[aria-current="page"] {
    background: #e7e7e9 !important;
  }

  body.acdc-theme.template-category .category-controls .category-controls-row {
    min-height: 34px !important;
    column-gap: 14px !important;
  }

  body.acdc-theme.template-category .category-controls .category-control-item > a {
    min-height: 34px !important;
  }

  body.acdc-theme.template-category .category-body.acdc-clean-category-grid > .container {
    margin-top: 2px !important;
  }

  body.acdc-theme.template-category .acdc-clean-category-grid .item-description > .item-link {
    column-gap: 7px !important;
  }
}

@media (max-width: 500px) {
  body.acdc-theme.template-category .acdc-clean-category-grid .row-grid > .item-product {
    grid-column: span 6;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.acdc-theme.template-category .acdc-clean-category-grid .item-image img.product-item-image {
    transition: none !important;
  }
}
