/* ==========================================================
   CX Checkout v0.43 — Ειδοποίηση «Μπήκε στο καλάθι» (cx_notice.js)
   Στυλ: card (κάρτα στη γωνία) · modal (κέντρο) · bar (μπάρα κάτω)
   Κινητό (<768px): πάντα bottom sheet.
   Χρώματα/γωνίες από CSS variables στο root (--cxn-*), από το admin.
   ========================================================== */

.cxn { position: fixed; inset: 0; z-index: 10500; pointer-events: none; font-family: inherit; color: #1a1a1a; }
.cxn * { box-sizing: border-box; }
.cxn button { font-family: inherit; }

.cxn-overlay { position: absolute; inset: 0; background: rgba(17, 17, 17, .45); opacity: 0; transition: opacity .18s ease; pointer-events: auto; }
.cxn.is-open .cxn-overlay { opacity: 1; }
.cxn.is-leaving .cxn-overlay { opacity: 0; }

.cxn-box { position: absolute; background: #fff; border-radius: var(--cxn-radius, 14px); box-shadow: 0 16px 44px rgba(0, 0, 0, .18); overflow: hidden; pointer-events: auto; opacity: 0; transition: opacity .2s ease, transform .22s ease; }
.cxn.is-open .cxn-box { opacity: 1; transform: none; }
.cxn.is-leaving .cxn-box { opacity: 0; }

/* ── Θέσεις / στυλ ── */
.cxn[data-style="card"] .cxn-box { width: 384px; max-width: calc(100vw - 32px); border: 1px solid #ebebeb; }
.cxn[data-style="card"][data-pos="tr"] .cxn-box { top: 20px; right: 20px; transform: translateY(-10px); }
.cxn[data-style="card"][data-pos="tl"] .cxn-box { top: 20px; left: 20px; transform: translateY(-10px); }
.cxn[data-style="card"][data-pos="br"] .cxn-box { bottom: 20px; right: 20px; transform: translateY(10px); }
.cxn[data-style="card"][data-pos="bl"] .cxn-box { bottom: 20px; left: 20px; transform: translateY(10px); }

.cxn[data-style="modal"] .cxn-box { width: 600px; max-width: calc(100vw - 32px); left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.96); }
.cxn[data-style="modal"].is-open .cxn-box { transform: translate(-50%, -50%) scale(1); }
.cxn[data-style="modal"].is-leaving .cxn-box { transform: translate(-50%, -50%) scale(.96); }

.cxn[data-style="bar"] .cxn-box { left: 0; right: 0; bottom: 0; width: auto; border-radius: 0; background: #17171a; color: #fff; transform: translateY(16px); box-shadow: 0 -10px 34px rgba(0, 0, 0, .22); }

.cxn[data-style="sheet"] .cxn-box { left: 0; right: 0; bottom: 0; width: auto; border-radius: 18px 18px 0 0; transform: translateY(24px); box-shadow: 0 -12px 40px rgba(0, 0, 0, .25); }
.cxn-handle { width: 38px; height: 4px; border-radius: 2px; background: #ddd; margin: 10px auto 0; }

/* ── Αυτόματο κλείσιμο ── */
.cxn-life { height: 3px; background: rgba(0, 0, 0, .08); }
.cxn[data-style="bar"] .cxn-life { background: rgba(255, 255, 255, .14); }
.cxn-life i { display: block; height: 3px; width: 100%; background: var(--cxn-accent, #1a1a1a); transition: width linear; }
.cxn[data-style="bar"] .cxn-life i { background: var(--cxn-success, #1fa06a); }

/* ── Περιεχόμενο ── */
.cxn-inner { padding: 16px 18px 18px; }
.cxn[data-style="modal"] .cxn-inner { padding: 24px 26px; }

.cxn-head { display: flex; align-items: center; gap: 10px; }
.cxn-check { width: 24px; height: 24px; border-radius: 50%; background: var(--cxn-success, #1fa06a); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cxn-check svg { width: 14px; height: 14px; }
.cxn-title { font-size: 15px; font-weight: 700; line-height: 1.2; }
.cxn[data-style="modal"] .cxn-title { font-size: 17px; }
.cxn-x { margin-left: auto; width: 30px; height: 30px; border: 0; background: transparent; color: #a8a8a8; font-size: 16px; line-height: 1; cursor: pointer; padding: 0; border-radius: 50%; flex-shrink: 0; }
.cxn-x:hover { color: #555; background: #f3f3f4; }
.cxn[data-style="bar"] .cxn-x { color: rgba(255, 255, 255, .6); margin-left: 0; }
.cxn[data-style="bar"] .cxn-x:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.cxn[data-style="modal"] .cxn-x, .cxn[data-style="sheet"] .cxn-x { background: #f3f3f4; color: #888; font-size: 14px; }

.cxn-prod { display: flex; gap: 12px; margin-top: 14px; align-items: flex-start; }
.cxn-thumb { width: 64px; height: 64px; border-radius: 10px; background: #f4f4f6; flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cxn[data-style="modal"] .cxn-thumb { width: 148px; height: 148px; border-radius: 12px; }
.cxn-thumb img { max-width: 100%; max-height: 100%; display: block; }
.cxn-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cxn-name { font-size: 14px; font-weight: 600; line-height: 1.3; color: inherit; text-decoration: none; display: block; }
a.cxn-name:hover { text-decoration: underline; color: inherit; }
.cxn[data-style="modal"] .cxn-name { font-size: 15.5px; }
.cxn-meta { font-size: 12.5px; color: #8e8e8e; }
.cxn[data-style="bar"] .cxn-meta { color: rgba(255, 255, 255, .65); }
.cxn-price { font-size: 14px; font-weight: 700; margin-top: 2px; }
.cxn[data-style="modal"] .cxn-price { font-size: 16px; }

/* ── Μπάρα δωρεάν μεταφορικών ── */
.cxn-ship { margin-top: 14px; }
.cxn-ship-label { font-size: 12.5px; color: #6f6f6f; margin-bottom: 6px; }
.cxn-ship-label b { color: #1a1a1a; }
.cxn[data-style="bar"] .cxn-ship-label { color: rgba(255, 255, 255, .65); }
.cxn[data-style="bar"] .cxn-ship-label b { color: #fff; }
.cxn-ship-bar { height: 6px; border-radius: 3px; background: #efefef; overflow: hidden; }
.cxn[data-style="bar"] .cxn-ship-bar { background: rgba(255, 255, 255, .18); }
.cxn-ship-bar i { display: block; height: 6px; border-radius: 3px; background: var(--cxn-success, #1fa06a); }

/* ── Κουμπιά ── */
.cxn-actions { display: flex; gap: 10px; margin-top: 16px; }
.cxn-btn { flex: 1; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: calc(var(--cxn-radius, 14px) - 4px); font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; padding: 6px 14px; }
.cxn-btn:hover { text-decoration: none; }
.cxn-btn--primary { border: 0; background: var(--cxn-accent, #1a1a1a); color: var(--cxn-accent-text, #ffffff); font-weight: 700; }
.cxn-btn--primary:hover { color: var(--cxn-accent-text, #ffffff); filter: brightness(1.12); }
.cxn-btn--outline { border: 1px solid #d8d8d8; background: #fff; color: #1a1a1a; }
.cxn-btn--outline:hover { border-color: #aaa; color: #1a1a1a; }
.cxn[data-style="bar"] .cxn-btn--outline { background: transparent; border-color: rgba(255, 255, 255, .4); color: #fff; }
.cxn[data-style="bar"] .cxn-btn--primary { background: #fff; color: #17171a; }
.cxn-link { display: block; text-align: center; margin-top: 12px; font-size: 13.5px; color: #777; text-decoration: underline; background: none; border: 0; cursor: pointer; width: 100%; padding: 4px 0; }
.cxn-link:hover { color: #333; }
.cxn[data-style="bar"] .cxn-link { color: rgba(255, 255, 255, .7); width: auto; margin: 0; }

/* ── Μπάρα κάτω: όλα σε μία γραμμή ── */
.cxn[data-style="bar"] .cxn-inner { display: flex; align-items: center; gap: 16px; padding: 14px 28px; }
.cxn[data-style="bar"] .cxn-head { gap: 12px; }
.cxn[data-style="bar"] .cxn-prod { margin: 0; align-items: center; }
.cxn[data-style="bar"] .cxn-thumb { width: 52px; height: 52px; background: #fff; }
.cxn[data-style="bar"] .cxn-ship { margin: 0 8px 0 auto; min-width: 200px; }
.cxn[data-style="bar"] .cxn-ship-bar { height: 5px; }
.cxn[data-style="bar"] .cxn-actions { margin: 0; flex: none; }
.cxn[data-style="bar"] .cxn-btn { flex: none; }

/* ── Sheet (κινητό) ── */
.cxn[data-style="sheet"] .cxn-inner { padding: 14px 18px calc(22px + env(safe-area-inset-bottom, 0px)); }
.cxn[data-style="sheet"] .cxn-actions { flex-direction: column; margin-top: 18px; }
.cxn[data-style="sheet"] .cxn-btn { min-height: 48px; font-size: 15px; }
.cxn[data-style="sheet"] .cxn-title { font-size: 16px; }
.cxn[data-style="sheet"] .cxn-thumb { width: 68px; height: 68px; }

@media (max-width: 767px) {
  .cxn[data-style="bar"] .cxn-inner { flex-wrap: wrap; }
}

/* ── Debug badge (?cxn_debug=1) ── */
.cxn-debug { position: fixed; left: 12px; bottom: 12px; z-index: 11000; background: #17171a; color: #fff; font-size: 12px; line-height: 1.4; padding: 8px 12px; border-radius: 8px; opacity: .93; font-family: system-ui, sans-serif; max-width: 320px; }
