/* ============================================
   ERGO ADMIN DETAIL — Isolated styles
   All selectors prefixed with .catalog-detail--ergo-admin or .ergo-*
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* === Layout === */
.catalog-detail--ergo-admin {
  gap: 20px;
}


.catalog-detail--ergo-admin .catalog-detail__main {
  flex-basis: 556px;
  max-width: 556px;
  width: 556px;
  flex-grow: 0;
  flex-shrink: 0;
}

/* Gallery — only set width, let Aspro handle layout */
.catalog-detail--ergo-admin .detail-gallery-big {
  width: 556px !important;
  min-width: 556px !important;
  flex-shrink: 0;
}

/* Custom favorite button */
.ergo-fav-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #8c102a;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.ergo-fav-btn svg {
  overflow: visible !important;
}
.ergo-fav-btn:hover {
  border-color: #8c102a;
}
.ergo-fav-btn.active {
  border-color: #8c102a !important;
  background: #ffffff !important;
}
.ergo-fav-btn.active .ergo-fav-path {
  fill: #8c102a !important;
  stroke: #8c102a !important;
}
.ergo-fav-btn.active:hover {
  border-color: #8c102a !important;
  background: #ffffff !important;
}

/* === Ergo Product Detail Container === */
.ergo-product-detail {
  display: flex;
  flex-direction: column;
  gap: 32px;
  font-family: 'Inter', sans-serif;
}

/* === H1 === */
.ergo-product-detail__title {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 120%;
  color: #222222;
  margin: 0;
  padding: 0;
}

/* === Info Line === */
.ergo-info-line {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: -24px;
}

.ergo-info-line__article {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 120%;
  color: #999999;
}

.ergo-info-line__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0CBC3D;
  flex-shrink: 0;
}

.ergo-info-line__stock {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 120%;
  color: #0CBC3D;
}

.ergo-info-line__catalog {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 120%;
  color: #999999;
  margin-left: 24px;
}

/* === Size Table === */
.ergo-size-table {
  background: #FFFFFF;
  box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}

.ergo-size-table__row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.ergo-size-table__row--header {
  /* header */
}

.ergo-size-table__row--data {
  /* data rows */
}

.ergo-size-table__row--footer .ergo-size-table__cell {
  color: #0CBC3D;
  font-weight: 600;
}

.ergo-size-table__cell {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 120%;
  color: #222222;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0;
  box-sizing: border-box;
}

/* Column: Sizes */
.ergo-size-table__cell--sizes {
  width: 111px;
  min-width: 111px;
  background: #F8F8F8 !important;
  flex-direction: row;
  justify-content: space-between;
  padding: 0 16px;
  gap: 4px;
}

.ergo-size-table__row--header .ergo-size-table__cell--sizes,
.ergo-size-table__row--footer .ergo-size-table__cell--sizes {
  justify-content: flex-start;
}

/* Column: Color */
.ergo-size-table__cell--color {
  flex: 1.5;
  background: #F8F8F8 !important;
  padding: 0 12px;
  justify-content: center;
  text-align: center;
}

.ergo-size-table__color-name {
  font-size: 12px;
  font-weight: 600;
  color: #222222;
}

/* Remaining columns: flex equally */
.ergo-size-table__cell--stock,
.ergo-size-table__cell--msk,
.ergo-size-table__cell--vld {
  flex: 1;
}

.ergo-size-table__cell--qty {
  flex: 1;
  background: #F8F8F8;
}

.ergo-size-table__cell--total {
  flex: 1;
  background: #F8F8F8;
}

/* Row heights / vertical spacing */
.ergo-size-table__row--header .ergo-size-table__cell {
  padding-top: 20px;
  padding-bottom: 24px;
}

.ergo-size-table__row--data .ergo-size-table__cell {
  min-height: 14px;
  margin-top: 0;
  margin-bottom: 0;
}

/* Vertical gap between rows via padding on columns */
.ergo-size-table__row--data {
  padding: 10px 0;
}

.ergo-size-table__row--footer .ergo-size-table__cell {
  padding-top: 24px;
  padding-bottom: 20px;
}

/* Size name + price */
.ergo-size-table__size-name {
  font-size: 12px;
  font-weight: 600;
  color: #222222;
}

.ergo-size-table__size-price {
  font-size: 10px;
  font-weight: 600;
  color: #999999;
  flex-shrink: 0;
}

/* Values in stock/msk columns */
.ergo-size-table__value {
  font-size: 12px;
  font-weight: 600;
  color: #999999;
}

/* Footer totals */
.ergo-size-table__footer-stock,
.ergo-size-table__footer-msk {
  font-size: 12px;
  font-weight: 600;
  color: #222222;
}

.ergo-size-table__footer-qty {
  font-size: 12px;
  font-weight: 600;
  color: #0CBC3D;
}

.ergo-size-table__footer-sum {
  font-size: 12px;
  font-weight: 600;
  color: #0CBC3D;
}

/* Row sum */
.ergo-size-table__row-sum {
  font-size: 12px;
  font-weight: 600;
  color: #999999;
}

.ergo-size-table__row-sum--active {
  color: #222222;
  font-weight: 700;
}

/* === Quantity Controls === */
.ergo-qty__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #999999;
  padding: 0;
  line-height: 1;
  user-select: none;
}

.ergo-qty__btn:hover {
  color: #222222;
}

.ergo-qty__btn--disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.ergo-qty__input {
  width: 40px;
  height: 14px;
  border: none;
  background: transparent;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #999999;
  padding: 0;
  -moz-appearance: textfield;
  outline: none;
}

.ergo-qty__input::-webkit-outer-spin-button,
.ergo-qty__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ergo-qty__input--active {
  color: #222222;
}

/* === Action Buttons === */
.ergo-actions {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: -12px;
}

.ergo-actions__left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.ergo-btn-cart {
  width: 181px;
  height: 44px;
  background: #8C102A;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.ergo-btn-cart:hover {
  opacity: 0.9;
}

.ergo-btn-cart--disabled {
  opacity: 0.5;
  cursor: default;
}

.ergo-btn-cart.loadings {
  position: relative;
  pointer-events: none;
}

.ergo-btn-cart.loadings span {
  visibility: hidden;
}

.ergo-btn-cart.loadings::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ergo-spin 0.6s linear infinite;
  top: 50%;
  left: 50%;
  margin: -10px 0 0 -10px;
}

@keyframes ergo-spin {
  to { transform: rotate(360deg); }
}

.ergo-btn-nanesenie {
  width: 118px;
  height: 44px;
  background: #FFFFFF;
  border: 1.5px solid #8C102A;
  color: #8C102A;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.ergo-btn-nanesenie:hover {
  background: #fdf0f3;
}

.ergo-btn-favorite {
  width: 44px;
  height: 44px;
  border: 0px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ergo-btn-favorite .item-action {
  margin: 0;
  padding: 0;
}

.ergo-btn-favorite .item-action__inner {
  margin: 0;
  padding: 0;
}

.ergo-actions__total-block {
  min-width: 179px;
  height: 44px;
  background: #FFFFFF;
  box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
}

.ergo-actions__total-sum {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #222222;
  white-space: nowrap;
}

/* === Accordions === */
.ergo-accordions {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ergo-accordion {
  border-bottom: 1px solid #F0F0F0;
}

.ergo-accordion:last-child {
  border-bottom: none;
}

.ergo-accordion__header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  cursor: pointer;
  user-select: none;
}

.ergo-accordion__title {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 120%;
  color: #222222;
}

.ergo-accordion__icon {
  display: flex;
  align-items: center;
  transition: transform 0.3s ease;
}

.ergo-accordion--open .ergo-accordion__icon {
  transform: rotate(180deg);
}

.ergo-accordion__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.ergo-accordion--open .ergo-accordion__body {
  max-height: 2000px;
}

/* Characteristics */
.ergo-chars {
  padding: 0 0 16px 0;
}

.ergo-chars__row {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 4px;
  padding: 4px 0;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  line-height: 130%;
}

.ergo-chars__name {
  color: #999999;
  white-space: nowrap;
  flex-shrink: 0;
}

.ergo-chars__dots {
  flex: 1;
  border-bottom: 1px dotted #CCCCCC;
  min-width: 20px;
  align-self: baseline;
  margin-bottom: 3px;
}

.ergo-chars__value {
  color: #222222;
  text-align: right;
  flex-shrink: 0;
  max-width: 60%;
}

/* Description */
.ergo-desc {
  padding: 0 0 16px 0;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 150%;
  color: #222222;
  overflow-x: auto;
}

.ergo-desc table {
  max-width: 100%;
  overflow-x: auto;
  display: block;
}

/* Nanesenie pills */
.ergo-nanesenie-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 16px 0;
}

.ergo-nanesenie-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid #0CBC3D;
  color: #0CBC3D;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 120%;
  white-space: nowrap;
}

/* === Hide standard blocks in ergo mode === */
.catalog-detail--ergo-admin .catalog-detail__main-parts {
  display: none;
}

/* Keep only ergo-product-detail visible */
.catalog-detail--ergo-admin .catalog-detail__main {
  padding: 0;
}

/* ============================================
   MOBILE (max-width: 767px)
   ============================================ */
@media (max-width: 767px) {
  .catalog-detail--ergo-admin {
    flex-direction: column;
    gap: 0;
  }

  .catalog-detail--ergo-admin .detail-gallery-big {
    width: 100%;
    min-width: auto;
  }

  .catalog-detail--ergo-admin .catalog-detail__main {
    flex-basis: auto;
    max-width: 100%;
    width: 100%;
    padding: 16px 0 0 0;
  }

  .ergo-product-detail {
    gap: 20px;
    max-width: 100%;
  }

  .ergo-product-detail__title {
    font-size: 20px;
  }

  .ergo-info-line {
    margin-top: -12px;
    gap: 4px;
  }

  .ergo-info-line__catalog {
    margin-left: 0;
  }

  /* Table mobile */
  .ergo-size-table__cell--sizes {
    width: 77px;
    min-width: 77px;
    padding: 0 8px;
  }

  .ergo-size-table__cell {
    font-size: 10px;
  }

  .ergo-size-table__size-name {
    font-size: 10px;
  }

  .ergo-size-table__size-price {
    font-size: 8px;
  }

  .ergo-size-table__row--data {
    padding: 8px 0;
  }

  .ergo-size-table__row--header .ergo-size-table__cell {
    padding-top: 12px;
    padding-bottom: 16px;
  }

  .ergo-size-table__row--footer .ergo-size-table__cell {
    padding-top: 16px;
    padding-bottom: 12px;
  }

  .ergo-qty__input {
    width: 28px;
    font-size: 10px;
  }

  .ergo-qty__btn {
    font-size: 10px;
    width: 12px;
    height: 12px;
  }

  /* Buttons mobile */
  .ergo-actions {
    flex-direction: column;
    gap: 12px;
    margin-top: 0;
  }

  .ergo-actions__left {
    width: 100%;
    order: 1;
  }

  .ergo-btn-nanesenie {
    flex: 1;
    width: auto;
  }

  .ergo-btn-cart {
    width: 100%;
    order: 3;
  }

  .ergo-actions__total-block {
    width: 100%;
    min-width: auto;
    order: 2;
    justify-content: flex-end;
  }

  .ergo-actions__total-sum {
    font-size: 18px;
  }

  .ergo-btn-favorite {
    flex-shrink: 0;
  }

  /* Accordion mobile */
  .ergo-accordion__title {
    font-size: 13px;
  }

  .ergo-accordion__header {
    padding: 12px 0;
  }

  /* Gallery thumbs mobile */
  .catalog-detail--ergo-admin .gallery__item--thumb {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .catalog-detail--ergo-admin .gallery-slider-thumb__container {
    gap: 4px;
  }
}
