/* shop-cart.css — drawer mini-cart + trang giỏ hàng + nút thêm/số lượng + toast. */

/* ---------- Bộ mua ở trang chi tiết (số lượng + thêm vào giỏ) ---------- */
.shop-buy-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 22px 0 4px; }
.shop-qty { display: inline-flex; align-items: center; border: 1px solid #ffd0e2; border-radius: 999px; overflow: hidden; }
.shop-qty button { width: 40px; height: 44px; border: none; background: #fff; font-size: 20px; cursor: pointer; color: #e63c78; line-height: 1; }
.shop-qty button:hover { background: #fff0f6; }
.shop-qty-val { width: 46px; height: 44px; border: none; text-align: center; font-size: 16px; font-weight: 600; outline: none; }
.shop-add-cart {
    flex: 1; min-width: 180px; padding: 13px 26px; border: 2px solid #ff4d8d; border-radius: 999px;
    background: #fff; color: #e63c78; font-weight: 700; font-size: 16px; cursor: pointer; transition: all .2s;
}
.shop-add-cart:hover { background: #ff4d8d; color: #fff; }
.shop-add-cart:disabled { opacity: .6; cursor: default; }

/* ---------- Badge header ---------- */
.shop-cart-toggle { cursor: pointer; }

/* ---------- Drawer ---------- */
body.shop-cart-open { overflow: hidden; }
.shop-cart-drawer { position: fixed; inset: 0; z-index: 100000; }
.shop-cart-drawer[hidden] { display: none; }
.shop-cart-backdrop { position: absolute; inset: 0; background: rgba(30,10,20,.5); }
.shop-cart-panel {
    position: absolute; top: 0; right: 0; height: 100%; width: 400px; max-width: 92vw; background: #fff;
    display: flex; flex-direction: column; box-shadow: -14px 0 44px rgba(0,0,0,.22);
    animation: shopCartIn .28s cubic-bezier(.16,1,.3,1);
}
@keyframes shopCartIn { from { transform: translateX(100%); } to { transform: none; } }
.shop-cart-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid #ffe0ec; }
.shop-cart-drawer-head h3 { margin: 0; font-size: 19px; }
.shop-cart-close { background: none; border: none; font-size: 28px; line-height: 1; color: #bbb; cursor: pointer; }
.shop-cart-close:hover { color: #ff4d8d; }
.shop-cart-drawer .shop-cart-items { flex: 1; overflow-y: auto; padding: 8px 20px; }
.shop-cart-drawer-foot { border-top: 1px solid #ffe0ec; padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- Danh sách item (dùng chung) ---------- */
.shop-cart-empty { color: #888; text-align: center; padding: 40px 10px; }
.shop-cart-item { display: grid; grid-template-columns: 60px 1fr auto; grid-template-areas: "thumb meta remove" "thumb qty line"; gap: 6px 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid #f3eef1; }
.shop-cart-thumb { grid-area: thumb; width: 60px; height: 60px; border-radius: 10px; overflow: hidden; background: #fff0f6; display: block; }
.shop-cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.shop-cart-noimg { display: block; width: 100%; height: 100%; }
.shop-cart-meta { grid-area: meta; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.shop-cart-name { font-size: 14px; font-weight: 600; color: #2b2d42; line-height: 1.35; }
.shop-cart-name:hover { color: #ff4d8d; }
.shop-cart-variant { font-size: 12px; color: #888; }
.shop-cart-price { font-size: 13px; color: #ff4d8d; font-weight: 700; }
.shop-cart-price del { color: #bbb; font-weight: 400; margin-left: 4px; }
.shop-cart-qty { grid-area: qty; display: inline-flex; align-items: center; border: 1px solid #eee; border-radius: 999px; width: max-content; }
.shop-cart-qty button { width: 30px; height: 30px; border: none; background: none; cursor: pointer; font-size: 16px; color: #e63c78; line-height: 1; }
.shop-cart-qty button:hover { background: #fff0f6; border-radius: 999px; }
.shop-cart-qtyval { width: 36px; height: 30px; border: none; text-align: center; font-size: 14px; font-weight: 600; outline: none; background: none; }
.shop-cart-linetotal { grid-area: line; text-align: right; font-weight: 700; font-size: 14px; color: #2b2d42; }
.shop-cart-remove { grid-area: remove; justify-self: end; background: none; border: none; font-size: 20px; color: #ccc; cursor: pointer; line-height: 1; }
.shop-cart-remove:hover { color: #e63c78; }

.shop-cart-subtotal { display: flex; align-items: center; justify-content: space-between; font-size: 15px; }
.shop-cart-subtotal strong { font-size: 19px; color: #ff4d8d; }
.shop-cart-subtotal.big { font-size: 17px; padding-bottom: 14px; border-bottom: 1px solid #ffe0ec; margin-bottom: 18px; }
.shop-cart-subtotal.big strong { font-size: 24px; }

.shop-cart-btn { display: block; text-align: center; padding: 13px; border-radius: 999px; background: #ff4d8d; color: #fff; font-weight: 700; text-decoration: none; border: none; cursor: pointer; font-size: 15px; transition: background .2s; }
.shop-cart-btn:hover { background: #e63c78; color: #fff; }
.shop-cart-btn.ghost { background: #fff; color: #e63c78; border: 1px solid #ffd0e2; }
.shop-cart-btn.ghost:hover { background: #fff0f6; color: #e63c78; }
.shop-cart-btn.full { width: 100%; }

/* ---------- Trang giỏ hàng ---------- */
.shop-cart-page { display: grid; grid-template-columns: 1.6fr 1fr; gap: 36px; align-items: start; padding: 8px 0 40px; }
@media (max-width: 860px) { .shop-cart-page { grid-template-columns: 1fr; gap: 24px; } }
.shop-cart-page-list .shop-cart-item { grid-template-columns: 76px 1fr 110px auto; grid-template-areas: "thumb meta qty line" "thumb meta qty remove"; padding: 18px 0; }
.shop-cart-page-list .shop-cart-thumb { width: 76px; height: 76px; }
.shop-cart-page-list .shop-cart-qty { grid-area: qty; justify-self: center; }
.shop-cart-page-list .shop-cart-linetotal { grid-area: line; }
.shop-cart-page-list .shop-cart-remove { grid-area: remove; align-self: end; }
.shop-cart-page-side { background: #fff7fb; border: 1px solid #ffe0ec; border-radius: 16px; padding: 24px; position: sticky; top: 90px; }
.shop-cart-checkout-form h3 { margin: 0 0 14px; font-size: 18px; }
.shop-cart-checkout-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.shop-cart-checkout-form label b { color: #d63638; }
.shop-cart-checkout-form input { padding: 11px 14px; border: 1px solid #ddd; border-radius: 10px; font-size: 15px; font-weight: 400; }
.shop-cart-checkout-form input:focus { outline: none; border-color: #ff4d8d; box-shadow: 0 0 0 3px rgba(255,77,141,.15); }
.shop-cart-note { font-size: 13px; color: #777; background: #fff; border-radius: 8px; padding: 9px 11px; margin: 0 0 16px; }
.shop-cart-msg { margin-top: 12px; font-size: 14px; text-align: center; min-height: 18px; }
.shop-cart-msg.ok { color: #1a7f37; }
.shop-cart-msg.err { color: #d63638; }

/* ---------- Toast ---------- */
.shop-cart-toast {
    position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
    background: #2b2d42; color: #fff; padding: 12px 22px; border-radius: 999px; font-size: 14px; font-weight: 600;
    box-shadow: 0 12px 34px rgba(0,0,0,.28); opacity: 0; visibility: hidden; transition: all .3s ease; z-index: 100001;
}
.shop-cart-toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.shop-cart-toast.ok { background: #ff4d8d; }
.shop-cart-toast.err { background: #d63638; }
