/* Компоненты: кнопки, карточки, модальные окна, формы, фильтры. */

/* --- Кнопки --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition),
    color var(--transition), border-color var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--c-red);
  color: #fff;
}

.btn--primary:hover {
  background: var(--c-red-700);
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-ink);
}

.btn--outline:hover {
  background: var(--c-ink);
  color: #fff;
}

.btn--ghost {
  background: var(--c-surface-2);
  color: var(--c-ink);
}

.btn--ghost:hover {
  background: var(--c-line);
}

.btn--block {
  width: 100%;
}

/* --- Карточка категории --- */
.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--c-ink);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.category-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.82));
}

.category-card:hover img {
  transform: scale(1.05);
  opacity: 0.7;
}

.category-card__body {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 20px;
}

.category-card__title {
  color: #fff;
  font-size: var(--fs-h3);
  margin-bottom: 6px;
}

.category-card__meta {
  font-size: var(--fs-xs);
  color: #e2e2e2;
}

/* --- Карточка товара --- */
.product-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

.product-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.product-card__media {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  background: var(--c-surface-2);
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  flex: 1;
}

.product-card__cat {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-red);
}

.product-card__title {
  font-size: 17px;
  margin: 0;
}

.product-card__price {
  margin-top: auto;
  font-size: 20px;
  font-weight: 700;
  color: var(--c-ink);
}

.product-card__cta {
  margin-top: 10px;
}

/* --- Преимущества --- */
.feature {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
}

.feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--c-red-050);
  color: var(--c-red);
  font-size: 22px;
}

.feature h3 {
  margin-bottom: 6px;
}

.feature p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--c-muted);
}

/* --- Крупный информационный блок (обучение/тренинги) --- */
.info-card {
  padding: clamp(24px, 4vw, 44px);
  border-radius: var(--radius);
  background: var(--c-ink);
  color: #e9e9ea;
  position: relative;
  overflow: hidden;
}

.info-card::before {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 260px;
  height: 260px;
  border: 40px solid rgba(185, 0, 0, 0.35);
  border-radius: 50%;
}

.info-card h2,
.info-card h3 {
  color: #fff;
  position: relative;
}

.info-card p,
.info-card ul {
  position: relative;
  color: #d2d2d5;
}

.info-card__list {
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 18px 0 26px;
}

.info-card__list li {
  padding-left: 26px;
  position: relative;
}

.info-card__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-red);
}

/* --- Фильтры каталога --- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.chip {
  padding: 9px 16px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--c-ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: all var(--transition);
}

.chip:hover {
  border-color: var(--c-ink);
}

.chip.is-active {
  background: var(--c-red);
  border-color: var(--c-red);
  color: #fff;
}

.search-field {
  width: 100%;
  max-width: 420px;
  margin-bottom: 24px;
  padding: 12px 16px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  font: inherit;
}

.catalog-count {
  color: var(--c-muted);
  font-size: var(--fs-sm);
  margin-bottom: 18px;
}

.catalog-empty {
  padding: 60px 0;
  text-align: center;
  color: var(--c-muted);
}

/* --- Хлебные крошки --- */
.breadcrumbs {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  margin: 24px 0;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.breadcrumbs a {
  color: var(--c-muted);
}

.breadcrumbs a:hover {
  color: var(--c-red);
}

/* --- Модальные окна --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.is-open {
  display: flex;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: clamp(22px, 4vw, 34px);
}

.modal__dialog--wide {
  max-width: 940px;
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: var(--c-surface-2);
  font-size: 20px;
  line-height: 1;
  color: var(--c-ink);
}

.modal__close:hover {
  background: var(--c-line);
}

/* --- Деталь товара --- */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.product-detail__gallery img {
  width: 100%;
  border-radius: var(--radius-sm);
  background: var(--c-surface-2);
  object-fit: contain;
  aspect-ratio: 4 / 3;
  padding: 10px;
}

.product-detail__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.product-detail__thumbs button {
  width: 64px;
  height: 64px;
  padding: 4px;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  background: #fff;
}

.product-detail__thumbs button.is-active {
  border-color: var(--c-red);
}

.product-detail__thumbs img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-detail__price {
  font-size: 28px;
  font-weight: 700;
  color: var(--c-ink);
  margin: 8px 0 16px;
}

.product-detail__desc {
  font-size: var(--fs-sm);
  color: var(--c-body);
}

.product-detail__desc b,
.product-detail__desc strong {
  color: var(--c-ink);
}

/* --- Форма --- */
.form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-ink);
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--c-surface-3);
}

.form-field textarea {
  min-height: 96px;
  resize: vertical;
}

.form-note {
  display: block;
  margin-top: 12px;
  font-size: var(--fs-xs);
  color: var(--c-muted);
}

.form-status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--c-red-050);
  color: var(--c-red-700);
  font-size: var(--fs-sm);
  display: none;
}

.form-status.is-visible {
  display: block;
}

@media (max-width: 680px) {
  .product-detail {
    grid-template-columns: 1fr;
  }
}
