/* Корзина: кнопка в шапке и выезжающая панель (справа на компьютере, шторка снизу на телефоне) */

.cart { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 0; border-radius: 999px; background: none; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.cart:hover { background: var(--bg); }
.cart svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.cart #cart-count:empty { display: none; }
.cart #cart-count { min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; text-align: center; }

#cart-root { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.cart-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); opacity: 0; transition: opacity .3s; }
.cart-drawer {
  position: absolute; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; width: min(440px, 100%);
  background: var(--glass-bg-strong, var(--surface)); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  box-shadow: -12px 0 40px rgba(0, 0, 0, .18); transform: translateX(105%); transition: transform .32s cubic-bezier(.2, .8, .2, 1);
}
#cart-root.is-open { pointer-events: auto; }
#cart-root.is-open .cart-backdrop { opacity: 1; }
#cart-root.is-open .cart-drawer { transform: none; }

.cart-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); font-size: 20px; font-weight: 700; }
.cart-drawer__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 20px 16px; }
.cart-drawer__foot { padding: 14px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.cart-drawer__foot .buy { width: 100%; margin: 0; }

.cart-list { margin: 0; padding: 0; list-style: none; }
.cart-item { position: relative; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 14px 28px 14px 0; border-bottom: 1px solid var(--line); }
.cart-item__img { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 14px; background: #fff; overflow: hidden; }
.cart-item__img img { max-width: 90%; max-height: 90%; object-fit: contain; }
.cart-item__info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cart-item__name { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--text); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.cart-item__plan { font-size: 12.5px; color: var(--muted); }
.cart-item__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.cart-item__row b { font-size: 15px; white-space: nowrap; }
.cart-item__remove { position: absolute; top: 12px; right: 0; width: 26px; height: 26px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.cart-item__remove:hover { background: var(--bg); color: var(--text); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.qty button { width: 32px; height: 30px; border: 0; background: none; color: var(--text); font-size: 17px; cursor: pointer; }
.qty span { min-width: 22px; text-align: center; font-size: 14px; font-weight: 600; }

.cart-form { margin-top: 18px; }
.cart-form h3 { margin: 0 0 12px; font-size: 17px; }
.cart-form label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.cart-form input { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; font-size: 16px; }
.cart-form input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.cart-form__note { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.cart-form__error { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, #ff3b30 12%, transparent); color: #d70015; font-size: 13.5px; }
.cart-total { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; font-size: 15px; color: var(--muted); }
.cart-total b { font-size: 22px; color: var(--text); }
.cart-credit { min-height: 1.25em; margin: 0 0 12px; font-size: 13px; color: var(--muted); }

.cart-empty, .cart-done { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 40px 28px; text-align: center; color: var(--muted); }
.cart-empty svg { width: 56px; height: 56px; fill: none; stroke: currentColor; stroke-width: 1.4; opacity: .5; }
.cart-done h3 { margin: 6px 0 0; font-size: 22px; color: var(--text); }
.cart-done p { margin: 0 0 12px; line-height: 1.5; }
.cart-done__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: color-mix(in srgb, #30b85c 16%, transparent); color: #30b85c; font-size: 30px; font-weight: 700; }
.cart-done .buy { display: block; width: 100%; text-align: center; }

@media (max-width: 860px) {
  .cart { position: relative; padding: 7px; }
  .cart__label { display: none; }
  .cart #cart-count { position: absolute; top: -2px; right: -4px; min-width: 18px; padding: 1px 5px; font-size: 11px; line-height: 16px; }
  .cart-drawer { top: auto; left: 0; width: 100%; height: 88vh; height: 88dvh; border-radius: 24px 24px 0 0; transform: translateY(105%); box-shadow: 0 -12px 40px rgba(0, 0, 0, .18); }
  .cart-drawer__head { position: relative; padding-top: 22px; }
  .cart-drawer__head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--muted-2); opacity: .5; }
}
