/* ─────────────────────────────────────────────
   CHECKOUT / CART DRAWER
   Шапка сверху, форма прокручивается, итог и кнопка всегда внизу.
   ───────────────────────────────────────────── */
[hidden]{ display:none !important; }

body.drawer-open{ overflow:hidden; }

.drawer{
  display:flex; flex-direction:column;
  height:100vh; height:100dvh;
  overflow:hidden;               /* scrolling happens only in .drawer-body */
  width:min(420px, 100vw);
}
.drawer-head{ flex:0 0 auto; position:static; }

.drawer-body{
  flex:1 1 auto; min-height:0;
  overflow-y:auto; overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  padding-bottom:10px;
}

/* Cart lines */
.drawer-items{ padding:6px 22px 0; }
.cart-line{
  display:flex; align-items:center; gap:10px;
  padding:14px 0; border-bottom:1px solid var(--line);
  font-family:'Montserrat', -apple-system, sans-serif;
}
.cart-line-info{ flex:1; min-width:0; display:flex; flex-direction:column; }
.cart-line-name{ font-size:14px; color:var(--ink); font-weight:500; }
.cart-line-variant{ font-size:12px; color:var(--ink-soft); }
.cart-line-qty{ display:flex; align-items:center; gap:8px; font-size:14px; }
.cart-line-qty button{
  width:28px; height:28px; border-radius:50%; border:1px solid var(--line);
  background:#fff; color:var(--ink); font-size:15px; line-height:1; cursor:pointer;
}
.cart-line-remove{ background:none; border:none; color:var(--ink-soft); font-size:14px; cursor:pointer; padding:4px; }

/* Form */
.co-form{ padding:14px 22px 6px; font-family:'Montserrat', -apple-system, sans-serif; }
.co-form input[type=text], .co-form input[type=tel], .co-form input[type=email],
.co-form input[type=date], .co-form select, .co-form textarea{
  width:100%; border:1px solid var(--line); background:#fff; color:var(--ink);
  padding:12px; font-size:14px; font-family:inherit; border-radius:4px; margin-bottom:9px;
  -webkit-appearance:none; appearance:none;
}
.co-form select{
  background-image:linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position:calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size:5px 5px; background-repeat:no-repeat; padding-right:34px;
}
.co-form textarea{ resize:vertical; min-height:60px; }
.co-form input:focus, .co-form select:focus, .co-form textarea:focus{ outline:none; border-color:var(--gold); }
.co-invalid{ border-color:#B04A3A !important; background:#FDF4F2 !important; }

.co-label{
  font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--gold);
  margin:18px 0 8px; font-weight:600;
}
.co-hint{ font-size:12px; color:var(--ink-soft); margin:-2px 0 10px; }
.co-hint-error{ color:#B04A3A; }
.co-row3{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; }

.co-toggle{ display:flex; gap:8px; margin-bottom:10px; }
.co-opt{
  flex:1; padding:11px 8px; border:1px solid var(--ink); background:none; color:var(--ink);
  border-radius:100px; font-size:13px; font-family:inherit; cursor:pointer; transition:.2s;
}
.co-opt.active{ background:var(--ink); color:var(--paper); }
.co-toggle-sm .co-opt{ font-size:12px; padding:9px 6px; border-color:var(--line); }
.co-toggle-sm .co-opt.active{ border-color:var(--ink); }

.co-check{ display:flex; align-items:flex-start; gap:10px; font-size:13px; color:var(--ink); margin:4px 0 12px; cursor:pointer; line-height:1.4; }
.co-check input{ width:18px; height:18px; margin:1px 0 0; accent-color:var(--ink); flex:0 0 auto; }

.promo-row{ display:flex; gap:8px; margin-bottom:6px; }
.promo-row input{ flex:1; margin-bottom:0 !important; }
.promo-row .btn-outline{ flex:0 0 auto; padding:0 16px; }

/* Payment options */
.pay-list{ display:flex; flex-direction:column; gap:10px; margin-bottom:6px; }
.pay-opt{
  display:flex; align-items:center; gap:12px; width:100%; text-align:left;
  padding:14px; border:1px solid var(--line); border-radius:6px; background:#fff;
  font-family:inherit; color:var(--ink); cursor:pointer; transition:.2s; flex-wrap:wrap;
}
.pay-opt.active{ border-color:var(--ink); box-shadow:0 0 0 1px var(--ink) inset; background:var(--paper-dim); }
.pay-radio{
  width:18px; height:18px; border-radius:50%; border:1.5px solid var(--ink); flex:0 0 auto; position:relative;
}
.pay-opt.active .pay-radio::after{
  content:''; position:absolute; inset:3px; border-radius:50%; background:var(--ink);
}
.pay-text{ flex:1; min-width:150px; display:flex; flex-direction:column; }
.pay-text strong{ font-size:14px; font-weight:600; }
.pay-text small{ font-size:12px; color:var(--ink-soft); }
.pay-icons{ display:flex; gap:4px; flex-wrap:wrap; margin-left:30px; }
.pay-chip{
  font-size:9.5px; font-weight:700; letter-spacing:.03em; padding:3px 6px;
  border:1px solid var(--line); border-radius:3px; color:var(--ink); background:#fff;
}

/* Footer: always visible */
.drawer-foot{
  flex:0 0 auto; background:var(--paper);
  border-top:1px solid var(--line); padding:14px 22px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow:0 -8px 20px rgba(0,0,0,.05);
  font-family:'Montserrat', -apple-system, sans-serif;
}
.drawer-foot.is-empty .sum-row, .drawer-foot.is-empty .checkout-note{ display:none; }
.sum-row{ display:flex; justify-content:space-between; font-size:13px; color:var(--ink-soft); margin-bottom:4px; }
.drawer-foot .total-row{ margin:8px 0 12px; font-size:17px; }
.co-error{ font-size:12.5px; color:#B04A3A; margin:0 0 10px; }
.checkout-btn:disabled{ opacity:.45; cursor:not-allowed; }
.checkout-note{ margin-top:8px; }

/* Success screen */
.order-done{
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; padding:30px 28px; font-family:'Montserrat', -apple-system, sans-serif;
}
.order-done-icon{
  width:64px; height:64px; border-radius:50%; background:var(--ink); color:var(--paper);
  display:flex; align-items:center; justify-content:center; font-size:28px; margin-bottom:18px;
}
.order-done h3{ font-family:'Playfair Display', Georgia, serif; font-weight:400; font-size:26px; margin:0 0 6px; color:var(--ink); }
.order-done-num{ font-size:13px; letter-spacing:.06em; color:var(--gold); margin:0 0 14px; font-weight:600; }
.order-done-text{ font-size:14px; color:var(--ink-soft); line-height:1.6; margin:0 0 26px; }
.order-done .checkout-btn{ max-width:280px; }

/* Hide floating buttons while the cart is open so they don't cover "Place order" */
body.drawer-open #bcb-root, body.drawer-open .float-order{ display:none !important; }
