/*
 * admin_chrome.css — ẩn admin chrome cho non-internal user trên satellite storefront.
 *
 * ========================== RULE CỨNG (CUT IN STONE) ==========================
 *
 * 1. CHỈ dùng pattern `body:not([data-cap-X="1"]) [data-admin-chrome="X"] { display: none !important; }`.
 *    Khi cap bật ([data-cap-X="1"] trên body) → KHÔNG có rule nào áp dụng → element
 *    giữ NGUYÊN display đã styled trong CSS gốc của template (inline-flex, table-cell,
 *    flex, ...). KHÔNG reset về user-agent default.
 *
 * 2. TUYỆT ĐỐI KHÔNG dùng:
 *    - `display: revert !important`     ← reset về user-agent default, phá inline-flex/flex/table-cell.
 *    - `display: revert-layer !important`
 *    - `display: unset !important`
 *    - Bất kỳ `display: <value> !important` nào trong file này (ngoài `none`).
 *
 * 3. Mỗi cap mới phải đồng bộ ở 3 chỗ — KHÔNG được làm thiếu chỗ nào:
 *    (a) /account/whoami `caps` dict (modules/shop_checkout_routes_account.py).
 *    (b) 1 rule `:not()` mới trong file này.
 *    (c) `_ADMIN_CHROME_CAPS` set trong scripts/admin_chrome_guard.py.
 *
 * 4. Trước MỌI commit đụng file này / file template chứa `data-admin-chrome` /
 *    `/account/whoami` caps, phải chạy: `python3 scripts/admin_chrome_guard.py` PASS.
 *    Đây là điều kiện cứng — deploy.sh tự gọi guard, sẽ abort nếu FAIL.
 *
 * ============================ LỊCH SỬ BUG ===================================
 *
 * Commit f41981cf (Ca 1 foundation) dùng `display: revert !important` để reveal admin
 * chrome. Khi `.category-quick-edit` (gốc `inline-flex`, 40×40 glass circle) bị reveal:
 * revert thành `inline` (mặc định <a>), mất width/height/centering → buttons biến thành
 * circle to bự lệch hàng. User thấy "icons phá banh" — báo cáo 2026-06-07.
 *
 * Sửa: thay toàn bộ rule bằng pattern `:not()` (chỉ ẩn khi cap chưa bật, KHÔNG ghi đè
 * display gốc khi reveal). Pattern này đúng theo MDN Pattern «.show-when-cap».
 *
 * ============================================================================
 */

body:not([data-cap-edit-product="1"]) [data-admin-chrome="edit_product"] { display: none !important; }
body:not([data-cap-edit-variant-table="1"]) [data-admin-chrome="edit_variant_table"] { display: none !important; }
body:not([data-cap-edit-banner="1"]) [data-admin-chrome="edit_banner"] { display: none !important; }
body:not([data-cap-edit-category="1"]) [data-admin-chrome="edit_category"] { display: none !important; }
body:not([data-cap-view-gbn-bar="1"]) [data-admin-chrome="view_gbn_bar"] { display: none !important; }
