/* Магазин /shop/: витрина, карточка журнала, корзина, оформление заказа. Подключается только в разделе /shop/. */
.btn-lg{padding:14px 22px;font-size:15px}
.btn-block{display:flex;width:100%;justify-content:center}
.btn[disabled],.btn.is-disabled{opacity:.6;cursor:progress}
.cart-btn svg{width:18px;height:18px}
.cart-count{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:99px;background:var(--red);color:#fff;font-size:12px;line-height:1}
.cart-count[hidden]{display:none}

/* витрина */
.shop-head{align-items:flex-end}
.shop-head .cart-btn{flex:none}
.shop-links{display:flex;flex-wrap:wrap;gap:8px;margin:-8px 0 30px}
.shop-links a{border:1px solid var(--line);border-radius:99px;padding:8px 15px;font-size:14px;font-weight:700}
.shop-links a:hover{border-color:var(--red);color:var(--red)}
.shop-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:36px 26px;margin-bottom:40px}
.shop-item{display:flex;flex-direction:column;min-width:0}
.shop-cover{position:relative;display:block;aspect-ratio:1/1;background:var(--soft);border-radius:8px;overflow:hidden;margin-bottom:14px}
.shop-cover img{height:100%;object-fit:contain;padding:18px;background:transparent;transition:transform .35s}
.shop-item:hover .shop-cover img{transform:scale(1.03)}
.shop-item.is-out .shop-cover img{opacity:.55}
.shop-badge{position:absolute;left:12px;top:12px;background:var(--ink);color:#fff;font-size:12px;font-weight:700;padding:5px 9px;border-radius:4px}
.shop-item h3{font-size:20px}
.shop-item h3 a:hover{color:var(--red)}
.shop-sub{font-size:14px;color:var(--muted);margin-top:4px}
.shop-buy{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:auto;padding-top:14px}
.shop-price{font:700 22px var(--serif)}
.btn.in-cart{border-color:var(--ink);background:var(--paper);color:var(--ink)}

/* карточка журнала */
.shop-top{display:flex;justify-content:space-between;align-items:center;padding:6px 0 18px}
.product{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,6fr);gap:56px;align-items:start;padding-bottom:36px;border-bottom:1px solid var(--line)}
.product-cover{background:var(--soft);border-radius:8px;aspect-ratio:1/1;display:grid;place-items:center;overflow:hidden}
.product-cover img{height:100%;object-fit:contain;padding:28px;background:transparent}
.product-thumbs{display:flex;gap:10px;margin-top:12px;flex-wrap:wrap}
.product-thumbs button{width:76px;height:76px;padding:4px;border:2px solid var(--line);border-radius:6px;background:var(--soft)}
.product-thumbs button[aria-current="true"]{border-color:var(--red)}
.product-thumbs img{height:100%;object-fit:contain;background:transparent}
.product-info h1{font-size:42px;margin:8px 0 6px}
.product-sub{font-size:17px;color:var(--muted)}
.product-buy{display:flex;align-items:center;gap:22px;flex-wrap:wrap;margin:24px 0}
.price-big{font:700 34px var(--serif)}
.stock-out{font-weight:700;color:var(--muted);border:1px solid var(--line);border-radius:6px;padding:11px 16px}
.product-facts{list-style:none;margin:0 0 26px;padding:16px 18px;background:var(--soft);border-radius:8px;display:grid;gap:8px;font-size:15px}
.product-facts b{font-weight:700}
.product-text{font-size:17px}
.shop-back{margin:22px 0 36px;font-weight:700}
.shop-back a:hover,.summary-back:hover{color:var(--red)}

/* шаги */
.order-steps{list-style:none;display:flex;gap:8px;margin:18px 0 26px;padding:0;counter-reset:st;flex-wrap:wrap}
.order-steps li{counter-increment:st;display:flex;align-items:center;gap:8px;font-size:14px;color:var(--faint);font-weight:700}
.order-steps li::before{content:counter(st);display:grid;place-items:center;width:26px;height:26px;border-radius:50%;border:1.5px solid currentColor;font-size:13px}
.order-steps li+li::after{content:none}
.order-steps li:not(:last-child){padding-right:14px;border-right:1px solid var(--line);margin-right:6px}
.order-steps li[aria-current="step"]{color:var(--ink)}
.order-steps li[aria-current="step"]::before{background:var(--red);border-color:var(--red);color:#fff}
.order-steps li.done{color:var(--ink-2)}
.order-steps li.done::before{content:"✓"}
.order-steps a{text-decoration:underline;text-underline-offset:3px}

/* корзина и заказ: общая раскладка */
.order{display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:48px;align-items:start;margin-bottom:48px;position:relative}
.order h1{font-size:38px;margin-bottom:18px}
.summary{position:sticky;top:20px;background:var(--soft);border-radius:10px;padding:24px;display:flex;flex-direction:column;gap:16px}
.summary h2{font-size:24px}
.summary-total{display:flex;justify-content:space-between;align-items:baseline;gap:12px;border-top:1px solid var(--line);padding-top:14px;font-weight:700}
.summary-total #summ{font:700 28px var(--serif);white-space:nowrap}
#summ.pcode i{font-style:normal}
#summ.pcode i:first-child{font-size:17px;color:var(--faint);text-decoration:line-through;margin-right:6px}
#summ.pcode i:last-child{color:var(--red)}
.summary-note{font-size:13px;color:var(--muted)}
.summary-back{font-size:14px;font-weight:700;display:inline-block;margin-top:18px}
.summary .summary-back{margin-top:0}

/* корзина */
.cart-item{display:grid;grid-template-columns:96px minmax(0,1fr) auto 110px;gap:20px;align-items:center;padding:18px 0;border-bottom:1px solid var(--line)}
.cart-item:first-of-type{border-top:1px solid var(--line)}
.cart-item .img{width:96px;height:96px;background:var(--soft);border-radius:6px;overflow:hidden}
.cart-item .img img{height:100%;object-fit:contain;padding:6px;background:transparent}
.cart-item_name b{display:block;font:700 19px/1.25 var(--serif)}
.cart-item_name small{display:block;color:var(--muted);font-size:14px;margin-top:3px}
.cart-item_price{display:block;font-size:13px;color:var(--faint);margin-top:6px}
.cart-item_count{display:flex;align-items:center;border:1px solid var(--line);border-radius:8px;overflow:hidden;height:42px}
.cart-item_count button{width:40px;height:100%;border:0;background:var(--paper);font-size:20px;line-height:1}
.cart-item_count button:hover{background:var(--soft);color:var(--red)}
.cart-item_count .qty-val{min-width:38px;text-align:center;font-weight:700;cursor:text}
.cart-item_count input{display:none;width:52px;height:100%;border:0;text-align:center;font-weight:700;-moz-appearance:textfield}
.cart-item_count input::-webkit-inner-spin-button{-webkit-appearance:none}
.cart-item_count.is-editing input{display:block}
.cart-item_count.is-editing .qty-val{display:none}
.cart-item_sum{text-align:right;font:700 20px var(--serif);white-space:nowrap}
.cart-empty{padding:30px 0;display:flex;flex-direction:column;align-items:flex-start;gap:14px;color:var(--muted);font-size:17px}
.cart-empty[hidden]{display:none}
.promocode label{display:block;font-size:13px;font-weight:700;margin-bottom:6px}
.promo-row{display:flex;gap:8px;position:relative}
.promo-row input{flex:1;min-width:0;height:42px;border:1px solid var(--line);border-radius:6px;padding:0 34px 0 12px;background:var(--paper);text-transform:uppercase}
.promo-row input:disabled{color:var(--ink);background:#eef6ee;border-color:#9cc79c}
.promo-row .clear{position:absolute;right:112px;top:50%;transform:translateY(-50%);border:0;background:none;font-size:20px;color:var(--muted);width:28px;height:28px}
.promo-row .clear[hidden]{display:none}
.promo-row .btn{height:42px}
.p-error{font-size:13px;color:var(--red);margin-top:6px}
.p-error:empty{display:none}

/* оформление */
.order-form fieldset{border:0;padding:0;margin:0 0 30px}
.order-form legend{font:700 22px var(--serif);margin-bottom:14px;padding:0}
.textfields{display:grid;grid-template-columns:1fr 1fr;gap:16px 18px}
.order-form label>span{display:block;font-size:13px;font-weight:700;margin-bottom:6px}
.order-form label small{display:block;font-size:12px;color:var(--muted);margin-top:5px}
.order-form input[type=text],.order-form input[type=tel],.order-form input[type=email],.order-form textarea{width:100%;height:46px;border:1px solid #cfd3d7;border-radius:6px;padding:0 13px;background:var(--paper);font-size:16px}
.order-form textarea{height:auto;padding:11px 13px;resize:vertical;font:inherit}
.order-form input:focus,.order-form textarea:focus,.promo-row input:focus{outline:2px solid var(--ink);outline-offset:0;border-color:var(--ink)}
.order .empty{border-color:var(--red)!important;background:#fff5f5!important}
.delivery-opt{display:flex;gap:12px;align-items:flex-start;border:1px solid var(--line);border-radius:8px;padding:14px 16px;margin-bottom:10px;cursor:pointer}
.delivery-opt:has(input:checked){border-color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink)}
.delivery-opt input{margin-top:4px;accent-color:var(--red);width:18px;height:18px;flex:none}
.order-form .delivery-opt>span{font-size:inherit;font-weight:400;margin:0}
.delivery-opt b{display:block;font-size:16px}
.delivery-opt small{display:block;color:var(--muted);font-size:14px;margin-top:2px}
.delivery_post{display:none;flex-direction:column;gap:14px;padding:6px 0 0}
.delivery_post.is-open{display:flex}
.delivery_post-message{font-size:14px}
.delivery_post-message:empty{display:none}
.delivery_post-message a{text-decoration:underline;margin-left:6px}
.order .form .err{display:none;background:#fff5f5;border:1px solid #f0c2c5;color:var(--red-dark);border-radius:6px;padding:12px 14px;font-size:14px;font-weight:700}
.summary-items{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.summary-items li{display:flex;justify-content:space-between;gap:12px;font-size:14px}
.summary-items small{display:block;color:var(--muted);font-size:12px}
.summary-items b{white-space:nowrap}
.accept{display:flex;gap:10px;align-items:flex-start;font-size:13px;line-height:1.45;color:var(--ink-2);padding:10px;border-radius:6px;border:1px solid transparent;cursor:pointer}
.accept input{margin-top:2px;width:18px;height:18px;flex:none;accent-color:var(--red)}
.accept a{text-decoration:underline}
.accept.empty{border-color:var(--red);background:#fff5f5}
.order .spinner{display:none;position:absolute;inset:0;background:rgba(255,255,255,.6);z-index:5;place-items:center}
.order .spinner.is-on{display:grid}
.order .spinner i{width:40px;height:40px;border:3px solid var(--line);border-top-color:var(--red);border-radius:50%;animation:medspin .8s linear infinite}
@keyframes medspin{to{transform:rotate(360deg)}}
.suggestions-wrapper{position:relative}

/* результат оплаты и пустой заказ */
.order-result,.order-empty{max-width:640px;margin:10px auto 60px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:16px}
.order-result h1,.order-empty h1{font-size:36px}
.order-result p{font-size:17px}
.order-result .muted{font-size:14px;color:var(--muted)}
.order-result_icon{width:64px;height:64px;border-radius:50%;display:grid;place-items:center;font-size:30px;font-weight:700;background:var(--soft)}
.order-result.is-ok .order-result_icon{background:#e6f4e6;color:#2b7a2b}
.order-result.is-fail .order-result_icon{background:#fdeaea;color:var(--red)}

@media (max-width:1180px){
  .shop-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .order{grid-template-columns:minmax(0,1fr) 330px;gap:32px}
  .product{gap:36px}
}
@media (max-width:860px){
  .shop-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:28px 16px}
  .shop-head{flex-direction:column;align-items:flex-start}
  .order{grid-template-columns:minmax(0,1fr)}
  .summary{position:static}
  .product{grid-template-columns:minmax(0,1fr);gap:24px}
  .product-info h1{font-size:32px}
  .order h1{font-size:30px}
}
@media (max-width:520px){
  .shop-item h3{font-size:17px}
  .shop-buy{flex-direction:column;align-items:stretch;gap:8px}
  .shop-buy .btn{justify-content:center}
  .shop-price{font-size:20px}
  .shop-cover img{padding:10px}
  .textfields{grid-template-columns:1fr}
  .cart-item{grid-template-columns:72px minmax(0,1fr);grid-template-areas:"img name" "img count" ". sum";gap:8px 14px}
  .cart-item .img{grid-area:img;width:72px;height:72px}
  .cart-item_name{grid-area:name}
  .cart-item_count{grid-area:count;justify-self:start}
  .cart-item_sum{grid-area:sum;text-align:left;font-size:18px}
  .order-steps li{font-size:12px}
  .order-steps li:not(:last-child){padding-right:8px;margin-right:2px}
  .summary{padding:18px}
}
