/* * Cart + checkout module — generic default styling. * * Deliberately NOT wrapped in a Tailwind-style `@layer`. An earlier version * put these rules in `@layer bbk-checkout`, positioned (via a cross-file * @layer ordering statement) to sit between Tailwind's `base` and * `components` — in theory enough to beat Preflight's element resets while * still losing to a host override. In practice a build tool processing each * CSS file in isolation (Vite/Lightning CSS here) optimizes away exactly the * cross-file ordering information that trick depends on, so it silently * didn't work: Preflight's `button { background-color: transparent }`, * `* { border-width: 0 }` etc. (layered, in `base`) were beating every * `.bbk-*` rule below regardless of specificity — buttons with no * background, no border, wrong font-size. * * Plain, unlayered CSS sidesteps the whole problem: an unlayered rule always * beats ANY layered rule (Preflight included), full stop, no ordering tricks, * nothing a bundler can silently invalidate. This file is loaded BEFORE the * host's own stylesheet (see the @vite call in the layout ), so: * * - a later PLAIN (unlayered) `.bbk-*` rule in the host stylesheet wins — * same specificity, later in source order * - a later host rule with a MORE specific selector wins regardless * - a host rule inside `@layer components`/`@layer utilities` does NOT * win — unlayered always beats layered. Theme this module from plain * rules in app.css, not from inside a Tailwind layer. * * Two ways to theme this, cheapest first: * * 1. Redefine the --bbk-* custom properties below (from :root, or scoped to * .bbk-cart for a cart-only override) — covers colour, radius, shadow, * font without touching a single selector below. * * :root { --bbk-color-accent: var(--color-brand); --bbk-radius: 0; } * * 2. Override individual `.bbk-*` rules directly (as plain rules, per * above) for anything structural (spacing, layout) the variables don't * cover. * * This file's own look is a deliberately neutral placeholder — inoffensive, * not "designed" — so a project always has something reasonable before it * themes; it is not meant to be edited per project. */ :root { --bbk-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; --bbk-color-text: #18181b; --bbk-color-muted: #71717a; --bbk-color-bg: #ffffff; --bbk-color-bg-muted: #f4f4f5; --bbk-color-border: #e4e4e7; --bbk-color-accent: #18181b; --bbk-color-accent-text: #ffffff; --bbk-color-danger: #dc2626; --bbk-color-info: #2563eb; --bbk-radius: 8px; --bbk-radius-sm: 4px; --bbk-shadow: 0 12px 32px rgba(0, 0, 0, 0.16); /* Icons (.bbk-icon) are CSS masks filled with currentColor, so they follow the element's colour (hover, theme). Swap one by pointing its variable at any single-colour SVG — the shape is what counts, not its fill: :root { --bbk-icon-remove: url("/images/icons/bin.svg"); } */ --bbk-icon-remove: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6M10 11v6M14 11v6'/%3E%3C/svg%3E"); --bbk-icon-shipping: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h11v10H3zM14 9h4l3 3v4h-7z'/%3E%3Ccircle cx='7' cy='17.5' r='1.75'/%3E%3Ccircle cx='17' cy='17.5' r='1.75'/%3E%3C/svg%3E"); --bbk-icon-billing: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3h14v18l-2.33-1.5L14.33 21 12 19.5 9.67 21l-2.34-1.5L5 21z'/%3E%3Cpath d='M9 8h6M9 12h6M9 16h3'/%3E%3C/svg%3E"); --bbk-icon-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3h3.5l1.5 4.5-2.25 1.5a11 11 0 0 0 7.25 7.25L16.5 14l4.5 1.5V19a2 2 0 0 1-2 2A16 16 0 0 1 3 5a2 2 0 0 1 2-2z'/%3E%3C/svg%3E"); /* Payment options, keyed by payment driver; --bbk-icon-payment is the fallback for any driver without its own icon. */ --bbk-icon-payment: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 7V5a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V6'/%3E%3Cpath d='M17 14h.01'/%3E%3C/svg%3E"); --bbk-icon-payment-stripe: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='5' width='19' height='14' rx='2'/%3E%3Cpath d='M2.5 10h19'/%3E%3C/svg%3E"); --bbk-icon-payment-cash-on-delivery: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='6' width='19' height='12' rx='2'/%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3Cpath d='M6 12h.01M18 12h.01'/%3E%3C/svg%3E"); --bbk-icon-payment-bank-transfer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9.5 12 4l9 5.5M4 20h16M5 10v7M9.67 10v7M14.33 10v7M19 10v7'/%3E%3C/svg%3E"); } .bbk-cart[hidden] { display: none; } .bbk-cart { position: fixed; inset: 0; z-index: 1000; font-family: var(--bbk-font); font-size: 0.9375rem; line-height: 1.4; color: var(--bbk-color-text); } .bbk-cart-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4); opacity: 0; transition: opacity 0.25s ease; } .bbk-cart[data-bbk-cart-state="open"] .bbk-cart-backdrop { opacity: 1; } .bbk-cart-panel { position: absolute; top: 0; right: 0; display: flex; flex-direction: column; width: min(420px, 100vw); height: 100%; background: var(--bbk-color-bg); box-shadow: var(--bbk-shadow); transform: translateX(100%); transition: transform 0.25s ease; } .bbk-cart[data-bbk-cart-state="open"] .bbk-cart-panel { transform: translateX(0); } .bbk-cart-panel-header { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.5rem 1.5rem 1.25rem; border-bottom: 1px solid var(--bbk-color-border); } .bbk-cart-heading { margin: 0; font-size: 1.375rem; font-weight: 700; } .bbk-cart-dismiss, .bbk-cart-item-remove, .bbk-cart-qty-btn { cursor: pointer; background: none; border: 0; padding: 0; font: inherit; line-height: 1; color: var(--bbk-color-muted); transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; } .bbk-cart-dismiss { font-size: 1.75rem; width: 2.5rem; height: 2.5rem; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--bbk-radius-sm); flex-shrink: 0; } .bbk-cart-dismiss:hover { color: var(--bbk-color-text); background: var(--bbk-color-bg-muted); } .bbk-cart-item-remove:hover { color: var(--bbk-color-danger); } .bbk-cart-dismiss:focus-visible, .bbk-cart-item-remove:focus-visible, .bbk-cart-qty-btn:focus-visible, .bbk-cart-qty-input:focus-visible, .bbk-cart-checkout:focus-visible, .bbk-cart-coupon-input:focus-visible, .bbk-cart-coupon-submit:focus-visible, .bbk-cart-coupon-remove:focus-visible { outline: 2px solid var(--bbk-color-accent); outline-offset: 2px; } /* Programmatic focus targets only (tabindex=-1) — never reached by Tab, so no ring needed. */ .bbk-cart-heading:focus, .bbk-checkout-summary-heading:focus { outline: none; } /* Generic masked icon: `