/* Страница товара, корзина и подвал */

/* ===== Страница товара ===== */
.product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 16px 0 48px;
}

.product__image {
  display: grid;
  place-items: center;
  aspect-ratio: 10 / 7;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
}
.product__image img,
.product__image .product-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product__info {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.product__meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}
.product__price .price__current {
  font-size: 36px;
}

.buy-box {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.qty button {
  width: 40px;
  height: 44px;
  border: none;
  background: var(--surface-2);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}
.qty button:hover:not(:disabled) {
  color: var(--accent);
}
.qty button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.qty span,
.qty input {
  width: 48px;
  border: none;
  background: transparent;
  color: var(--text);
  font: 600 16px var(--font-body);
  text-align: center;
}

.specs {
  width: 100%;
  border-collapse: collapse;
}
.specs th,
.specs td {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.specs th {
  width: 45%;
  color: var(--muted);
  font-weight: 400;
}

/* ===== Корзина ===== */
.cart {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
  padding-bottom: 48px;
}

.cart-item {
  display: grid;
  grid-template-columns: 110px 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.cart-item + .cart-item {
  margin-top: 12px;
}

.cart-item__image {
  display: grid;
  place-items: center;
  aspect-ratio: 10 / 7;
  border-radius: 8px;
  background: var(--surface-2);
  padding: 6px;
}
.cart-item__image img,
.cart-item__image .product-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cart-item__title {
  font-weight: 600;
}
.cart-item__title:hover {
  color: var(--accent);
}
.cart-item__sum {
  min-width: 110px;
  text-align: right;
  font: 700 20px var(--font-head);
}

.remove-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}
.remove-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.panel {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.panel + .panel {
  margin-top: 20px;
}

.summary {
  position: sticky;
  top: 88px;
}
.summary__row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  color: var(--muted);
}
.summary__row b {
  color: var(--text);
  font-weight: 500;
}
.summary__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 12px 0 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font: 700 26px var(--font-head);
}

.success {
  max-width: 560px;
  margin: 32px auto 64px;
  padding: 40px 24px;
  border: 1px solid color-mix(in srgb, var(--success) 40%, transparent);
  border-radius: 20px;
  background: var(--surface);
  text-align: center;
}
.success__icon {
  font-size: 56px;
  color: var(--success);
}

/* ===== Подвал ===== */
.footer {
  margin-top: 32px;
  padding: 40px 0 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}

.footer h4 {
  margin: 0 0 12px;
  font: 700 16px var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer li {
  padding: 3px 0;
  color: var(--muted);
}
.footer li a:hover {
  color: var(--accent);
}
.footer__bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}
.footer__credit a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer__credit a:hover {
  color: var(--accent);
}
