/* COD Popup Order Form v2.0 — Stylesheet */

/* ── Inline Button ── */
.cod-btn-wrap { margin-top: 10px; width: 100%; }
.cod-trigger-btn {
  display: block; width: 100%; padding: 15px 20px; color: #fff !important;
  border: none; border-radius: 6px; font-size: 15px; font-weight: 700;
  letter-spacing: 0.6px; cursor: pointer; text-align: center;
  text-transform: uppercase; font-family: inherit;
  transition: background 0.2s, transform 0.1s; text-decoration: none !important;
  box-sizing: border-box;
}
.cod-trigger-btn:active { transform: scale(0.99); }

/* ── Sticky Bar ── */
.cod-sticky-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9997;
  padding: 12px 16px; transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1); box-sizing: border-box;
}
.cod-sticky-bar.visible { transform: translateY(0); }
.cod-sticky-btn {
  display: block; width: 100%; max-width: 600px; margin: 0 auto;
  padding: 16px 20px; color: #fff !important;
  border: none; border-radius: 8px; font-size: 15px; font-weight: 700;
  letter-spacing: 0.6px; cursor: pointer; text-align: center;
  text-transform: uppercase; font-family: inherit;
  transition: background 0.2s, transform 0.1s; text-decoration: none !important;
  box-shadow: 0 -4px 20px rgba(50,54,82,0.35); box-sizing: border-box;
}
.cod-sticky-btn:active { transform: scale(0.99); }

/* ── Overlay ── */
.cod-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.6); backdrop-filter:blur(3px); z-index:99998; }
.cod-overlay.active { display:block; animation:codFadeIn 0.2s ease; }
@keyframes codFadeIn { from{opacity:0}to{opacity:1} }
@keyframes codSlideUp {
  from { opacity:0; transform:translate(-50%,-46%) scale(0.97); }
  to   { opacity:1; transform:translate(-50%,-50%) scale(1); }
}

/* ── Popup ── */
.cod-popup {
  display:none; position:fixed; top:50%; left:50%; transform:translate(-50%,-50%);
  z-index:99999; width:92%; max-width:480px; max-height:90vh;
  background:#fff; border-radius:16px; overflow:hidden;
  box-shadow:0 28px 80px rgba(0,0,0,0.38);
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; box-sizing:border-box;
}
.cod-popup.active { display:flex; flex-direction:column; animation:codSlideUp 0.28s cubic-bezier(0.34,1.4,0.64,1); }

/* ── Header ── */
.cod-ph { display:flex; align-items:center; justify-content:space-between; padding:16px 18px 14px; border-bottom:1px solid #eee; flex-shrink:0; }
.cod-ph h2 { font-size:18px; font-weight:700; color:#111; margin:0; }
.cod-x { width:30px; height:30px; border:none; background:#f0f0f0; border-radius:50%; cursor:pointer; display:flex; align-items:center; justify-content:center; color:#555; font-size:17px; flex-shrink:0; transition:background 0.15s; line-height:1; padding:0; }
.cod-x:hover { background:#e0e0e0; color:#111; }

/* ── Body ── */
.cod-pb { overflow-y:auto; flex:1; padding:0 16px 20px; -webkit-overflow-scrolling:touch; }
.cod-pb::-webkit-scrollbar { width:3px; }
.cod-pb::-webkit-scrollbar-thumb { background:#ddd; border-radius:3px; }

/* ── Product row ── */
.cod-prod-row { display:flex; align-items:center; gap:12px; padding:14px 0; border-bottom:1px solid #eee; }
.cod-img-wrap { position:relative; flex-shrink:0; }
.cod-img-wrap img { width:56px; height:56px; border-radius:8px; object-fit:cover; border:1px solid #eee; display:block; background:#f5f5f5; }
.cod-qty-badge { position:absolute; top:-6px; right:-6px; width:20px; height:20px; background:#2d3561; color:#fff; border-radius:50%; font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center; border:2px solid #fff; }
.cod-prod-info { flex:1; min-width:0; }
.cod-prod-name { font-size:16px; font-weight:600; color:#222; line-height:1.3; word-break:break-word; }
.cod-prod-meta { font-size:12px; color:#888; margin-top:2px; }
.cod-prod-price { font-size:16px; font-weight:700; color:#111; white-space:nowrap; flex-shrink:0; }

/* ── Totals ── */
.cod-totals { margin:14px 0; border:1.5px solid #e8e8e8; border-radius:12px; overflow:hidden; background:#fafafa; }
.cod-trow { display:flex; justify-content:space-between; align-items:center; padding:13px 16px; }
.cod-trow+.cod-trow { border-top:1px solid #eee; }
.cod-trow.subtotal { font-size:16px; color:#555; }
.cod-trow.subtotal span:last-child { font-size:16px; color:#333; font-weight:500; }
.cod-trow.shipping { font-size:14px; color:#2a7a2a; }
.cod-free-tag { background:#e8f5e9; color:#2a7a2a; padding:3px 10px; border-radius:20px; font-size:12.5px; font-weight:700; }
.cod-trow.grand { background:#fff; border-top:1.5px solid #e0e0e0 !important; }
.cod-trow.grand span:first-child { font-size:16px; font-weight:700; color:#111; }
.cod-trow.grand span:last-child  { font-size:20px; font-weight:700; color:#111; }

/* ── Form ── */
.cod-form { padding-top:4px; }
.cod-fg { margin-bottom:13px; }
.cod-lbl { display:block; font-size:15px; font-weight:600; color:#222; margin-bottom:5px; }
.cod-lbl .req { color:#e03737; margin-left:2px; }

/* ── Input wrapper ── */
.cod-popup .cod-iw {
  display:flex; align-items:center; border:1.5px solid #e0e0e0; border-radius:9px; overflow:hidden;
  background:#f9f9f9; transition:border-color 0.2s,box-shadow 0.2s;
  width:100%; box-sizing:border-box; height:46px; min-height:46px; max-height:46px; padding:0 !important; margin:0;
}
.cod-popup .cod-iw:focus-within { border-color:#2d3561; box-shadow:0 0 0 3px rgba(45,53,97,0.1); background:#fff; }
.cod-popup .cod-iw.error { border-color:#e03737; box-shadow:0 0 0 3px rgba(224,55,55,0.09); }
.cod-popup .cod-ico {
  width:42px !important; min-width:42px !important; height:46px !important; min-height:46px !important; max-height:46px !important;
  display:flex !important; align-items:center !important; justify-content:center !important;
  background:#f0f0f0 !important; font-size:15px !important; flex-shrink:0 !important;
  border-right:1px solid #e8e8e8 !important; margin:0 !important; padding:0 !important; box-sizing:border-box !important;
}
.cod-popup .cod-iw input,
.cod-popup .cod-iw select {
  flex:1 !important; border:none !important; outline:none !important; background:transparent !important; box-shadow:none !important;
  padding:0 11px !important; margin:0 !important; height:46px !important; min-height:46px !important; max-height:46px !important;
  line-height:46px !important; font-size:14px !important; color:#222 !important; font-family:inherit !important;
  min-width:0 !important; width:100% !important; box-sizing:border-box !important; border-radius:0 !important;
  -webkit-appearance:none !important; appearance:none !important;
}
.cod-popup .cod-iw input::placeholder { color:#bbb !important; font-size:13.5px !important; }
.cod-popup .cod-iw select { color:#333 !important; cursor:pointer !important; padding-right:32px !important; }
.cod-popup .cod-iw select option { color:#222; }
.cod-popup .cod-phone-pre {
  display:flex !important; align-items:center !important; height:46px !important; min-height:46px !important; max-height:46px !important;
  padding:0 9px 0 11px !important; margin:0 !important; font-size:14px !important; font-weight:600 !important;
  color:#444 !important; border-right:1px solid #e8e8e8 !important; white-space:nowrap !important; flex-shrink:0 !important; box-sizing:border-box !important;
}
.cod-sel-wrap { position:relative; flex:1; display:flex; align-items:center; min-width:0; }
.cod-sel-wrap select { width:100%; }
.cod-sel-arrow { position:absolute; right:11px; pointer-events:none; color:#999; font-size:10px; top:50%; transform:translateY(-50%); }
.cod-ferr { display:none; color:#e03737; font-size:12px; margin-top:4px; }
.cod-ferr.show { display:block; }

/* ── Subscribe ── */
.cod-sub { display:flex; align-items:flex-start; gap:10px; margin:14px 0; padding:12px 14px; background:#f8f9ff; border-radius:9px; border:1.5px solid #e8eaf5; }
.cod-sub input[type="checkbox"] { width:16px; height:16px; accent-color:#2d3561; cursor:pointer; flex-shrink:0; margin-top:2px; }
.cod-sub label { font-size:13px; color:#555; cursor:pointer; line-height:1.45; }

/* ── Alerts ── */
.cod-serr { display:none; background:#fff0f0; color:#c0392b; border:1px solid #f5c6c6; border-radius:8px; padding:10px 13px; font-size:13px; margin-bottom:10px; }
.cod-vwarn { display:none; background:#fff8e1; color:#8a5700; border:1px solid #ffe082; border-radius:8px; padding:10px 13px; font-size:13px; margin-bottom:10px; margin-top:4px; }

/* ── Submit ── */
.cod-sbtn { width:100%; padding:15px 10px; color:#fff; border:none; border-radius:9px; font-family:inherit; font-size:15px; font-weight:700; letter-spacing:0.5px; cursor:pointer; transition:background 0.2s; word-break:break-word; text-transform:uppercase; }
.cod-sbtn:disabled { opacity:0.7; cursor:not-allowed; }

@media (max-width:420px) {
  .cod-popup { width:96%; max-height:94vh; border-radius:13px; }
  .cod-ph { padding:13px 14px 12px; }
  .cod-pb { padding:0 13px 18px; }
}
