/**
 * Repairs Elementor flex/backgrounds on Woo product-category layouts
 * where borrowed sections (colors, director, tech) render as plain stacks.
 * Scoped to product category archives only.
 *
 * Do NOT force display:flex on all .e-con — that overrides
 * .elementor-hidden-desktop and shows the mobile header menu on desktop.
 */

/* Keep Elementor responsive visibility working even if other rules fight it */
@media (min-width: 1025px) {
  body.tax-product_cat .elementor-hidden-desktop {
    display: none !important;
  }
}
@media (max-width: 1024px) and (min-width: 768px) {
  body.tax-product_cat .elementor-hidden-tablet {
    display: none !important;
  }
}
@media (max-width: 767px) {
  body.tax-product_cat .elementor-hidden-mobile {
    display: none !important;
  }
}

/* Topping: color chips row */
body.term-toppingovye-poly .elementor-5758 .elementor-element-aabb070 > .e-con-inner {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  gap: 0 20px !important;
}

body.term-toppingovye-poly .elementor-5758 .elementor-element-81317e1 {
  background-color: #A7A69D !important;
  width: 25% !important;
  max-width: 25% !important;
  min-height: 56px !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 14px 10px !important;
  box-sizing: border-box !important;
}
body.term-toppingovye-poly .elementor-5758 .elementor-element-81317e1 .elementor-heading-title,
body.term-toppingovye-poly .elementor-5758 .elementor-element-81317e1 .elementor-heading-title a {
  color: #fff !important;
  text-align: center !important;
}

body.term-toppingovye-poly .elementor-5758 .elementor-element-e2287c3 {
  background-color: #4B6A82 !important;
  width: 25% !important;
  max-width: 25% !important;
  min-height: 56px !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 14px 10px !important;
  box-sizing: border-box !important;
}
body.term-toppingovye-poly .elementor-5758 .elementor-element-e2287c3 .elementor-heading-title,
body.term-toppingovye-poly .elementor-5758 .elementor-element-e2287c3 .elementor-heading-title a {
  color: #fff !important;
  text-align: center !important;
}

body.term-toppingovye-poly .elementor-5758 .elementor-element-b7be8bb {
  background-color: #41725D !important;
  width: 25% !important;
  max-width: 25% !important;
  min-height: 56px !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 14px 10px !important;
  box-sizing: border-box !important;
}
body.term-toppingovye-poly .elementor-5758 .elementor-element-b7be8bb .elementor-heading-title,
body.term-toppingovye-poly .elementor-5758 .elementor-element-b7be8bb .elementor-heading-title a {
  color: #fff !important;
  text-align: center !important;
}

body.term-toppingovye-poly .elementor-5758 .elementor-element-c562970 {
  background-color: #703731 !important;
  width: 25% !important;
  max-width: 25% !important;
  min-height: 56px !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 14px 10px !important;
  box-sizing: border-box !important;
}
body.term-toppingovye-poly .elementor-5758 .elementor-element-c562970 .elementor-heading-title,
body.term-toppingovye-poly .elementor-5758 .elementor-element-c562970 .elementor-heading-title a {
  color: #fff !important;
  text-align: center !important;
}

body.term-toppingovye-poly .elementor-5758 .elementor-element-250b7d6 {
  background-color: #A5A8A6 !important;
  width: 25% !important;
  max-width: 25% !important;
  min-height: 56px !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 14px 10px !important;
  box-sizing: border-box !important;
}
body.term-toppingovye-poly .elementor-5758 .elementor-element-250b7d6 .elementor-heading-title,
body.term-toppingovye-poly .elementor-5758 .elementor-element-250b7d6 .elementor-heading-title a {
  color: #fff !important;
  text-align: center !important;
}

body.term-toppingovye-poly .elementor-5758 .elementor-element-8e907ef {
  background-color: #5A3A29 !important;
  width: 25% !important;
  max-width: 25% !important;
  min-height: 56px !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 14px 10px !important;
  box-sizing: border-box !important;
}
body.term-toppingovye-poly .elementor-5758 .elementor-element-8e907ef .elementor-heading-title,
body.term-toppingovye-poly .elementor-5758 .elementor-element-8e907ef .elementor-heading-title a {
  color: #fff !important;
  text-align: center !important;
}

body.term-toppingovye-poly .elementor-5758 .elementor-element-81317e1 .elementor-heading-title,
body.term-toppingovye-poly .elementor-5758 .elementor-element-81317e1 .elementor-heading-title a,
body.term-toppingovye-poly .elementor-5758 .elementor-element-250b7d6 .elementor-heading-title,
body.term-toppingovye-poly .elementor-5758 .elementor-element-250b7d6 .elementor-heading-title a {
  color: #2C2C2C !important;
}

/* Director / quote row: photo + text side by side on desktop */
body.term-toppingovye-poly .elementor-5758 .elementor-element-04bbcc6 > .e-con-inner {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 24px !important;
}
body.term-toppingovye-poly .elementor-5758 .elementor-element-9881dd0 {
  width: 24% !important;
  max-width: 24% !important;
  flex: 0 0 24% !important;
}
body.term-toppingovye-poly .elementor-5758 .elementor-element-35f73a2 {
  width: 100% !important;
  flex: 1 1 auto !important;
}

/* Tech + bag row */
body.term-toppingovye-poly .elementor-5758 .elementor-element-1312b59 > .e-con-inner {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
}
body.term-toppingovye-poly .elementor-5758 .elementor-element-952476f {
  width: 50% !important;
  max-width: 50% !important;
}
body.term-toppingovye-poly .elementor-5758 .elementor-element-dcd1581 {
  width: 50% !important;
  max-width: 50% !important;
  min-height: 40vh !important;
}

@media (max-width: 767px) {
  body.term-toppingovye-poly .elementor-5758 .elementor-element-aabb070 > .e-con-inner {
    flex-direction: column !important;
  }
  body.term-toppingovye-poly .elementor-5758 .elementor-element-81317e1,
  body.term-toppingovye-poly .elementor-5758 .elementor-element-e2287c3,
  body.term-toppingovye-poly .elementor-5758 .elementor-element-b7be8bb,
  body.term-toppingovye-poly .elementor-5758 .elementor-element-c562970,
  body.term-toppingovye-poly .elementor-5758 .elementor-element-250b7d6,
  body.term-toppingovye-poly .elementor-5758 .elementor-element-8e907ef {
    width: 100% !important;
    max-width: 100% !important;
  }
  body.term-toppingovye-poly .elementor-5758 .elementor-element-04bbcc6 > .e-con-inner,
  body.term-toppingovye-poly .elementor-5758 .elementor-element-1312b59 > .e-con-inner {
    flex-direction: column !important;
  }
  body.term-toppingovye-poly .elementor-5758 .elementor-element-9881dd0,
  body.term-toppingovye-poly .elementor-5758 .elementor-element-952476f,
  body.term-toppingovye-poly .elementor-5758 .elementor-element-dcd1581 {
    width: 100% !important;
    max-width: 100% !important;
    flex-basis: 100% !important;
  }
}

/* Kamennyy: director photo + text row */
body.term-kamennyy-kover .elementor-5764 .elementor-element-e7aa545 > .e-con-inner {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 24px !important;
}
body.term-kamennyy-kover .elementor-5764 .elementor-element-99395d8 {
  width: 29.2% !important;
  max-width: 29.2% !important;
  flex: 0 0 29.2% !important;
}
@media (max-width: 767px) {
  body.term-kamennyy-kover .elementor-5764 .elementor-element-e7aa545 > .e-con-inner {
    flex-direction: column !important;
  }
  body.term-kamennyy-kover .elementor-5764 .elementor-element-99395d8 {
    width: 100% !important;
    max-width: 100% !important;
    flex-basis: 100% !important;
  }
}

/* Decorative plaster: forms cards (must not depend on .chapter-page wrapper) */
body.term-dekorativnaya-pechatnaya-shtukaturka .catalog__product,
body.tax-product_cat .catalog__product {
  display: flex !important;
  gap: 25px !important;
  flex-wrap: wrap !important;
  justify-content: space-between !important;
}
body.term-dekorativnaya-pechatnaya-shtukaturka .catalog__product-card,
body.term-dekorativnaya-pechatnaya-shtukaturka a.catalog__product-card,
body.tax-product_cat .catalog__product-card,
body.tax-product_cat a.catalog__product-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 26px !important;
  width: 255px !important;
  max-width: 100% !important;
  text-decoration: none !important;
  color: inherit !important;
  box-sizing: border-box !important;
  /* Match white cards in .dmk-woo-materials above */
  background: #fff !important;
  border-radius: 10px !important;
  padding: 20px 16px 28px !important;
  text-align: center !important;
  box-shadow: none !important;
  border: 0 !important;
}
body.term-dekorativnaya-pechatnaya-shtukaturka .catalog__product-card img,
body.term-dekorativnaya-pechatnaya-shtukaturka a.catalog__product-card img,
body.tax-product_cat .catalog__product-card img,
body.tax-product_cat a.catalog__product-card img {
  width: 100% !important;
  height: 248px !important;
  object-fit: cover !important;
  border-radius: 50% !important;
}
body.term-dekorativnaya-pechatnaya-shtukaturka .catalog__product-card p,
body.term-dekorativnaya-pechatnaya-shtukaturka a.catalog__product-card p,
body.tax-product_cat .catalog__product-card p,
body.tax-product_cat a.catalog__product-card p {
  margin: 0 !important;
  font-size: 20px !important;
  line-height: 1.15 !important;
  text-align: center !important;
  padding: 0 4px !important;
}
body.term-dekorativnaya-pechatnaya-shtukaturka .catalog__product-card .btn,
body.term-dekorativnaya-pechatnaya-shtukaturka a.catalog__product-card .btn,
body.tax-product_cat .catalog__product-card .btn,
body.tax-product_cat a.catalog__product-card .btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 13px 30px 11px 30px !important;
  border: 1px solid #5F5C53 !important;
  border-radius: 3px !important;
  background: rgba(249, 247, 243, 0.48) !important;
  box-sizing: border-box !important;
  font-size: 12px !important;
  line-height: 12px !important;
  text-transform: uppercase !important;
  color: #2C2C2C !important;
}
@media (max-width: 1024px) {
  body.term-dekorativnaya-pechatnaya-shtukaturka .catalog__product,
  body.tax-product_cat .catalog__product {
    justify-content: center !important;
  }
}
@media (max-width: 767px) {
  body.term-dekorativnaya-pechatnaya-shtukaturka .catalog__product-card,
  body.term-dekorativnaya-pechatnaya-shtukaturka a.catalog__product-card,
  body.tax-product_cat .catalog__product-card,
  body.tax-product_cat a.catalog__product-card {
    width: calc(50% - 13px) !important;
    max-width: 255px !important;
  }
  body.term-dekorativnaya-pechatnaya-shtukaturka .catalog__product-card img,
  body.term-dekorativnaya-pechatnaya-shtukaturka a.catalog__product-card img,
  body.tax-product_cat .catalog__product-card img,
  body.tax-product_cat a.catalog__product-card img {
    height: 180px !important;
  }
  body.term-dekorativnaya-pechatnaya-shtukaturka .catalog__product-card p,
  body.term-dekorativnaya-pechatnaya-shtukaturka a.catalog__product-card p,
  body.tax-product_cat .catalog__product-card p,
  body.tax-product_cat a.catalog__product-card p {
    font-size: 16px !important;
  }
}

/* Category archives: ensure e-gallery tiles have a visible image even before JS grid init */
body.tax-product_cat .e-gallery-image[data-thumbnail] {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  min-height: 160px;
}
body.tax-product_cat .elementor-widget-gallery .elementor-gallery__container {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
body.tax-product_cat .elementor-widget-gallery .e-gallery-item {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
body.tax-product_cat .elementor-widget-gallery .e-gallery-image {
  width: 100%;
  height: 100%;
}
@media (max-width: 1024px) {
  body.tax-product_cat .elementor-widget-gallery .elementor-gallery__container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}
@media (max-width: 767px) {
  body.tax-product_cat .elementor-widget-gallery .elementor-gallery__container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

