/* ===== THÀNH PHẦN DÙNG CHUNG: nút nổi, giỏ hàng, cửa sổ chi tiết, thông báo ===== */
/* Nút nổi góc phải */
.floating{position:fixed;right:20px;bottom:20px;z-index:60;display:flex;flex-direction:column;gap:12px}
.fl-btn{width:56px;height:56px;border-radius:50%;display:grid;place-items:center;color:#fff;box-shadow:0 10px 24px -8px rgba(0,0,0,.35);transition:transform .25s,opacity .3s;position:relative;font-weight:800;font-size:13px}
.fl-btn:hover{transform:scale(1.1)}
.fl-btn svg{width:26px;height:26px}
.fl-zalo{background:#0a68ff}
.fl-call{background:var(--g600)}
.fl-call::before{content:"";position:absolute;inset:0;border-radius:50%;border:2px solid var(--g500);animation:ring 1.8s infinite}
@keyframes ring{to{transform:scale(1.6);opacity:0}}
.to-top{background:var(--g900);opacity:0;pointer-events:none}
.to-top.show{opacity:1;pointer-events:auto}

/* Lớp phủ tối */
.overlay{position:fixed;inset:0;background:rgba(6,30,18,.5);z-index:90;opacity:0;pointer-events:none;transition:.3s;backdrop-filter:blur(2px)}
.overlay.show{opacity:1;pointer-events:auto}

/* Giỏ hàng */
.drawer{position:fixed;top:0;right:0;height:100%;width:min(420px,100%);background:#fff;z-index:100;transform:translateX(100%);transition:transform .4s cubic-bezier(.2,.8,.2,1);display:flex;flex-direction:column}
.drawer.show{transform:none}
.drawer-head{display:flex;justify-content:space-between;align-items:center;padding:22px 24px;border-bottom:1px solid var(--line)}
.drawer-head h3{font-size:19px;color:var(--g900);flex:1}
.drawer-head{gap:12px}
.back-btn svg{transform:rotate(-90deg)}
.back-btn[hidden]{display:none}
.back-btn:hover{transform:none}
.drawer-view{display:flex;flex-direction:column;flex:1;min-height:0}
.drawer-view[hidden]{display:none}
.drawer-foot .btn:disabled{opacity:.55;cursor:not-allowed}

/* Bước đặt hàng */
.co-summary{background:var(--g50);border:1px solid var(--line);border-radius:14px;padding:14px 16px;margin:8px 0 18px}
.co-summary h4{font-size:14px;color:var(--g900);margin-bottom:8px}
.co-line{display:flex;justify-content:space-between;gap:12px;font-size:14px;padding:4px 0}
.co-line small{color:var(--muted)}
.co-line b{color:var(--g700);white-space:nowrap}
.co-fields{display:grid;gap:12px;padding-bottom:12px}
.co-pay{font-size:13px;color:var(--muted);background:var(--gold-l);border-radius:12px;padding:10px 12px}
.drawer-foot .form-error{margin:0 0 12px}
.co-done{text-align:center;padding-top:50px}
.co-done .ok{width:76px;height:76px;border-radius:50%;background:var(--g100);color:var(--g700);display:grid;place-items:center;margin:0 auto 18px;animation:pop .5s}
.co-done .ok svg{width:38px;height:38px}
.co-done h3{font-size:22px;color:var(--g900);margin-bottom:8px}
.co-done p{color:var(--muted);margin-bottom:16px}
.co-done .ref{display:inline-block;margin-bottom:22px;padding:4px 12px;border-radius:999px;background:var(--g50);color:var(--g700);font-size:13px;font-weight:700}
.co-done .ref[hidden]{display:none}
.co-done .btn{display:flex;margin:0 auto}
.x-btn{width:38px;height:38px;border-radius:50%;background:var(--g50);display:grid;place-items:center;transition:.2s}
.x-btn:hover{background:var(--g100);transform:rotate(90deg)}
.x-btn svg{width:18px;height:18px}
.drawer-items{flex:1;overflow:auto;padding:12px 24px}
.ci-row{display:flex;gap:14px;padding:14px 0;border-bottom:1px solid var(--line);align-items:center}
.ci-thumb{width:68px;height:68px;border-radius:12px;background:var(--g50);display:grid;place-items:center;flex:none}
.ci-thumb svg,.ci-thumb img{height:56px;width:auto;max-width:60px;object-fit:contain}
.ci-info{flex:1;min-width:0}
.ci-info b{display:block;font-size:14.5px;color:var(--g900);line-height:1.3}
.ci-info span{font-size:13.5px;color:var(--g700);font-weight:700}
.qty{display:flex;align-items:center;border:1.5px solid var(--line);border-radius:999px;margin-top:6px;width:max-content}
.qty button{width:28px;height:28px;font-weight:700;color:var(--g700);border-radius:50%}
.qty button:hover{background:var(--g100)}
.qty span{min-width:24px;text-align:center;font-size:13.5px;font-weight:700}
.rm{color:#9aa8a0;font-size:12.5px;align-self:flex-start}
.rm:hover{color:#d6453d}
.empty{text-align:center;padding:60px 20px;color:var(--muted)}
.empty svg{width:70px;height:70px;margin:0 auto 14px;color:var(--g100)}
.empty .btn{margin-top:20px}
.drawer-foot{padding:20px 24px;border-top:1px solid var(--line);background:var(--g50)}
.total{display:flex;justify-content:space-between;margin-bottom:14px;font-weight:600}
.total b{font-size:22px;color:var(--g700)}
.drawer-foot .btn{width:100%}

/* Cửa sổ chi tiết sản phẩm */
.modal{position:fixed;inset:0;z-index:110;display:grid;place-items:center;padding:20px;pointer-events:none;opacity:0;transition:.3s}
.modal.show{opacity:1;pointer-events:auto}
.modal-box{background:#fff;border-radius:24px;max-width:820px;width:100%;display:grid;grid-template-columns:1fr 1fr;transform:scale(.95);transition:.3s;max-height:90vh;overflow-y:auto;position:relative}
.modal.show .modal-box{transform:none}
.modal-img{background:radial-gradient(circle at 50% 60%,#fff,var(--g100));display:grid;place-items:center;padding:30px;min-height:320px}
.modal-img svg,.modal-img img{height:280px;width:auto;max-width:100%;object-fit:contain;filter:drop-shadow(0 16px 14px rgba(10,58,34,.22))}
.modal-info{padding:36px 32px}
.modal-info h3{font-size:24px;color:var(--g900);margin:6px 0 10px;line-height:1.3}
.modal-info p{color:var(--muted);font-size:14.5px;margin-bottom:16px}
.modal-info ul{list-style:none;display:grid;gap:8px;margin-bottom:20px;font-size:14px}
.modal-info li{display:flex;gap:8px}
.modal-info li::before{content:"✓";color:var(--g600);font-weight:800}
.modal-info .rating{margin:0 0 12px}
.modal-info .price{margin-bottom:20px}
.modal-info .price b{font-size:26px}
.modal-actions{display:flex;gap:10px;flex-wrap:wrap}
.modal .x-btn{position:absolute;top:14px;right:14px;z-index:2}

/* Thông báo nhỏ */
.toast{position:fixed;left:50%;bottom:28px;transform:translate(-50%,150px);background:var(--g900);color:#fff;padding:14px 22px;border-radius:14px;display:flex;gap:12px;align-items:center;z-index:120;box-shadow:var(--shadow-lg);transition:transform .4s cubic-bezier(.2,.8,.2,1);font-size:14.5px;max-width:calc(100% - 40px)}
.toast.show{transform:translate(-50%,0)}
.toast .t-ic{width:28px;height:28px;border-radius:50%;background:var(--gold);color:var(--g900);display:grid;place-items:center;flex:none}
.toast .t-ic svg{width:15px;height:15px}

@media (max-width:860px){ .modal-box{grid-template-columns:1fr} .modal-img{min-height:240px} .modal-img svg,.modal-img img{height:200px} }
@media (max-width:640px){ .floating{right:14px;bottom:14px} .fl-btn{width:50px;height:50px} .modal-info{padding:26px 22px} }
