:root {
  --bg: #e6edf6;
  --surface: #ffffff;
  --text: #1e2b3b;
  --muted: #516175;
  --primary: #1f3754;
  --primary-dark: #172a40;
  --success: #1f3754;
  --border: #d5deea;
  --shadow: 0 14px 36px rgba(23, 42, 64, 0.12);
  --radius: 20px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #dbe6f3 0%, var(--bg) 260px, var(--bg) 100%);
  line-height: 1.5;
  padding-right: 0;
  padding-bottom: 92px;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1160px, 92%);
  margin: 0 auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
}

.logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
}

.header__phone {
  font-size: 0.95rem;
  color: var(--primary-dark);
  font-weight: 700;
}

.top-cart {
  position: fixed;
  left: 12px;
  right: 12px;
  top: auto;
  bottom: 12px;
  width: auto;
  z-index: 90;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.top-cart__inner {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.top-cart__text {
  margin: 0;
  font-weight: 700;
  font-size: 0.94rem;
}

.top-cart__link {
  display: inline-block;
  text-align: center;
  width: 100%;
  border: 1px solid var(--primary);
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
}

.hero {
  padding: 58px 0 32px;
}

.hero__inner {
  background: linear-gradient(120deg, #6f8fb6 0%, #3a5678 46%, #233753 100%);
  border-radius: 26px;
  color: #fff;
  padding: 44px 42px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.hero__label {
  margin: 0 0 12px;
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0.9;
  letter-spacing: 0.03em;
}

h1,
h2,
h3 {
  margin-top: 0;
  line-height: 1.2;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(1.7rem, 2.3vw, 2.5rem);
}

.hero__text {
  margin: 0;
  max-width: 690px;
  color: #ffffff;
}

.hero__actions {
  margin-top: 26px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

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

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

.btn--primary:hover {
  background: var(--primary-dark);
}

.btn--ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #fff;
}

.btn--small {
  background: var(--primary);
  color: #fff;
  width: fit-content;
  box-shadow: 0 6px 16px rgba(23, 42, 64, 0.2);
}

.btn--small:hover {
  background: var(--primary-dark);
}

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

.section-head {
  margin-bottom: 20px;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.products {
  padding: 26px 0 32px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(15, 42, 76, 0.08);
}

.product-card--featured {
  border: 2px solid #86a6cd;
}

.product-card__image {
  aspect-ratio: 16/9;
  background:
    linear-gradient(145deg, rgba(44, 80, 118, 0.9), rgba(124, 158, 196, 0.9)),
    linear-gradient(180deg, #d4e1f1, #93afce);
  display: grid;
  place-items: center;
  padding: 10px;
  color: #eef5ff;
  font-weight: 700;
  text-align: center;
}

.product-card__image--photo {
  position: relative;
  padding: 0;
  display: block;
  overflow: hidden;
  background: #e3ebf5;
}

.product-card__image--photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.availability {
  margin: 0;
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 0.92rem;
}

.description {
  margin: 0;
  color: #334a60;
}

.product-card ul {
  margin: 0;
  padding-left: 18px;
  color: #263b4f;
}

.product-card li {
  margin-bottom: 4px;
}

.price {
  margin: 2px 0 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: #1f3754;
}

.product-actions {
  margin-top: auto;
  display: flex;
  align-items: end;
  gap: 10px;
}

.product-qty {
  display: grid;
  gap: 6px;
  font-size: 0.84rem;
  color: #3d5b74;
  font-weight: 700;
}

.product-qty input {
  width: 90px;
  border: 1px solid #c8d7e8;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-weight: 600;
  color: #20384f;
  /* Чтобы iOS/Android не делали автозум при фокусе на input[type="number"] */
  font-size: 16px;
}

/* Кнопки +/- выбора количества в карточках */
.qty-stepper {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  width: 100%;
  gap: 0;
  border: 1px solid rgba(31, 55, 84, 0.18);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(31, 55, 84, 0.04);
}

.qty-stepper__btn {
  width: 52px;
  height: 52px;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 900;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Чтобы на телефонах при тапе не срабатывал авто-скейл/зум */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.qty-stepper__btn:hover {
  background: rgba(31, 55, 84, 0.08);
}

.qty-stepper__value {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-weight: 900;
  color: #20384f;
  font-size: 1.05rem;
  padding: 0 16px;
  border-radius: 0;
  border: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Бейдж в карточке: сколько товара уже в корзине */
.product-in-cart-badge {
  display: none;
  justify-self: start;
  font-size: 0.78rem;
  font-weight: 900;
  color: #1a884a;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(26, 136, 74, 0.08);
  border: 1px solid rgba(26, 136, 74, 0.22);
}

.product-in-cart-badge.is-show {
  display: inline-flex;
}

.order {
  padding: 20px 0 88px;
}

.order__wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.order__intro p {
  color: #35516a;
}

.order__note {
  margin-top: 16px;
  font-weight: 600;
}

.order-form {
  display: grid;
  gap: 12px;
}

.order-form label {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 600;
}

.order-form input,
.order-form select,
.order-form textarea {
  width: 100%;
  border: 1px solid #c8d7e8;
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  color: #20384f;
  background: #fff;
}

.order-form input:focus,
.order-form select:focus,
.order-form textarea:focus {
  outline: 2px solid rgba(31, 55, 84, 0.22);
  border-color: var(--primary);
}

.form-status {
  min-height: 20px;
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #3d5b74;
}

.cart {
  border: 1px solid #d1deed;
  border-radius: 12px;
  background: #f9fcff;
  padding: 12px;
}

.cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.cart__clear {
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.cart__items {
  display: grid;
  gap: 8px;
}

.cart__empty {
  margin: 0;
  color: #647f97;
  font-size: 0.9rem;
}

.cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  border: 1px solid #dbe6f3;
  border-radius: 10px;
  background: #fff;
  padding: 9px 10px;
}

.cart-item > div:first-child {
  min-width: 0;
}

.cart-item__name {
  margin: 0;
  font-size: 0.91rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.cart-item__meta {
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: #4a647d;
}

.cart-item__qty-stepper {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-qty-btn {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(31, 55, 84, 0.22);
  background: rgba(31, 55, 84, 0.06);
  color: var(--primary);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.cart-qty-btn:hover {
  background: rgba(31, 55, 84, 0.12);
}

.cart-qty-value {
  min-width: 30px;
  text-align: center;
  font-weight: 900;
  color: #20384f;
  user-select: none;
}

.cart-item__remove {
  border: 0;
  background: transparent;
  color: #bf1e2e;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  align-self: start;
  font-weight: 700;
  padding: 0;
}

.cart__total {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #dbe6f3;
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
}

.footer {
  border-top: 1px solid var(--border);
  background: #fff;
}

.footer__inner {
  padding: 18px 0 104px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #35516a;
  font-size: 0.92rem;
}

.mobile-cta {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 80;
  display: none;
  text-align: center;
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  padding: 13px 14px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(14, 104, 217, 0.22);
  border: 0;
}

/* Оповещение при добавлении в корзину */
.cart-toast {
  position: fixed;
  left: 12px;
  right: 12px;
  top: 66px; /* ближе к header */
  bottom: auto;
  z-index: 120;
  pointer-events: none;
  display: flex;
  justify-content: center;
}

.cart-toast__inner {
  pointer-events: none;
  max-width: 520px;
  width: fit-content;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(26, 136, 74, 0.35);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: #1a884a;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 11px 14px;
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.cart-toast--show .cart-toast__inner {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (min-width: 1024px) {
  .cart__items {
    max-height: min(45vh, 360px);
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-gutter: stable;
  }

  .mobile-cta {
    display: none;
  }
}

@media (max-width: 1080px) {
  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .header__inner {
    padding: 10px 0;
  }

  .logo {
    font-size: 1.05rem;
  }

  .header__phone {
    font-size: 0.88rem;
  }

  .hero {
    padding-top: 20px;
  }

  .hero__inner {
    border-radius: 20px;
    padding: 24px 18px;
  }

  .hero__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero__actions .btn {
    width: 100%;
    text-align: center;
  }

  .products {
    padding-top: 14px;
  }

  .products-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .product-card__body {
    padding: 14px;
  }

  .product-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .product-qty input {
    width: 100%;
  }

  .product-qty {
    width: 100%;
  }

  .product-actions .btn--small {
    width: 100%;
  }

  .order {
    padding-top: 6px;
  }

  .order__wrap {
    grid-template-columns: 1fr;
    border-radius: 16px;
    padding: 16px;
    gap: 10px;
  }

  .top-cart__link {
    width: 100%;
  }

  .mobile-cta {
    display: block;
  }

  .footer__inner {
    flex-direction: column;
  }

  /* На мобиле делаем мини-кошик более контрастным, чтобы не "сливался" с фоном */
  .top-cart {
    background: #1f3754;
    backdrop-filter: none;
    /* border: 1px solid rgba(31, 55, 84, 0.18);
    box-shadow: 0 18px 46px rgba(23, 42, 64, 0.22); */
  }

  .top-cart__link {
    background: #fff;
    color: #000;
  }

  .top-cart__text {
    color: #fff;
  }

  .top-cart__inner {
    padding: 14px 12px;
  }
}
