/* Всплывающие уведомления и адаптив под планшеты и телефоны (подключается последним) */

/* ===== Уведомления ===== */
/* Уведомления появляются сверху по центру, сразу под шапкой: там их видно сразу */
.toasts {
  position: fixed;
  top: 84px;
  left: 50%;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 13px 20px;
  border: 1px solid var(--border);
  border-left: 5px solid var(--success);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: toast-in 0.25s ease;
  transition:
    opacity 0.4s,
    transform 0.4s;
}
/* Ошибка (например, товара больше нет) — красная и крупнее, чтобы её нельзя было пропустить */
.toast--error {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
  font-size: 16px;
  animation:
    toast-in 0.25s ease,
    toast-attention 0.5s ease 0.25s;
}
.toast--error::before {
  content: '⚠ ';
}
.toast--hide {
  opacity: 0;
  transform: translateY(-10px);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes toast-attention {
  25%,
  75% {
    transform: scale(1.05);
  }
  50% {
    transform: scale(0.98);
  }
}

[hidden] {
  display: none !important;
}

/* ===== Адаптив ===== */
@media (max-width: 1024px) {
  .cart {
    grid-template-columns: 1fr;
  }
  .summary {
    position: static;
  }
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .burger {
    display: block;
  }

  .nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px 16px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav.nav--open {
    display: flex;
  }
  .nav a {
    padding: 10px 0;
  }

  .header__inner {
    gap: 12px;
  }
  .search {
    order: 5;
  }

  .hero__inner {
    grid-template-columns: 1fr;
  }
  .hero__visual {
    max-width: 420px;
  }

  .catalog {
    grid-template-columns: 1fr;
  }
  .filters {
    position: static;
    display: none;
    max-height: none;
  }
  .filters.filters--open {
    display: block;
  }
  .filters-toggle {
    display: inline-flex;
  }

  .product {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 640px) {
  .header__inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
    gap: 10px 8px;
  }
  .search {
    flex-basis: 100%;
    max-width: none;
    margin-left: 0;
  }
  .logo {
    margin-right: auto;
  }
  .nav {
    top: 100%;
  }

  .cart-item {
    grid-template-columns: 80px 1fr auto;
    grid-template-areas:
      'img title remove'
      'img qty sum';
  }
  .cart-item__image {
    grid-area: img;
  }
  .cart-item__info {
    grid-area: title;
  }
  .cart-item .qty {
    grid-area: qty;
    justify-self: start;
  }
  .cart-item__sum {
    grid-area: sum;
    min-width: 0;
  }
  .cart-item .remove-btn {
    grid-area: remove;
    justify-self: end;
  }

  .form-grid,
  .radio-cards {
    grid-template-columns: 1fr;
  }
  .address-row {
    flex-direction: column;
  }
  .map-picker__map {
    height: 240px;
  }
  .footer__grid {
    grid-template-columns: 1fr;
  }
  .section {
    padding: 32px 0;
  }
  .hero {
    padding-top: 32px;
  }
}
