/* Cart: header counter, "В корзину" toast and the /cart page. Uses the site's theme variables (light and dark). */
.cart-link{position:relative;display:inline-grid;place-items:center;width:44px;height:44px;border:1px solid var(--line);border-radius:14px;background:var(--white);color:var(--ink);transition:transform .18s,border-color .18s,box-shadow .18s}
.cart-link:hover{transform:translateY(-1px);box-shadow:0 10px 24px #17241d1c}
.cart-link svg{display:block}
.cart-count{position:absolute;top:-6px;right:-6px;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:var(--mint);color:#1c211e;font-size:11px;font-weight:700;line-height:20px;text-align:center;border:2px solid var(--paper)}
.cart-count[hidden]{display:none}

.cart-toast{position:fixed;left:50%;bottom:22px;z-index:1000;max-width:min(520px,calc(100vw - 28px));transform:translate(-50%,20px);opacity:0;pointer-events:none;padding:13px 18px;border-radius:14px;background:var(--dark);color:#fff;font-size:13px;line-height:1.45;box-shadow:0 18px 50px #07120c55;transition:opacity .2s,transform .2s}
.cart-toast.show{opacity:1;transform:translate(-50%,0);pointer-events:auto}
.cart-toast.error{background:#8c2f25}
.cart-toast a{color:var(--mint);font-weight:650;text-decoration:underline}

.cart-stage1 .cart-box{border:1px solid var(--line);border-radius:20px;padding:20px 22px;margin:16px 0;background:var(--white)}
.cart-stage1 .cart-box h2{margin:0 0 12px;font-size:20px;letter-spacing:-.02em}
.cart-stage1 .cart-row{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center;padding:9px 0;border-bottom:1px solid var(--line)}
.cart-stage1 .cart-row:last-child{border-bottom:0}
.cart-stage1 .cart-row .grow{flex:1 1 220px}
.cart-stage1 input[type=number]{width:4.5em;text-align:center}
.cart-stage1 .cart-field{display:flex;flex-direction:column;gap:5px;margin:12px 0;max-width:460px;font-size:13px}
.cart-stage1 .cart-field input,.cart-stage1 .cart-field select{min-height:44px;padding:0 12px;border:1px solid var(--line);border-radius:12px;background:var(--paper);color:var(--ink);font:inherit}
.cart-stage1 .cart-check{display:flex;gap:10px;align-items:flex-start;margin:14px 0;font-size:13px;line-height:1.5}
.cart-stage1 .cart-check input{margin-top:3px;flex:0 0 auto}
.cart-stage1 .cart-status{min-height:1.4em;color:var(--muted)}
.cart-stage1 .cart-status.error{color:#c0392b}
.cart-stage1 .cart-secret{font-family:ui-monospace,monospace;background:var(--paper);padding:2px 6px;border-radius:6px}
.cart-stage1 .muted{color:var(--muted)}
.cart-stage1 .small{font-size:12px}
.cart-stage1 .error{color:#c0392b}

.cart-line{padding:14px 0;border-bottom:1px solid var(--line)}
.cart-line:last-child{border-bottom:0}
.cart-line-head{display:flex;gap:12px;align-items:baseline}
.cart-line-sum{font-weight:700;white-space:nowrap}
.cart-line-ctl{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:8px}
.cart-line-ctl input{min-height:40px;border:1px solid var(--line);border-radius:12px;background:var(--paper);color:var(--ink);font:inherit}

.cart-methods{display:grid;gap:10px}
.cart-method{display:flex;gap:12px;align-items:flex-start;padding:13px 15px;border:1px solid var(--line);border-radius:14px;background:var(--paper);cursor:pointer}
.cart-method:has(input:checked){border-color:var(--ink);background:var(--white);box-shadow:0 8px 24px #17241d14}
.cart-method input{margin-top:4px}
.cart-method-text{display:flex;flex-direction:column;gap:2px}
.cart-assets{margin-top:14px}
.cart-sub{margin:0 0 8px;font-weight:650;font-size:13px}
.cart-asset-group{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:8px 0}
.cart-asset-net{flex:0 0 190px;font-size:12px;color:var(--muted)}
.cart-asset{display:inline-flex;gap:7px;align-items:center;padding:8px 14px;border:1px solid var(--line);border-radius:999px;background:var(--paper);cursor:pointer;font-size:13px;font-weight:650}
.cart-asset:has(input:checked){border-color:var(--ink);background:var(--white)}

.cart-total{margin:14px 0 4px;font-size:22px;font-weight:700;letter-spacing:-.02em}
.cart-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}
.cart-note{margin:10px 0;padding:12px 14px;border-radius:12px;background:var(--paper);font-size:13px;line-height:1.5}
.cart-note.warn{background:#fdf0d5;color:#5a3d00}
.cart-order-state{font-size:18px;font-weight:700;margin:4px 0 8px}
.cart-crypto{margin:14px 0}
.cart-crypto-lead{font-size:16px;font-weight:650;margin:0 0 12px}
.cart-copy{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;margin:8px 0}
.cart-copy>span{flex:0 0 64px}
.cart-copy code{padding:7px 10px;border-radius:10px;background:var(--paper);font-size:13px;word-break:break-all}
.cart-addr{flex:1 1 280px}

@media (max-width:620px){
  .cart-stage1 .cart-box{padding:16px;border-radius:16px}
  .cart-asset-net{flex-basis:100%}
  .cart-line-head{flex-direction:column;gap:2px}
  .cart-actions .btn{flex:1 1 100%}
}

/* the site's global form styles stretch inputs; keep choice controls compact */
.cart-stage1 input[type=radio],.cart-stage1 input[type=checkbox]{width:20px;height:20px;min-height:0;padding:0;margin:0;flex:0 0 20px;accent-color:var(--dark)}
.cart-stage1 .cart-method,.cart-stage1 .cart-asset,.cart-stage1 .cart-check{flex-direction:row;width:auto}
.cart-stage1 .cart-method{display:flex;width:100%}
.cart-stage1 .cart-field input[type=email],.cart-stage1 .cart-field input[type=text],.cart-stage1 .cart-field input:not([type]){width:100%}

/* order history cards: long PZC number wraps inside the card, composition is collapsible */
.cart-stage1 .cart-box h2,.cart-order-id{overflow-wrap:anywhere;word-break:break-word}
.cart-order-card{border:1px solid var(--line);border-radius:16px;padding:14px 16px;margin:12px 0;background:var(--paper)}
.cart-order-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;justify-content:space-between}
.cart-order-head .cart-order-id{flex:1 1 220px;min-width:0;font-size:15px;letter-spacing:.01em}
.cart-badge{display:inline-block;padding:3px 10px;border-radius:999px;border:1px solid var(--line);background:var(--white);font-size:12px;font-weight:650;line-height:1.5;white-space:normal}
.cart-order-meta{margin:6px 0 10px;color:var(--muted);font-size:13px}
.cart-order-actions{display:flex;flex-wrap:wrap;gap:8px}
.cart-order-items{margin-top:10px;border-top:1px solid var(--line)}
.cart-order-item{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}
.cart-order-item:last-child{border-bottom:0}
.cart-order-item-name{flex:1 1 200px;min-width:0;display:flex;flex-direction:column;gap:2px;overflow-wrap:anywhere}
.cart-qty{font-weight:700;white-space:nowrap}
#cart-open-note .cart-order-id{margin:0 0 8px}
#cart-open-note p{margin:0 0 8px}
.cart-order-caption{font-weight:650;font-size:13px}
.cart-stage1 #cart-lines>.btn{margin-top:4px}
@media (max-width:620px){
  .cart-order-card{padding:12px}
  .cart-order-actions .btn{flex:1 1 100%}
  .cart-order-item .btn{flex:1 1 100%}
}

/* header buttons on phones (<=430px): cart, theme and menu never shrink below their 44px touch size (the logo or the account chip yields) */
@media (max-width:430px){
  .header-actions>.cart-link,.header-actions>.theme-toggle,.header-actions>.menu-button{flex:0 0 auto}
  /* logged in: the full logo cannot fit next to the account chip, and a squeezed one turned into a 0-37px sliver. Show the square mark (left part of the same SVG) at a fixed size, the chip yields instead */
  .header-inner:has(.header-account) .brand{flex:0 0 auto}
  .header-inner:has(.header-account) .brand .brand-logo{width:32px;height:32px;object-fit:cover;object-position:left center;flex:0 0 auto}
  .header-account{min-width:0;flex:0 1 auto}
  .header-account .account-mini{min-width:0}
  .header-account .account-mini-copy{min-width:0;overflow:hidden}
  .header-account .account-mini-copy strong,.header-account .account-mini-copy small b{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}
/* header on narrow phones (<=380px): the account chip may shrink (long name or balance -> ellipsis), gaps are smaller; cart/theme/menu keep their 44px touch targets.
   Guest: the login button is a little tighter so the full logo keeps about 95px. */
@media (max-width:380px){
  .header-inner{gap:6px}
  .header-actions .header-account-trigger{padding:0 9px!important}
  .header-actions{gap:4px;margin-left:auto}
  .header-account{min-width:0;flex:0 1 auto}
  .header-account .account-mini{min-width:0;gap:7px;padding-right:8px}
  .header-account .account-mini-avatar,.header-account .account-mini-chevron{flex:0 0 auto}
  .header-account .account-mini-copy{min-width:0;overflow:hidden}
  .header-account .account-mini-name,.header-account .account-mini-copy small{min-width:0}
  .header-account .account-mini-copy strong,.header-account .account-mini-copy small b{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}

/* header on desktop (>=1280px, horizontal navigation visible), logged in: the account chip makes the row wider than the container, so the logo was squeezed
   (124px at 1280, 24px from 1451px up). The logo never shrinks; the navigation is set a little tighter (the same 12px type at every width) and the chip may ellipsize as a safety valve. */
@media (min-width:1280px){
  .header-inner:has(.header-account){gap:8px}
  .header-inner:has(.header-account) .brand{flex:0 0 auto}
  .header-inner:has(.header-account) .brand .brand-logo{flex:0 0 auto}
  .header-inner:has(.header-account) #nav{gap:6px}
  .header-inner:has(.header-account) #nav a{font-size:12px}
  .header-inner:has(.header-account) .header-account{min-width:0;flex:0 1 auto}
  .header-inner:has(.header-account) .header-account .account-mini{min-width:0}
  .header-inner:has(.header-account) .header-account .account-mini-copy{min-width:0;overflow:hidden}
  .header-inner:has(.header-account) .header-account .account-mini-copy strong,.header-inner:has(.header-account) .header-account .account-mini-copy small b{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}

/* staff page: card of a common cart order */
#cart-admin-group .cart-sub{margin:16px 0 6px}
#cart-admin-group .cart-order-head h2{margin:0}
#cart-admin-groups-box .cart-actions{align-items:center}
