/* ARIAN v13 — Products page responsive overhaul
 * Loaded only on page-templates/products.php.
 * Desktop >= 1101px remains unchanged.
 */

@media (max-width: 1100px) {
  .c-section--products,
  .c-section--products .c-page,
  .c-section--products .c-products,
  #products-structure,
  #products-usage,
  #products-raw-materials {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: clip;
  }

  .c-section--products .o-section__wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 20px;
    padding-right: 20px;
  }

  .c-section--products .c-products-desc {
    padding: 16px 0 30px;
  }

  .c-section--products .c-products-desc p {
    margin: 0;
    font-size: 14px !important;
    line-height: 2 !important;
    text-align: justify !important;
  }

  #products-structure {
    padding: 36px 0 42px;
    background: #fbfbfb;
  }

  #products-structure > .title,
  #products-usage .c-products-usage-content > .title,
  #products-raw-materials .c-products-usage-content > .title {
    justify-content: center !important;
    width: fit-content !important;
    max-width: calc(100% - 32px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
    line-height: 1.7 !important;
  }

  #products-structure .c-products-tabs {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 28px !important;
  }

  #products-structure .tabs-content {
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: auto !important;
    padding-top: 0 !important;
  }

  #products-structure .tabs {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px 16px !important;
    width: 100% !important;
    height: auto !important;
    padding: 0 !important;
  }

  #products-structure .tabs .tab,
  #products-structure .tabs .tab:nth-child(n) {
    display: flex !important;
    width: 100% !important;
    margin: 0 !important;
    transform: none !important;
    justify-content: center !important;
  }

  #products-structure .tab .home-services__item {
    width: min(100%, 190px) !important;
    min-width: 0 !important;
    height: auto !important;
    aspect-ratio: 305 / 336 !important;
    margin: 0 auto !important;
    background-size: 100% 100% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
  }

  #products-structure .home-services__item > div {
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box !important;
    justify-content: center !important;
    gap: 7px !important;
    padding: 20px 12px 24px !important;
  }

  #products-structure .home-services__item > div::before {
    top: -8px !important;
    right: -8px !important;
    bottom: -8px !important;
    left: -8px !important;
    background-size: 100% 100% !important;
  }

  #products-structure .tabs .tab img {
    display: block !important;
    width: 92px !important;
    height: 82px !important;
    max-width: 70% !important;
    margin: 0 auto !important;
    object-fit: contain !important;
  }

  #products-structure .tabs .tab h2 {
    position: relative !important;
    width: auto !important;
    max-width: 90% !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 0 0 10px !important;
    font-size: 12px !important;
    line-height: 1.55 !important;
    text-align: center !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  #products-structure .panes {
    width: 100% !important;
  }

  #products-structure .pane {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 20px !important;
    border-radius: 12px !important;
    gap: 10px !important;
  }

  #products-structure .pane h2 {
    margin: 0 0 7px !important;
    font-size: 15px !important;
    line-height: 1.8 !important;
  }

  #products-structure .pane p,
  #products-structure .pane li {
    font-size: 13.5px !important;
    line-height: 2 !important;
  }

  #products-usage,
  #products-raw-materials {
    box-sizing: border-box !important;
    padding: 42px 0 50px !important;
  }

  #products-raw-materials {
    background: rgb(251, 251, 251) !important;
  }

  #products-usage .c-products-usage-content > ul,
  #products-raw-materials .c-products-usage-content > ul {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: start !important;
    justify-content: center !important;
    gap: 22px 16px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #products-usage .home-services__item,
  #products-raw-materials .home-services__item {
    flex: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 220px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 305 / 336 !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    background-size: 100% 100% !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
  }

  #products-usage .home-services__item > a,
  #products-raw-materials .home-services__item > a {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 20px 14px 25px !important;
    overflow: hidden !important;
  }

  #products-usage .home-services__item h2,
  #products-raw-materials .home-services__item h2,
  #products-structure .home-services__item h2 {
    position: relative !important;
    display: block !important;
    width: auto !important;
    max-width: 92% !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 0 0 11px !important;
    text-align: center !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  #products-usage .home-services__item h2::before,
  #products-raw-materials .home-services__item h2::before,
  #products-structure .home-services__item h2::before {
    content: none !important;
    display: none !important;
  }

  #products-usage .home-services__item h2::after,
  #products-raw-materials .home-services__item h2::after,
  #products-structure .home-services__item h2::after {
    content: "" !important;
    position: absolute !important;
    left: 50% !important;
    right: auto !important;
    bottom: 0 !important;
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 2px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 2px !important;
    background: #FFD400 !important;
    transform: translateX(-50%) !important;
    box-shadow: none !important;
  }
}

@media (max-width: 767px) {
  .c-section--products .o-section__wrapper {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  .c-section--products .c-page__main {
    padding-top: 6px;
  }

  .c-section--products .c-page__main .title {
    margin-top: 16px !important;
    margin-bottom: 10px !important;
    font-size: 18px !important;
    line-height: 1.7 !important;
  }

  .c-section--products .c-products-desc {
    padding: 8px 0 26px !important;
  }

  .c-section--products .c-products-desc p {
    font-size: 13px !important;
    line-height: 2.08 !important;
  }

  #products-structure {
    padding: 30px 0 34px !important;
  }

  #products-structure > .title,
  #products-usage .c-products-usage-content > .title,
  #products-raw-materials .c-products-usage-content > .title {
    max-width: calc(100% - 24px) !important;
    margin-top: 0 !important;
    margin-bottom: 24px !important;
    padding: 0 !important;
    font-size: 15px !important;
    line-height: 1.7 !important;
  }

  #products-structure .c-products-tabs {
    gap: 22px !important;
  }

  #products-structure .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px 10px !important;
  }

  #products-structure .tab .home-services__item {
    width: min(100%, 164px) !important;
  }

  #products-structure .home-services__item > div {
    padding: 15px 8px 20px !important;
    gap: 5px !important;
  }

  #products-structure .home-services__item > div::before {
    top: -6px !important;
    right: -6px !important;
    bottom: -6px !important;
    left: -6px !important;
  }

  #products-structure .tabs .tab img {
    width: 82px !important;
    height: 72px !important;
    max-width: 68% !important;
    filter: none !important;
  }

  #products-structure .tabs .tab h2 {
    max-width: 92% !important;
    padding-bottom: 9px !important;
    font-size: 11.5px !important;
    line-height: 1.5 !important;
  }

  #products-structure .pane {
    padding: 17px !important;
    border-radius: 10px !important;
  }

  #products-structure .pane h2 {
    font-size: 14px !important;
    line-height: 1.75 !important;
  }

  #products-structure .pane p,
  #products-structure .pane li {
    font-size: 12.5px !important;
    line-height: 2 !important;
  }

  #products-usage,
  #products-raw-materials {
    margin-top: 0 !important;
    padding: 34px 0 42px !important;
  }

  #products-usage .c-products-usage-content > ul,
  #products-raw-materials .c-products-usage-content > ul {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px 9px !important;
  }

  #products-usage .home-services__item,
  #products-raw-materials .home-services__item {
    width: 100% !important;
    max-width: 166px !important;
    height: auto !important;
    aspect-ratio: 305 / 336 !important;
  }

  #products-usage .home-services__item > a,
  #products-raw-materials .home-services__item > a {
    padding: 15px 8px 21px !important;
    gap: 4px !important;
  }

  /* Touch layouts: keep only the primary image. */
  #products-usage .home-services__item .on-hover,
  #products-raw-materials .home-services__item .on-hover {
    display: none !important;
  }

  #products-usage .home-services__item .df-img {
    display: block !important;
    position: static !important;
    width: 86px !important;
    height: 76px !important;
    max-width: 70% !important;
    max-height: 76px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    object-fit: contain !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  #products-raw-materials .apm-raw-media {
    position: relative !important;
    display: block !important;
    flex: 0 0 84px !important;
    width: 128px !important;
    height: 84px !important;
    max-width: 80% !important;
    margin: 0 auto !important;
    overflow: visible !important;
  }

  #products-raw-materials .apm-raw-media .df-img {
    display: block !important;
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    object-fit: contain !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  #products-usage .home-services__item h2,
  #products-raw-materials .home-services__item h2 {
    max-width: 94% !important;
    padding-bottom: 9px !important;
    font-size: 11.5px !important;
    line-height: 1.5 !important;
  }

  #products-usage .home-services__item h2::after,
  #products-raw-materials .home-services__item h2::after,
  #products-structure .home-services__item h2::after {
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    height: 2px !important;
  }

  footer {
    margin-top: 34px !important;
  }
}

@media (max-width: 420px) {
  .c-section--products .o-section__wrapper {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  #products-structure .tabs,
  #products-usage .c-products-usage-content > ul,
  #products-raw-materials .c-products-usage-content > ul {
    column-gap: 8px !important;
  }

  #products-structure .tab .home-services__item,
  #products-usage .home-services__item,
  #products-raw-materials .home-services__item {
    max-width: 160px !important;
  }
}
