/* ================= ROOT VARIABLES (если ещё не вынесены глобально) ================= */
:root {
  --blue: #0073c6;
  --blue-dark: #004080;

  --bg-main: #ffffff;
  --bg-soft: #eef4fb;

  --text-main: #1a1a1a;
  --text-secondary: #5c6b7a;

  --border: rgba(0,0,0,0.06);
}

/* ================= CARD ================= */
.equipment-card {
  position: relative;
  display: grid;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.equipment-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
}

/* ================= IMAGE ================= */
.equipment-image {
  background: linear-gradient(135deg,#eef4fb,#e3ecf7);
  padding: 15px;
  text-align: center;
  position: relative;
}

.equipment-image img {
  height: 120px;
  object-fit: contain;
  transition: transform 0.5s ease;
}

.equipment-card:hover .equipment-image img {
  transform: scale(1.12);
}



/* ================= BODY ================= */
.equipment-body {
  padding: 16px;
}

.equipment-title {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 10px;
  margin-bottom: 2px;
}

.divider {
  height: 1px;
  margin: 10px 0;
  background: linear-gradient(90deg, transparent, rgba(0,115,198,0.25), transparent);
}

.equipment-type {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.spec {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
}

.spec-label {
  color: var(--text-secondary);
}

.spec-value {
  font-weight: 600;
  color: var(--text-main);
}

/* ================= BADGES ================= */
.equipment-badges-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.badge-left .badge {
  padding: 2px 6px;
  border-radius: 6px;
  background: #f1f3f5;
  color: #555;
  border: 1px solid #e0e0e0;
  font-size: 11px;
}

.badge-right {
  display: flex;
  align-items: center;
}

.badge-right .badge {
  padding: 1px 4px;
  font-size: 11px;
  background: #f8f9fb;
  border: 1px solid #e5e7eb;
}

.badge-right .badge--gray {
  background: transparent;
  border: none;
  color: #888;
}
.badge.active {
  background: linear-gradient(135deg, #0073c6, #4da3ff);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 10px rgba(0,115,198,0.4);
}

/* ================= BASE BUTTON STYLE ================= */
.equipment-more-btn,
.compare-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: 700;
  text-transform: uppercase;

  font-size: 13px;
  text-decoration: none;

  border-radius: 12px;
  transition: all 0.25s ease;

  box-sizing: border-box;
}

/* ================= BUTTON: Подробнее (NORMAL) ================= */
.equipment-more-btn {
  margin: 12px 16px 16px;
  padding: 10px 14px;

  color: #e6edf5;
  background: linear-gradient(135deg, #0b1626, #13233a);
  border: 1px solid rgba(255,255,255,0.08);
}

.equipment-more-btn:hover {
  transform: translateY(-2px);
  color: #fff;
}

/* ================= COMPARE (NORMAL - ICON ONLY) ================= */
.compare-add-btn {
  position: absolute;
  top: 10px;
  right: 10px;

  width: 34px;
  height: 34px;

  padding: 0;

  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);

  cursor: pointer;
}

/* текст скрыт */
.compare-add-btn span {
  display: none;
}

/* ================= COMPACT LAYOUT ================= */

/* контейнер кнопок (ВАЖНО) */
.catalog-grid.compact .equipment-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

/* ОБЩИЙ ВИД КНОПОК В COMPACT */
.catalog-grid.compact .equipment-more-btn,
.catalog-grid.compact .compare-add-btn {
  flex: 1;

  margin: 0;
  padding: 6px 6px;

  height: 28px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;

  border-radius: 12px;

  color: #e6edf5;
  background: linear-gradient(135deg, #0b1626, #13233a);
  border: 1px solid rgba(255,255,255,0.08);

  box-sizing: border-box;
}

/* compare в compact становится кнопкой */
.catalog-grid.compact .compare-add-btn {
  position: static;
}

/* скрываем иконку */
.catalog-grid.compact .compare-add-btn img {
  display: none;
}

/* показываем текст */
.catalog-grid.compact .compare-add-btn span {
  display: inline;
}

/* ================= HOVER ================= */
.catalog-grid.compact .equipment-more-btn:hover,
.catalog-grid.compact .compare-add-btn:hover {
  transform: translateY(-2px);
  color: #fff;
}
/* ================= REMOVE BUTTON (COMPARE MODE) ================= */
.cmp-remove {
  position: absolute;
  top: 10px;
  right: 10px;

  width: 32px;
  height: 32px;

  border: none;
  border-radius: 8px;

  background: rgba(255,255,255,0.95);
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.cmp-remove:hover {
  background: #fff;
}
/* ===== HIDDEN DETAILS BLOCK ===== */
.hidden-details {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.08);

  display: none;              /* скрыто по умолчанию */
  flex-direction: column;
  gap: 6px;

  font-size: 13px;
}

/* показать блок */
.hidden-details.is-visible {
  display: flex;
}

/* ===== ROW ===== */
.hidden-details .hidden-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 5px 0;
  border-bottom: 1px solid #f1f1f1;
}

/* label */
.hidden-details .label {
  color: var(--text-secondary);
  font-weight: 500;
}

/* value */
.hidden-details .value {
  font-weight: 600;
  color: var(--text-main);
  text-align: right;
}

/* ===== анимация появления (опционально) ===== */
.hidden-details.is-visible {
  animation: hidden-fade-in 0.2s ease;
}

@keyframes hidden-fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.catalog-grid {
  display: grid;
  gap: 20px;
  justify-content: center;
}

/* ===== GRID MODES ===== */
.catalog-grid.normal {
  grid-template-columns: repeat(3, 270px);
}


.catalog-grid { 
  display: grid; 
  gap: 20px; 
  justify-content: center; 
}

/* ===== GRID MODES ===== */
.catalog-grid.normal {
  grid-template-columns: repeat(3, 270px);
}

.catalog-grid.compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* ===== CARD ===== */
.catalog-grid.compact .equipment-card {
  display: grid;
  grid-template-columns: 100px 1fr; /* ❗ убрали auto (это ломало ряд кнопок) */
  align-items: center;

  padding: 8px 10px;
  gap: 6px 10px;

  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);

  min-height: 64px;
}

/* ===== IMAGE BLOCK ===== */
.catalog-grid.compact .equipment-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding: 0;
  background: none;

  gap: 6px;
  position: relative;
}

.catalog-grid.compact .equipment-image img {
  height: 90px;
  max-width: 90px;
  object-fit: contain;
}

/* ===== BODY (ВАЖНО ДЛЯ КНОПОК) ===== */
.catalog-grid.compact .equipment-body {
  display: flex;
  flex-direction: column;
  padding: 2px 8px;
  gap: 0px;
}

/* ===== ACTIONS (НОВЫЙ КЛЮЧЕВОЙ БЛОК) ===== */
.catalog-grid.compact .equipment-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

/* ===== TITLE ===== */
.catalog-grid.compact .equipment-title {
  font-size: 13px;
  font-weight: 600;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  line-height: 1.1;
}

.catalog-grid.compact .divider {
  height: 1px;
  margin: 4px 0;   /* 🔥 было 10px → стало 4px */
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0,115,198,0.2),
    transparent
  );
}

/* ===== SPECS ===== */
.catalog-grid.compact .spec {
  font-size: 11px;
  border: none;
  padding: 0;
}



/* ================= MOBILE FINAL (CLEAN) ================= */
@media (max-width: 768px) {

  /* ===== GRID ===== */
  .catalog-grid.normal,
  .catalog-grid.compact {
    grid-template-columns: 1fr !important;
    gap: 12px;
    justify-content: stretch;
  }

  /* ===== CARD ===== */
  .equipment-card {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 10px;

    padding: 10px;
    border-radius: 14px;

    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    transition: none;
  }

  .equipment-card:hover {
    transform: none !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  }

  /* ===== IMAGE ===== */
  .equipment-image {
    padding: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .equipment-image img {
    height: 70px;
    max-width: 70px;
    object-fit: contain;
  }

  /* ===== BODY ===== */
  .equipment-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .equipment-title {
    font-size: 13px;
    line-height: 1.2;
    margin: 0;
  }

  .equipment-type {
    font-size: 12px;
  }

  /* ===== SPECS ===== */
  .spec {
    font-size: 12px;
    padding: 3px 0;
  }

  /* ===== BADGES ===== */
  .badge {
    font-size: 10px;
  }

  /* ===== HIDDEN DETAILS ===== */
  .hidden-details {
    font-size: 12px;
  }

  /* ===== ACTIONS ===== */
  .equipment-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
    width: 100%;
  }

  /* ===== BUTTON BASE ===== */
  .equipment-more-btn,
  .compare-add-btn {
    width: 100%;
    min-width: 100%;
    flex: 1 1 100%;

    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 10px 12px;
    margin: 0;

    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;

    border-radius: 12px;
    box-sizing: border-box;

    color: #e6edf5;
    background: linear-gradient(135deg, #0b1626, #13233a);
    border: 1px solid rgba(255,255,255,0.08);

    box-shadow: 0 4px 12px rgba(0,0,0,0.15);

    transition: all 0.25s ease;
  }

  /* tap effect */
  .equipment-more-btn:active,
  .compare-add-btn:active {
    transform: scale(0.98);
  }

  /* compare icon fix */
  .compare-add-btn img {
    display: none;
  }

  .compare-add-btn span {
    display: inline;
  }

  /* safety */
  .compare-add-btn {
    white-space: nowrap;
  }

  /* hide desktop toggle */
  .grid-toggle {
    display: none !important;
  }

  /* search fix */
  .catalog-search-wrapper {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  #stickyBtn {
    display: none !important;
  }
}