/*NOTE: This file is intended for programmers. Aspro technical support is not advised to work with him.*/

/* ============================================================
   АДАПТИВНАЯ ВЁРСТКА КАРТОЧКИ ТОВАРА (ТЗ)
   ≥ 1200px  — сетка фото ~26% | контент (как lvtec; см. блок ниже)
   1000–1199px — 3 колонки: фото | характеристики | цены
   750–999px  — 2 колонки: фото 30% | характеристики 70%, цены снизу
   < 750px   — 1 колонка: фото → характеристики → цены
   ============================================================ */

/* --- 3 колонки: 1000px–1199px --- */
@media (min-width: 1000px) and (max-width: 1199px) {

  /* Внешний контейнер — строка */
  body .detail .catalog-detail {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
  }

  body .detail .catalog-detail > .catalog-detail__item {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 0 20px !important;
    width: 100% !important;
  }

  /* Колонка 1: фото (~27%) */
  body .detail .catalog-detail .catalog-detail__top-info {
    flex: 0 0 27% !important;
    max-width: 27% !important;
    width: 27% !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
  }

  body .detail .catalog-detail .detail-gallery-big {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  /* Колонки 2+3: основной контент (~73%) */
  body .detail .catalog-detail .catalog-detail__main {
    flex: 0 0 calc(73% - 20px) !important;
    max-width: calc(73% - 20px) !important;
    width: calc(73% - 20px) !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    box-sizing: border-box !important;
  }

  /* Колонка 2 (хар-ки) и колонка 3 (цены) рядом */
  body .detail .catalog-detail .catalog-detail__main-parts {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0 20px !important;
    margin-top: 0 !important;
    align-items: flex-start !important;
  }

  body .detail .catalog-detail .catalog-detail__main-part--left {
    flex: 0 0 55% !important;
    max-width: 55% !important;
    width: 55% !important;
  }

  body .detail .catalog-detail .catalog-detail__main-part--right {
    flex: 1 1 auto !important;
    max-width: calc(45% - 20px) !important;
    min-width: 0 !important;
  }

  body .detail #main .sticky-block {
    position: relative !important;
    top: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
  }

  body .detail .catalog-detail .catalog-detail__layout-stores {
    flex: 0 0 100% !important;
    width: 100% !important;
    margin-top: 24px !important;
  }
}

/* --- 2 колонки: 750px–999px (фото 30% | хар-ки 70%, цены снизу) --- */
@media (min-width: 750px) and (max-width: 999px) {

  body .detail .catalog-detail {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
  }

  body .detail .catalog-detail > .catalog-detail__item {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 0 16px !important;
    width: 100% !important;
  }

  /* Колонка 1: фото (30%) */
  body .detail .catalog-detail .catalog-detail__top-info {
    flex: 0 0 30% !important;
    max-width: 30% !important;
    width: 30% !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
  }

  body .detail .catalog-detail .detail-gallery-big {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  /* Колонка 2: характеристики (70%) */
  body .detail .catalog-detail .catalog-detail__main {
    flex: 0 0 calc(70% - 16px) !important;
    max-width: calc(70% - 16px) !important;
    width: calc(70% - 16px) !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    box-sizing: border-box !important;
  }

  /* main-parts — стопка вертикально */
  body .detail .catalog-detail .catalog-detail__main-parts {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: wrap !important;
    margin-top: 0 !important;
  }

  body .detail .catalog-detail .catalog-detail__main-part--left,
  body .detail .catalog-detail .catalog-detail__main-part--right {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  body .detail #main .sticky-block {
    position: relative !important;
    top: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
  }

  /* Цены-склады: 100% ширины, снизу */
  body .detail .catalog-detail .catalog-detail__layout-stores {
    flex: 0 0 100% !important;
    width: 100% !important;
    margin-top: 20px !important;
  }
}

/* --- Десктоп ≥1200px: колонка фото уже --- */
@media (min-width: 1200px) {

  body .detail .catalog-detail > .catalog-detail__item > .catalog-detail__top-info {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: minmax(200px, 26%) 1fr !important;
    gap: 0 32px !important;
    align-items: start !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex-direction: unset !important;
  }

  body .detail .catalog-detail .catalog-detail__top-info > .detail-gallery-big {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body .detail .catalog-detail .catalog-detail__top-info > .catalog-detail__main {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    flex-basis: auto !important;
  }
}

/* Липкая галерея слева (как #main .sticky-block) */
@media (min-width: 750px) {
  body#main.detail .catalog-detail .catalog-detail__top-info > .detail-gallery-big {
    position: -webkit-sticky;
    position: sticky;
    top: 32px;
    z-index: 4;
    align-self: start;
  }

  body#main.fixed_y.detail .catalog-detail .catalog-detail__top-info > .detail-gallery-big {
    top: 112px;
  }
}

/* --- 1 колонка: < 750px (фото → хар-ки → цены) --- */
@media (max-width: 749px) {

  body .detail .catalog-detail > .catalog-detail__item {
    display: flex !important;
    flex-direction: column !important;
  }

  body .detail .catalog-detail .catalog-detail__top-info,
  body .detail .catalog-detail .catalog-detail__main {
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body .detail .catalog-detail .catalog-detail__main-parts {
    display: flex !important;
    flex-direction: column !important;
  }

  body .detail .catalog-detail .catalog-detail__main-part--left,
  body .detail .catalog-detail .catalog-detail__main-part--right {
    max-width: 100% !important;
    width: 100% !important;
  }

  body .detail .catalog-detail .catalog-detail__layout-stores {
    width: 100% !important;
    margin-top: 16px !important;
  }
}
