/* Accessibility button, its settings panel (views/partials/a11y.ejs, public/js/a11y.js) and what each setting does.
   Every setting is a class on <html> (public/js/a11y-init.js) and nothing here touches the page while every setting is off. */

/* ---------- the button: bottom-right corner, lifted above whatever else sits there (--a11y-lift, set by a11y.js) ---------- */
.a11y { --a11y-size: 52px; --a11y-edge: 20px; --a11y-lift: 0px; }
.a11y-launch { position: fixed; z-index: 180; right: calc(var(--a11y-edge) + env(safe-area-inset-right, 0px)); bottom: calc(var(--a11y-edge) + env(safe-area-inset-bottom, 0px) + var(--a11y-lift));
  width: var(--a11y-size); height: var(--a11y-size); border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--blue, #1569E6); color: #fff; border: 2px solid #fff; box-shadow: 0 .25rem .875rem rgba(11, 36, 71, .28); transition: bottom .18s ease, background-color .15s; }
.a11y-launch:hover { background: #0f58c8; }
.a11y-launch:focus-visible { outline: 3px solid var(--navy, #0B2447); outline-offset: 3px; border-radius: 50%; box-shadow: 0 0 0 6px #fff, 0 .25rem .875rem rgba(11, 36, 71, .28); }
.a11y-launch[aria-expanded="true"] { background: var(--navy, #0B2447); }
.a11y-figure { width: 30px; height: 30px; fill: currentColor; }
@media (max-width: 640px) { .a11y { --a11y-size: 48px; --a11y-edge: 14px; } .a11y-figure { width: 28px; height: 28px; } }

/* ---------- the panel ---------- */
.a11y-panel { position: fixed; z-index: 185; right: calc(var(--a11y-edge) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--a11y-edge) + env(safe-area-inset-bottom, 0px) + var(--a11y-lift) + var(--a11y-size) + 12px);
  width: min(23rem, calc(100vw - 2 * var(--a11y-edge))); max-height: calc(100vh - var(--a11y-edge) - var(--a11y-lift) - var(--a11y-size) - 28px);
  max-height: calc(100dvh - var(--a11y-edge) - var(--a11y-lift) - var(--a11y-size) - 28px); overflow-y: auto; overscroll-behavior: contain;
  background: #fff; color: var(--text, #16284C); border: 1px solid var(--line, #D9E2F0); border-radius: var(--r-card, .5rem); box-shadow: var(--shadow, 0 .5rem 1.75rem rgba(11, 36, 71, .14));
  padding: 1rem 1.125rem 1.125rem; font-family: var(--font); font-size: 1rem; line-height: 1.45; text-align: left; }
.a11y-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.a11y-title { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-size: 1.25rem; font-weight: 800; color: var(--navy, #0B2447); line-height: 1.2; }
.a11y-close { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: -.5rem -.625rem -.5rem 0; border-radius: 50%; color: var(--navy, #0B2447); }
.a11y-close:hover { background: var(--tint, #E9EFFC); }
.a11y-close .ic { width: 1.25rem; height: 1.25rem; }
.a11y-desc { margin: .375rem 0 .875rem; font-size: .875rem; color: var(--muted, #5B6B88); }
.a11y-size { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem .75rem; padding: .5rem .5rem .5rem .875rem; background: var(--card, #EEF3FB); border-radius: var(--r, .375rem); }
.a11y-size-label { font-weight: 700; color: var(--navy, #0B2447); }
.a11y-size-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .375rem; }
.a11y-step { min-width: 44px; min-height: 44px; padding: 0 .5rem; border-radius: var(--r, .375rem); background: #fff; border: 1.5px solid var(--line, #D9E2F0); color: var(--navy, #0B2447); font-weight: 800; font-size: 1rem; }
.a11y-step:hover { border-color: var(--navy, #0B2447); }
.a11y-step[aria-disabled="true"] { color: #8593AB; border-color: var(--line, #D9E2F0); cursor: not-allowed; }
.a11y-size-value { min-width: 3.25rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.a11y-list { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .5rem; }
.a11y-toggle { display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%; min-height: 48px; padding: .5rem .75rem .5rem .875rem;
  border-radius: var(--r, .375rem); background: var(--card, #EEF3FB); border: 1.5px solid transparent; color: var(--navy, #0B2447); font-weight: 700; text-align: left; }
.a11y-toggle:hover { border-color: var(--line, #D9E2F0); }
.a11y-toggle[aria-pressed="true"] { background: var(--blue-soft, #E3EDFD); border-color: var(--blue, #1569E6); }
.a11y-switch { position: relative; flex: none; width: 2.75rem; height: 1.5rem; border-radius: 1rem; background: #8593AB; transition: background-color .15s; }
.a11y-switch::after { content: ""; position: absolute; top: .1875rem; left: .1875rem; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: #fff; transition: transform .15s; }
.a11y-toggle[aria-pressed="true"] .a11y-switch { background: var(--blue, #1569E6); }
.a11y-toggle[aria-pressed="true"] .a11y-switch::after { transform: translateX(1.25rem); }
.a11y-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; margin-top: 1rem; }
.a11y-reset { min-height: 44px; }
.a11y-statement { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; text-decoration: underline; text-underline-offset: .15em; }
.a11y-panel p, .a11y-toggle, .a11y-statement { overflow-wrap: anywhere; }
.a11y-panel :focus-visible { outline: 3px solid var(--blue, #1569E6); outline-offset: 2px; }
@media (max-width: 640px) { .a11y-panel { left: var(--a11y-edge); right: var(--a11y-edge); width: auto; padding: .875rem 1rem 1rem; } }
@media print { .a11y { display: none !important; } }
@media (forced-colors: active) { .a11y-launch, .a11y-panel, .a11y-toggle, .a11y-step { border: 2px solid CanvasText; } .a11y-toggle[aria-pressed="true"] .a11y-switch { background: Highlight; } }

/* ---------- text size: the whole page is sized in rem, so the root size scales text and spacing together ---------- */
html.a11y-text-1 { font-size: 115%; } html.a11y-text-2 { font-size: 130%; } html.a11y-text-3 { font-size: 150%; }
@media (min-width: 901px) {
  html.a11y-text-1 { font-size: calc(clamp(14px, calc(.686vw + 6.97px), 16px) * 1.15); }
  html.a11y-text-2 { font-size: calc(clamp(14px, calc(.686vw + 6.97px), 16px) * 1.3); }
  html.a11y-text-3 { font-size: calc(clamp(14px, calc(.686vw + 6.97px), 16px) * 1.5); }
}
/* long words and prices wrap instead of running out of their boxes */
html[class*="a11y-text-"] body { overflow-wrap: break-word; }

/* ---------- high contrast: darker text, links and lines, white page; the orange buttons get a darker orange that passes with white text ---------- */
html.a11y-contrast { --text: #0A1530; --muted: #2B3A57; --blue: #0A4BB0; --blue-bright: #0A4BB0; --line: #6E7F9E; --line-soft: #8A99B5;
  --page: #fff; --tint: #fff; --card: #fff; --orange: #A84F00; --orange-dark: #8A4000; --navy-soft: #0B2447; }
html.a11y-contrast body { background: #fff; }
html.a11y-contrast .product-card, html.a11y-contrast .a11y-toggle, html.a11y-contrast .a11y-size { border: 1.5px solid #6E7F9E; }
html.a11y-contrast .input, html.a11y-contrast .select, html.a11y-contrast .textarea { border-color: #4A5A78; }
html.a11y-contrast ::placeholder { color: #4A5A78; opacity: 1; }
html.a11y-contrast .hero::before { background: linear-gradient(90deg, rgba(255, 255, 255, .86) 0%, rgba(255, 255, 255, .72) 36%, rgba(255, 255, 255, 0) 62%); }
html.a11y-contrast .site-footer, html.a11y-contrast .announce { background: #000c24; }
html.a11y-contrast .site-footer a, html.a11y-contrast .site-footer p, html.a11y-contrast .footer-bottom { color: #fff; }
html.a11y-contrast .btn[disabled] { background: #5B6B88; }
html.a11y-contrast :focus-visible { outline: 3px solid #000; outline-offset: 2px; box-shadow: 0 0 0 5px #fff; }

/* ---------- highlight links: every link underlined and outlined ---------- */
html.a11y-links a[href] { text-decoration: underline !important; text-decoration-thickness: .1em !important; text-underline-offset: .18em; outline: 2px solid var(--orange, #FD8204); outline-offset: 2px; }
html.a11y-links a[href].btn, html.a11y-links .product-card a[href], html.a11y-links a[href].logo, html.a11y-links a[href].header-action { text-decoration: none !important; }
html.a11y-links a[href]:focus-visible { outline: 3px solid var(--navy, #0B2447); outline-offset: 3px; }

/* ---------- readable font: a plain system sans-serif with a little more letter, word and line spacing ---------- */
html.a11y-font { --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; --script: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
html.a11y-font body, html.a11y-font button, html.a11y-font input, html.a11y-font select, html.a11y-font textarea,
html.a11y-font h1, html.a11y-font h2, html.a11y-font h3, html.a11y-font h4 { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important; }
html.a11y-font body *:not(svg):not(svg *) { letter-spacing: .03em !important; word-spacing: .1em !important; font-style: normal !important; }
html.a11y-font :is(p, li, dd, dt, label, td, th, blockquote, .prose, .lead) { line-height: 1.7 !important; }

/* ---------- stop animations: no CSS animations, transitions or smooth scrolling (a11y.js and home.js stop the slider) ---------- */
html.a11y-still { scroll-behavior: auto !important; }
html.a11y-still *, html.a11y-still *::before, html.a11y-still *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* ---------- bigger cursor ---------- */
html.a11y-cursor, html.a11y-cursor * { cursor: url(/img/a11y/cursor-arrow.png) 6 3, auto !important; }
html.a11y-cursor :is(a[href], button, summary, label, select, [role="button"], input[type="checkbox"], input[type="radio"], input[type="range"]),
html.a11y-cursor :is(a[href], button, summary, label, [role="button"]) * { cursor: url(/img/a11y/cursor-hand.png) 16 5, pointer !important; }
html.a11y-cursor :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]), textarea) { cursor: url(/img/a11y/cursor-text.png) 24 24, text !important; }
html.a11y-cursor :is(button[disabled], .btn[disabled], [aria-disabled="true"]) { cursor: url(/img/a11y/cursor-arrow.png) 6 3, not-allowed !important; }

/* ---------- keyboard focus rings the shop's own styles took away (only shown on keyboard focus; nothing changes for mouse or touch) ---------- */
.sort select:focus-visible, .price-range:focus-visible, .price-dual input:focus-visible { outline: .1875rem solid rgba(21, 105, 230, .55); outline-offset: 2px; }

/* ---------- the skip link ("Skip to content") stays out of sight until focused however large the text is (it sits 60px above the page,
   less than its own height with large text). Only while a setting is on: without one the page stays exactly as approved ---------- */
html[class*="a11y-"] .skip-link:not(:focus) { top: -20rem; }
html.a11y-links .skip-link:not(:focus) { outline: 0; }
/* ---------- large text on a desktop window: when the menu words no longer fit beside the logo (a11y.js measures it) the header uses its
   phone layout: menu button, logo, icons ---------- */
html.a11y-compact-header .site-header-inner { grid-template-columns: auto 1fr auto; gap: .5rem; }
html.a11y-compact-header .site-header .nav { display: none; }
html.a11y-compact-header .site-header .menu-btn { display: inline-flex; margin-left: -8px; }
/* checkout header on a phone with larger text: "Secure Checkout" goes under the logo instead of off the screen */
@media (max-width: 640px) {
  html[class*="a11y-text-"] .co-header-inner { grid-template-columns: minmax(0, 1fr); }
  html[class*="a11y-text-"] .co-secure { justify-self: start; }
}
/* the logo is the shop's name mark, not text to read: it keeps its own font, spacing and (on phones) its size, so the header icons stay on screen */
html.a11y-font .logo, html.a11y-font .logo * { font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important; letter-spacing: normal !important; word-spacing: normal !important; }
@media (max-width: 900px) {
  html[class*="a11y-text-"] .site-header .logo, html[class*="a11y-text-"] .drawer-head .logo { font-size: 24px; }
  html[class*="a11y-text-"] .site-header .logo .ic, html[class*="a11y-text-"] .drawer-head .logo .ic { width: 36px; height: 36px; }
  html[class*="a11y-text-"] .site-header .header-action { width: 44px; height: 44px; }
  html[class*="a11y-text-"] .site-header .header-action .ic { width: 24px; height: 24px; }
  html[class*="a11y-text-"] .co-header .logo { font-size: 24px; } html[class*="a11y-text-"] .co-header .logo .ic { width: 36px; height: 36px; }
}
/* larger text or wider spacing: button words may wrap and button rows may wrap, rather than running off the screen */
html[class*="a11y-text-"] .btn, html.a11y-font .btn { white-space: normal; max-width: 100%; }
html[class*="a11y-text-"] .pd-actions, html.a11y-font .pd-actions { flex-wrap: wrap; }
html[class*="a11y-text-"] .pd-actions .btn, html.a11y-font .pd-actions .btn { flex: 1 1 9rem; }
/* cart lines on a phone with larger text: price and total side by side, the quantity on its own row */
@media (max-width: 640px) {
  html[class*="a11y-text-"] .cart-table tr.cart-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  html[class*="a11y-text-"] .cart-table td.cart-col-qty { grid-column: 1 / -1; grid-row: 3; justify-self: start; }
  html[class*="a11y-text-"] .cart-table td.cart-col-price { grid-row: 2; grid-column: 1; }
  html[class*="a11y-text-"] .cart-table td.cart-col-total { grid-row: 2; grid-column: 2; }
}
/* the trust strip ("Fast & Reliable Shipping" ...): with larger text the four labels may wrap, and on phones they keep inside their half */
html[class*="a11y-text-"] .trust-strip li span, html.a11y-font .trust-strip li span { white-space: normal !important; min-width: 0; }
html[class*="a11y-text-"] .trust-strip li, html.a11y-font .trust-strip li { min-width: 0; }
@media (max-width: 640px) { html[class*="a11y-text-"] .trust-strip li { gap: .5rem; padding-inline: .25rem; } html[class*="a11y-text-"] .trust-strip .ic { width: 1.5rem; height: 1.5rem; } }
/* with larger text or wider spacing a long word may break rather than push its box off the screen; the "Sort by" row may wrap */
html[class*="a11y-text-"] .cat-strip a, html.a11y-font .cat-strip a, html[class*="a11y-text-"] .trust-strip li span, html.a11y-font .trust-strip li span { overflow-wrap: anywhere; }
html[class*="a11y-text-"] .sort, html.a11y-font .sort { flex-wrap: wrap; }
html[class*="a11y-text-"] .sort select, html.a11y-font .sort select { min-width: 0; max-width: 100%; }
/* the cart table on a wide window with larger text: columns size to their content, so the quantity buttons never run into the total */
@media (min-width: 641px) { html[class*="a11y-text-"] .cart-table, html.a11y-font .cart-table { table-layout: auto; } }
/* photo heroes with larger text: the title may reach further into the photo, so the light veil behind the words goes further too */
@media (min-width: 901px) { html[class*="a11y-text-"]:not(.a11y-contrast) .hero::before { background: linear-gradient(90deg, rgba(255, 255, 255, .8) 0%, rgba(255, 255, 255, .6) 40%, rgba(255, 255, 255, 0) 66%); } }
