/* Главный контейнер карточки товара (одна на всю ширину ряда) */
.tx-row {
  background-color: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--border-radius);
  padding: 24px;
  margin-bottom: 25px;
  font-family: var(--font-main);
  box-sizing: border-box;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  width:100%;
}

.tx-row:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

/* Основной горизонтальный блок */
.tx-main {
  display: flex;
  gap: 30px;
}

/* ================= ЛЕВАЯ СТОРОНА (Визуал) ================= */
/* Левая часть: теперь элементы идут вертикально (картинка сверху, описание снизу) */
.tx-visual {
  flex: 0 0 30%; /* Слегка корректируем ширину левой части под вертикальный контент */
  display: flex;
  flex-direction: column; /* Элементы встают друг под друга */
  gap: 15px; /* Отступ между картинкой и описанием */
  align-items: center; /* Центрируем контент по горизонтали */
  position: relative;
}

/* Фотография товара сверху */
.tx-img {
  width: 100%;
  max-width: 260px; /* Ограничиваем максимальный размер картинки для баланса */
  height: 200px; /* Одинаковая фиксированная высота области фотографии */
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fafafa;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.tx-img img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

/* Краткое описание под картинкой */
.tx-desc-small {
  width: 100%;
  text-align: left; /* Описание выравниваем по левому краю (или по центру через center) */
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.tx-desc-small p {
  margin: 0;
}

/* Корректируем правую сторону (параметры), чтобы они занимали оставшееся место */
.tx-panel {
  flex: 1; /* Занимает всю правую сторону */
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-left: 1px solid #f0f0f0;
  padding-left: 30px;
}

/* ================= АДАПТИВНОСТЬ НА МОБИЛЬНЫХ ================= */
@media (max-width: 992px) {
  .tx-panel {
    border-left: none;
    padding-left: 0;
  }
}

/* Ссылка-заголовок */
.tx-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  text-decoration: none;
  line-height: 1.3;
  transition: color 0.2s ease;
}

.tx-title:hover {
  color: var(--primary-color);
}

/* Блок цены */
.tx-price-block {
  font-size: 15px;
  color: var(--text-muted);
  display: flex;
  align-items: baseline;
}

.tx-price-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  margin-left: 8px;
}

/* Сетка для выпадающих списков селектора */
.tx-inputs-area {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* Поля выбора выстраиваются по 2 в ряд */
  gap: 15px;
  background-color: #fcfcfc;
  padding: 15px;
  border: 1px solid #f0f0f0;
  border-radius: var(--border-radius);
}

/* Одиночное поле выбора (Группа: Метка + Выпадающий список) */
.tx-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Поле количества растягивается на всю ширину сетки параметров */
.tx-field-full {
  grid-column: span 2;
}

.tx-label, .cr-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Стилизация выпадающих списков select и инпута количества */
.tx-field select,
.cr-input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-dark);
  background-color: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--border-radius);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.tx-field select:focus,
.cr-input:focus {
  border-color: var(--primary-color);
}

/* Блок кнопок внизу */
.tx-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
}

/* Кнопка "Подробнее" */
.tx-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
}

.tx-more-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

/* Класс-активатор для развернутой стрелочки */
.tx-more-btn.active svg {
  transform: rotate(180deg);
}

/* Кнопка добавления заказа */
.tx-buy {
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.tx-buy:hover {
  background-color: var(--secondary-bg);
}

/* ================= СКРЫТЫЙ БЛОК ОПИСАНИЯ ================= */
.tx-hidden-text {
  max-height: 0; /* Изначально блок свернут по высоте */
  overflow: hidden;
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out, margin-top 0.3s ease;
  opacity: 0;
  border-top: 1px solid transparent;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Класс-активатор для отображения большого описания (добавляется через JS) */
.tx-hidden-text.open {
  max-height: 1000px; /* Достаточная высота для плавного раскрытия */
  opacity: 1;
  margin-top: 20px;
  padding-top: 20px;
  border-top-color: #eee;
}

/* ================= АДАПТИВНОСТЬ НА МОБИЛЬНЫХ ================= */
@media (max-width: 992px) {
  .tx-main {
    flex-direction: column;
    gap: 20px;
  }
  .tx-visual, .tx-panel {
    flex: none;
    width: 100%;
  }
  .tx-panel {
    border-left: none;
    padding-left: 0;
  }
}

@media (max-width: 576px) {
  .tx-visual {
    flex-direction: column;
    align-items: center;
  }
  .tx-img {
    width: 100%;
    flex: none;
  }
  .tx-inputs-area {
    grid-template-columns: 1fr; /* Поля выбора выстраиваются в один ряд */
  }
  .tx-field-full {
    grid-column: span 1;
  }
  .tx-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .tx-buy {
    width: 100%;
    text-align: center;
  }
}