/*
 * CSS của BÁN HÀNG (theme web-shop): giỏ hàng nhanh (drawer), nút giỏ nổi, nút/thông báo dùng chung. Dùng design token (var(--color-*), var(--radius)) của theme.
 * File viết tay (KHÔNG tự sinh) — shop.js (tự sinh từ template-src/runtime/shop) chỉ gắn/bỏ class, không inject style.
 */
.shop-btn { display: block; text-align: center; padding: 12px 18px; border-radius: var(--radius); background: var(--color-primary); color: #fff; font-weight: 700; text-decoration: none; border: 1px solid var(--color-primary); cursor: pointer; font-size: 1rem; }
.shop-btn.is-ghost { background: none; color: var(--color-primary); }
.shop-btn[aria-disabled="true"], .shop-btn.is-loading { opacity: .5; pointer-events: none; }
.is-loading { cursor: progress; }
.shop-badge { display: inline-block; background: #fee2e2; color: #b91c1c; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }

/* nút giỏ nổi */
.shop-cart-fab { position: fixed; right: 18px; bottom: 18px; z-index: 900; width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer; background: var(--color-primary); color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .22); display: flex; align-items: center; justify-content: center; }
.shop-cart-fab-count { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #ef4444; color: #fff; font-size: .72rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.shop-cart-fab-count[hidden] { display: none; }

/* drawer */
.shop-drawer-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .45); opacity: 0; transition: opacity .2s ease; }
.shop-drawer-overlay[hidden] { display: none; }
.shop-drawer-overlay.is-open { opacity: 1; }
.shop-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--color-surface, #fff); color: var(--color-text, #111827); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s ease; box-shadow: -8px 0 24px rgba(0, 0, 0, .18); }
.shop-drawer-overlay.is-open .shop-drawer { transform: none; }
.shop-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--color-border); }
.shop-drawer-head h2 { margin: 0; font-size: 1.15rem; }
.shop-drawer-close { background: none; border: 0; font-size: 1.8rem; line-height: 1; cursor: pointer; color: inherit; }
.shop-drawer-items { flex: 1; overflow-y: auto; padding: 4px 18px; }
.shop-drawer-empty { text-align: center; color: var(--color-muted); padding: 40px 18px; margin: 0; }
.shop-drawer-empty[hidden] { display: none; }
.shop-drawer-line { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--color-border); align-items: start; }
.shop-drawer-img { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--color-border); }
.shop-drawer-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-drawer-title { color: inherit; text-decoration: none; font-weight: 600; font-size: .92rem; line-height: 1.3; display: block; }
.shop-drawer-sub { color: var(--color-muted); font-size: .8rem; margin-top: 2px; }
.shop-drawer-price { font-size: .88rem; margin-top: 4px; color: var(--color-muted); }
.shop-drawer-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.shop-drawer-line.is-unavailable .shop-drawer-img, .shop-drawer-line.is-unavailable .shop-drawer-title { opacity: .55; }
.shop-qty { display: inline-flex; align-items: center; border: 1px solid var(--color-border); border-radius: var(--radius); }
.shop-qty-btn { width: 30px; height: 32px; background: none; border: 0; cursor: pointer; font-size: 1rem; color: inherit; }
.shop-qty-input { width: 40px; height: 32px; text-align: center; border: 0; border-left: 1px solid var(--color-border); border-right: 1px solid var(--color-border); font-size: .9rem; background: transparent; color: inherit; }
.shop-drawer-line-total { font-weight: 700; font-size: .92rem; }
.shop-drawer-remove { background: none; border: 0; padding: 0; font-size: .78rem; color: var(--color-muted); text-decoration: underline; cursor: pointer; }
.shop-drawer-error { padding: 0 18px; color: #ef4444; font-size: .85rem; min-height: 0; }
.shop-drawer-foot { padding: 14px 18px 18px; border-top: 1px solid var(--color-border); display: flex; flex-direction: column; gap: 8px; }
.shop-drawer-total { display: flex; justify-content: space-between; font-size: 1.05rem; }
.shop-drawer-note { margin: 0; color: var(--color-muted); font-size: .78rem; }

/* thông báo nhỏ */
.shop-toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.shop-toast { background: #111827; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: .9rem; max-width: min(92vw, 420px); box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.shop-toast.is-error { background: #b91c1c; }
@media (prefers-reduced-motion: reduce) { .shop-drawer, .shop-drawer-overlay { transition: none; } }
