@import url(reset.css);
@import url("https://fonts.googleapis.com/css2?family=Montserrat+Alternates:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

:root {
  --main-bg: rgba(30, 32, 36, 0.8);
  --card-bg: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.11) 60%,
    rgba(255, 204, 102, 0.1) 100%
  );
  --card-blur: blur(16px);
  --card-radius: 2rem;
  --accent: #000000;
  --accent2: #ff5757;
  --text-main: #000;
  --text-muted: #000;
  --box-shadow: 0 4px 22px 0 rgba(0, 0, 0, 0.14), 0 0 18px 0 #ffecc064;
  --box-shadow-hover:
    0 7px 26px 0 rgba(255, 187, 82, 0.1), 0 0 24px 0 #ffecc052;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  font-family: "Montserrat Alternates", sans-serif;
  font-weight: 400;
  font-style: normal;
}

body {
  margin: 0;
  padding: 0;
  background: #f7f7f7;
}

.products-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.9rem; /* расстояние между карточками */
  justify-content: center; /* по центру экрана */
  align-items: flex-start; /* чтобы высота была по верхнему краю */
  margin: 0 auto;
  padding: 2rem 0;
}

/* Карточка */
.product-card {
  width: 310px;
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--box-shadow);
  backdrop-filter: var(--card-blur);
  color: var(--text-main);
  padding: 1.2rem 1rem 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition:
    box-shadow 0.5s cubic-bezier(0.34, 0.7, 0.45, 1.37),
    background 0.5s cubic-bezier(0.34, 0.7, 0.45, 1.37),
    transform 0.5s cubic-bezier(0.25, 0.83, 0.49, 1.22);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(80px) scale(0.97);
  animation: cardAppear 1.5s cubic-bezier(0.8, 1.87, 0.5, 1.5) forwards;
  animation-delay: 0.5s;
}

@keyframes cardAppear {
  0% {
    opacity: 0;
    transform: translateY(50px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Shine/перелив */
.product-card::before {
  content: "";
  position: absolute;
  top: -30px;
  left: -60px;
  width: 220px;
  height: 200px;
  background: radial-gradient(
    circle at 45% 30%,
    #fff6be40 0%,
    #ffbb5233 80%,
    transparent 100%
  );
  z-index: 0;
  pointer-events: none;
  filter: blur(17px);
  opacity: 0.68;
  animation: shine 1.8s infinite cubic-bezier(0.1, 0.18, 1.61, 0.93);
}

@keyframes shine {
  0%,
  100% {
    opacity: 0.68;
  }
  50% {
    opacity: 1;
  }
}

.product-card:hover {
  /* background: linear-gradient(
    120deg,
    rgba(255, 223, 223, 0.5) 50%,
    #7ca5ff 160%
  ); */
  box-shadow: var(--box-shadow-hover);
  transform: translateY(-4px) scale(1.2);
}

/* Слайдер */
.product-image-slider {
  position: relative;
  width: 100%;
  height: 230px;
  border-radius: 1.4rem;
  overflow: hidden;
  margin-bottom: 0.4rem;
  background: #fff;
  box-shadow: 0 3px 14px 0 #ffecc066;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-image-slider img {
  width: 100%;
  height: 230px;
  object-fit: contain;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.65s cubic-bezier(0.26, 0.64, 0.51, 1.18);
  z-index: 1;
  background: transparent;
}
.product-image-slider img.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9;
  background: rgba(196, 196, 196, 0.77);
  color: #915a08;
  border: none;
  border-radius: 50%;
  font-size: 1.07rem;
  width: 29px;
  height: 29px;
  cursor: pointer;
  box-shadow: 0 2px 8px #39393950;
  transition: background 0.21s;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}
.slider-btn.prev {
  left: 5px;
  padding-bottom: 5px;
}
.slider-btn.next {
  right: 5px;
  padding-bottom: 5px;
}
.slider-btn:hover {
  background: #fff3e2;
  opacity: 1;
}

.slider-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  z-index: 10;
}
.slider-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.23;
  border: 1px solid #ffbb52;
  transition:
    opacity 0.24s,
    background 0.22s;
  cursor: pointer;
}
.slider-dot.active {
  opacity: 0.9;
  background: #ffbb52;
  border-color: #fff6be;
}

/* Хэдер */
.product-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  position: relative;
  margin-bottom: -0.1rem;
  margin-top: -0.6rem;
}

.product-availability {
  font-size: 0.78rem;
  font-weight: 600;
  background: linear-gradient(90deg, #007e34 30%, #3ec0f8 100%);
  color: #fff;
  border-radius: 0.9rem;
  padding: 0.19rem 0.8rem;
  box-shadow: 0 2px 8px 0 rgba(53, 225, 126, 0.09);
  letter-spacing: 0.01em;
}
.product-availability.out-stock {
  background: linear-gradient(90deg, #ff5757 60%, #b32b2b 100%);
}

.product-discount {
  font-size: 0.89rem;
  background: var(--accent2);
  color: #fff;
  border-radius: 0.9rem;
  padding: 0.19rem 0.79rem;
  font-weight: 600;
  box-shadow: 0 2px 8px 0 rgba(255, 87, 87, 0.1);
  letter-spacing: 0.03em;
}

.product-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.11;
  color: #000;
  z-index: 2;
  position: relative;
  letter-spacing: 0.03em;
  margin-bottom: -0.15rem;
  margin-top: 0.25rem;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  z-index: 2;
  position: relative;
  margin-bottom: -0.13rem;
}

.current-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: #005b9c;
}

.old-price {
  font-size: 1rem;
  color: var(--text-muted);
  opacity: 0.4;
  text-decoration: line-through;
}

.product-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.44rem;
  z-index: 2;
  position: relative;
  margin-bottom: 0.1rem;
}

.feature-block {
  background: linear-gradient(
    90deg,
    rgba(114, 109, 109, 0.13) 65%,
    #5c5b5b17 100%
  );
  color: #1d1d1d;
  padding: 0.28rem 0.5rem;
  border-radius: 0.9rem;
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: 0 2px 6px 0 rgba(160, 160, 180, 0.05);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.26rem;
  min-height: 26px;
  transition: background 0.2s;
}
.feature-block .icon {
  width: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Кнопка */
.details-btn {
  margin-top: 0.8rem;
  padding: 0.59rem 1.1rem;
  border-radius: 2rem;
  background: #001f63;
  color: #ffffff;
  font-size: 0.93rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px 0 #ffbb5230;
  transition:
    background 1s,
    color 1s,
    transform 1s cubic-bezier(0.46, 0.87, 0.42, 1.22);
  z-index: 2;
  position: relative;
  width: 280px;
  min-width: 200px;
}
.details-btn:hover {
  transform: scale(1.04);
}

.details-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Адаптивность ---- */
@media (max-width: 540px) {
  .product-card {
    width: 98vw;
    padding: 0.7rem 0.2rem 0.9rem 0.2rem;
    font-size: 0.94rem;
    border-radius: 1.18rem;
  }
  .product-title {
    font-size: 0.86rem;
  }
  .feature-block {
    font-size: 0.7rem;
    min-height: 22px;
  }
  .details-btn {
    font-size: 0.82rem;
    padding: 0.45rem 0.7rem;
    min-width: 84px;
  }
  .product-image-slider,
  .product-image-slider img {
    height: 150px;
  }
}
@media (max-width: 400px) {
  .product-card {
    width: 99vw;
    padding: 0.35rem 0.05rem 0.7rem 0.05rem;
  }
  .product-features {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .product-image-slider,
  .product-image-slider img {
    height: 86px;
    border-radius: 0.7rem;
  }
}
@media (max-width: 800px) and (min-width: 541px) {
  .product-card {
    width: 70vw;
    padding: 1rem 0.5rem 1rem 0.5rem;
    font-size: 1.01rem;
  }
  .product-image-slider,
  .product-image-slider img {
    height: 185px;
  }
}

@media (max-width: 900px) {
  .products-grid {
    gap: 1rem;
  }
}
@media (max-width: 700px) {
  .products-grid {
    flex-direction: column;
    align-items: center;
  }
}

/* ===============================================================
   card-product.filters.css
   Фильтры каталога: полный дизайн + фиксы отображения
   ---------------------------------------------------------------
   Подключайте этот файл ПОСЛЕ вашего основного card-product.css
   чтобы переопределить старые правила без правки HTML.
   =============================================================== */

/* ===== 1) БАЗОВЫЕ ПЕРЕМЕННЫЕ (ограниченно и безопасно) =====
   Можно подправить под бренд. Они используются ТОЛЬКО в блоке .filters.
*/
:root {
  --f-bg: #ffffff;
  --f-ink: #0f172a;
  --f-muted: #64748b;
  --f-line: #e2e8f0;
  --f-brand: #2563eb;
  --f-brand-ink: #ffffff;
  --f-chip-bg: #f1f5f9;
  --f-chip-ink: #0f172a;
  --f-shadow: 0 6px 24px rgba(2, 6, 23, 0.05), 0 2px 8px rgba(2, 6, 23, 0.04);
  --f-r-lg: 18px;
  --f-r-md: 12px;
  --f-r-sm: 10px;
  --f-tr: 0.18s ease;
}

/* Светло/тёмная тема по системной настройке пользователя */
@media (prefers-color-scheme: dark) {
  :root {
    --f-bg: #0b1220;
    --f-ink: #e2e8f0;
    --f-muted: #94a3b8;
    --f-line: #1e293b;
    --f-brand: #3b82f6;
    --f-brand-ink: #0b1220;
    --f-chip-bg: #0f172a;
    --f-chip-ink: #e2e8f0;
    --f-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  }
}

/* ===== 2) КОНТЕЙНЕР ФИЛЬТРОВ =====
   Карточка с мягкими тенями, не перекрывает товары, не обрезается.
*/
.filters {
  box-sizing: border-box;
  position: relative !important;
  z-index: 2 !important;
  overflow: visible !important;

  width: 100%;
  max-width: 1200px;
  margin: 20px auto 16px !important;
  padding: clamp(12px, 2vw, 20px);

  background: var(--f-bg);
  color: var(--f-ink);
  border: 1px solid var(--f-line);
  border-radius: var(--f-r-lg);
  box-shadow: var(--f-shadow);

  animation: f-fade-in 0.22s ease both;
}
@keyframes f-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ===== 3) СЕТКА ФОРМЫ =====
   Устойчивая адаптивная сетка: 3→2→1 колонки.
*/
.filters form {
  display: grid !important;
  gap: 16px !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: start;
}
@media (max-width: 1024px) {
  .filters form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 640px) {
  .filters form {
    grid-template-columns: 1fr !important;
  }
}

/* ===== 4) ГРУППЫ ПОЛЕЙ ===== */
.filters fieldset {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--f-line);
  border-radius: var(--f-r-md);
  background: color-mix(in oklab, var(--f-bg) 96%, #000 0%);
}
.filters legend {
  padding: 0 6px;
  margin-left: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--f-muted);
  text-transform: uppercase;
}

/* ===== 5) БРЕНДЫ: «ЧИПЫ» ===== */
.brand-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
  gap: 8px !important;
}
@media (max-width: 420px) {
  .brand-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
.brand-grid label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--f-line);
  background: var(--f-chip-bg);
  color: var(--f-chip-ink);
  cursor: pointer;
  user-select: none;
  transition:
    transform var(--f-tr),
    border-color var(--f-tr),
    background var(--f-tr);
}
.brand-grid label:hover {
  transform: translateY(-1px);
  border-color: color-mix(in oklab, var(--f-brand) 50%, var(--f-line));
  background: color-mix(in oklab, var(--f-chip-bg) 85%, var(--f-brand) 15%);
}
.brand-grid input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.brand-grid input[type="checkbox"] + span {
  font-size: 14px;
  line-height: 1;
}
.brand-grid input[type="checkbox"]:focus-visible + span {
  outline: 3px solid color-mix(in oklab, var(--f-brand) 35%, transparent);
  outline-offset: 3px;
  border-radius: 6px;
}
.brand-grid input[type="checkbox"]:checked + span {
  color: var(--f-brand);
}
.brand-grid input[type="checkbox"]:checked + span::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--f-brand);
  color: var(--f-brand-ink);
  font-size: 12px;
}

/* ===== 6) ДИАПАЗОНЫ (цена/площадь) ===== */
.range {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.range input[type="number"] {
  flex: 1 1 0%;
  min-width: 0;
  box-sizing: border-box;

  appearance: textfield;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--f-line);
  border-radius: var(--f-r-sm);
  background: var(--f-bg);
  color: var(--f-ink);
  transition:
    border-color var(--f-tr),
    box-shadow var(--f-tr),
    transform var(--f-tr);
}
.range input[type="number"]:hover {
  border-color: color-mix(in oklab, var(--f-line) 60%, var(--f-brand) 40%);
}
.range input[type="number"]:focus {
  outline: none;
  border-color: var(--f-brand);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--f-brand) 35%, transparent);
  transform: translateY(-1px);
}
.range span {
  color: var(--f-muted);
}

/* ===== 7) ОПЦИИ (Wi-Fi/Инвертор) — тумблеры ===== */
fieldset:last-of-type {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
fieldset:last-of-type label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition:
    transform var(--f-tr),
    background var(--f-tr);
}
fieldset:last-of-type label:hover {
  transform: translateY(-1px);
}
fieldset:last-of-type input[type="checkbox"] {
  appearance: none;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--f-line);
  background: var(--f-line);
  position: relative;
  outline: none;
  transition:
    background var(--f-tr),
    border-color var(--f-tr);
}
fieldset:last-of-type input[type="checkbox"]::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--f-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform var(--f-tr);
}
fieldset:last-of-type input[type="checkbox"]:checked {
  background: var(--f-brand);
  border-color: color-mix(in oklab, var(--f-brand) 70%, var(--f-line));
}
fieldset:last-of-type input[type="checkbox"]:checked::after {
  transform: translateX(18px);
}
fieldset:last-of-type input[type="checkbox"] ~ span {
  color: var(--f-ink);
}

/* ===== 8) КНОПКИ ДЕЙСТВИЙ =====
   Никогда не исчезают, занимают всю ширину строки грид-сетки.
*/
.filters-actions {
  grid-column: 1 / -1 !important;
  display: flex !important;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 4px;
}
.filters-actions button[type="submit"] {
  padding: 12px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--f-brand);
  color: var(--f-brand-ink);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 18px color-mix(in oklab, var(--f-brand) 22%, transparent);
  transition:
    transform var(--f-tr),
    filter var(--f-tr);
}
.filters-actions button[type="submit"]:hover {
  transform: translateY(-1px);
  filter: saturate(1.06);
}
.filters-actions .reset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--f-line);
  color: var(--f-ink);
  text-decoration: none;
  background: var(--f-chip-bg);
  transition:
    background var(--f-tr),
    transform var(--f-tr);
}
.filters-actions .reset:hover {
  background: color-mix(in oklab, var(--f-chip-bg) 85%, var(--f-brand) 15%);
  transform: translateY(-1px);
}
@media (max-width: 640px) {
  .filters-actions {
    justify-content: stretch;
  }
  .filters-actions > * {
    flex: 1 1 48%;
  } /* две кнопки рядом на мобиле */
}

/* ===== 9) СТРАХОВКА ОТ НАЛЕЗАНИЙ ===== */
.products-grid {
  position: relative;
  z-index: 1;
  clear: both;
  margin-top: 8px;
}
/* Дополнительно защищаемся от неожиданных глобальных правил */
.filters * {
  max-width: 100%;
  box-sizing: border-box;
}
