/*
 * LC Médical — Comptoir : design tokens.
 * World: brand-navy drawer fronts and dark bands on a white / cool shelf-grey wall, bright-blue-outlined label holders
 * framing white paper labels, ink #111827. Medical blue is the ACTION colour (buttons, links, selected states, focus);
 * navy is the brand (logo, dark bands, footer, drawer fronts); red lives ONLY in the logo, error states and real
 * promotions (sale badge, sale price, the promotions band);
 * confirmation green is for good news (stock, free delivery, WhatsApp, availability).
 * Logical properties only (RTL ready for Arabic, Phase 4).
 * Every colour pair used for text is listed with its contrast in FOUNDATION.md.
 */
:root {
	color-scheme: light;

	/* ---------- Brand navy (drawer fronts, dark bands, footer, category hero) ---------- */
	--lc-navy-950: #070d2b;
	--lc-navy-900: #0d1850; /* footer navy */
	--lc-navy-800: #14246b; /* Label & Confort navy: drawer fronts, secondary action */
	--lc-navy-700: #1c2e86;
	--lc-navy-600: #2a3c9c;
	--lc-navy-500: #4558b5;
	--lc-navy-300: #9aa6d9;
	--lc-navy-200: #c7ceea; /* text on navy */
	--lc-navy-100: #e1e6f6;
	--lc-navy-50: #eef1fb;

	/* ---------- Shelf (page ground), counter, paper ---------- */
	--lc-shelf: #f4f5f7; /* shelf grey: page ground */
	--lc-shelf-2: #eceef2; /* bands, wells */
	--lc-shelf-3: #e5e7eb;
	--lc-stone: #e8ebf0; /* cool counter top */
	--lc-stone-2: #d1d5db; /* flat solid edge of the counter */
	--lc-paper: #ffffff; /* label paper */
	--lc-paper-2: #f9fafb;

	/* ---------- Ink ---------- */
	--lc-ink: #111827;
	--lc-ink-2: #1f2937;
	--lc-ink-muted: #4b5563; /* secondary text */
	--lc-ink-faint: #6b7280; /* lightest text allowed: placeholders, captions (white / paper grounds only) */
	--lc-line: #e5e7eb; /* decorative hairlines (no contrast requirement) */
	--lc-line-strong: #6b7280; /* control borders, at least 3:1 */

	/* ---------- Medical blue: the ACTION colour ----------
	   500 bright: icons, round icon discs, large figures (>= 24px) on white, accents and outlines on navy. NEVER a text or
	       button fill (white on it is 3.35:1).
	   600 action: button fill (white text 4.82:1), selected / checked fills.
	   700 hover: link text and outline-button text (5.54:1 on white, 5.08:1 on shelf grey), button hover.
	   800 active: pressed state, link hover. */
	--lc-blue-500: #2490eb;
	--lc-blue-600: #1b74c6;
	--lc-blue-700: #176ab8;
	--lc-blue-800: #145fa6;
	--lc-blue-100: #e3f0fc; /* round icon disc on white */
	--lc-blue-50: #f3faff; /* pale-blue ground band, hover wash */

	/* ---------- Red: the logo heartbeat, error states and REAL promotions (a WooCommerce sale price). Never a button. ---------- */
	--lc-red: #d91e2a; /* logo pulse on light grounds */
	--lc-red-on-dark: #d91e2a; /* logo pulse on navy (logos are exempt from text contrast) */
	--lc-red-ink: #b3101e; /* error text on light */
	--lc-red-tint: #fdecee; /* error background */
	--lc-promo: #c8102e; /* sale badge fill: white bold label 5.9:1 */
	--lc-promo-ink: #b3101e; /* sale price on white 6.6:1 (the saving line is good-news green) */

	/* Deprecated alias (home.css, drawer label, pull bar still read it): the old coral accent is now bright blue. */
	--lc-coral: var(--lc-blue-500);

	/* ---------- Confirmation green: good news (stock, free delivery, WhatsApp, availability) ---------- */
	--lc-ok: #0e7c55; /* fill, icon, border */
	--lc-ok-hover: #0b5e40;
	--lc-ok-deep: #0b5e40; /* text on tint or paper */
	--lc-ok-bg: #e6f4ee;
	--lc-ok-line: #a6d9c3;

	/* ---------- Warning, error ---------- */
	--lc-warn: #92400e;
	--lc-warn-bg: #fef3c7;
	--lc-warn-line: #f5d88a;
	--lc-err: var(--lc-red-ink);
	--lc-err-bg: var(--lc-red-tint);
	--lc-err-line: #eba9ad;

	/* ---------- Tints for themed panels ---------- */
	--lc-tint-sky: #eaf0ff;
	--lc-tint-mint: var(--lc-ok-bg);
	--lc-tint-rose: var(--lc-red-tint); /* errors only */
	--lc-tint-blue: var(--lc-blue-50);
	--lc-tint-sand: #fdf3e1;

	/* ---------- Semantic aliases ---------- */
	--lc-bg: var(--lc-shelf);
	--lc-surface: var(--lc-paper);
	--lc-text: var(--lc-ink);
	--lc-text-muted: var(--lc-ink-muted);
	/* Action: medical blue fill, white label (4.82:1). Every button, selected state and checked control uses it. */
	--lc-action: var(--lc-blue-600);
	--lc-action-hover: var(--lc-blue-700);
	--lc-action-active: var(--lc-blue-800);
	--lc-on-action: #ffffff;
	/* Accent: bright blue for icons, discs, large figures and outlines on navy. Never text, never a button fill. */
	--lc-accent: var(--lc-blue-500);
	/* Secondary solid (dark band controls): navy. Kept for .lc-btn--navy. */
	--lc-action-2: var(--lc-navy-800);
	--lc-action-2-hover: var(--lc-navy-700);
	--lc-action-2-active: var(--lc-navy-900);
	/* Link text: 700 blue (5.54:1 on white, 5.08:1 on shelf grey); hover goes one step darker. */
	--lc-link: var(--lc-blue-700);
	--lc-link-hover: var(--lc-blue-800);

	/* Focus: medical blue on light grounds (4.82:1 on white) with a paper halo, white on navy (see .lc-on-dark). */
	--lc-focus: var(--lc-blue-600);
	--lc-focus-halo: var(--lc-paper);

	/* Plugin bridge: lc-core and lc-b2b read these variables. */
	--lc-border: var(--lc-line-strong);
	--lc-soft: var(--lc-navy-100);

	/* ---------- Typography ---------- */
	/* Labels and headings: Barlow Semi Condensed (stamped-plate / engraved-label lettering).
	   Text: Atkinson Hyperlegible Next (pharmacy-grade character distinction: 0/O, I/l/1). */
	--lc-font-label: 'Barlow Semi Condensed', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
	--lc-font-text: 'Atkinson Hyperlegible Next', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
	/* Phase 4: Arabic label slot, falls back to the system Arabic face until a webfont is chosen. */
	--lc-font-label-ar: 'Noto Kufi Arabic', 'Segoe UI', Tahoma, sans-serif;

	--lc-fs-xs: 0.8125rem; /* 13px: labels */
	--lc-fs-sm: 0.9375rem; /* 15px */
	--lc-fs-base: 1rem; /* 16px: body */
	--lc-fs-md: 1.125rem;
	--lc-fs-lg: 1.375rem;
	--lc-fs-h5: 1.125rem;
	--lc-fs-h4: 1.375rem;
	--lc-fs-h3: clamp(1.5rem, 1.35rem + 0.6vw, 1.875rem);
	--lc-fs-h2: clamp(1.875rem, 1.5rem + 1.6vw, 2.875rem);
	--lc-fs-h1: clamp(2.375rem, 1.7rem + 3vw, 4.25rem);
	--lc-lh-tight: 1.05;
	--lc-lh-head: 1.12;
	--lc-lh-body: 1.6;
	--lc-track-label: 0.08em;
	--lc-measure: 68ch;

	/* ---------- Space: everything sits on the drawer module (8px) ---------- */
	--lc-mod: 8px;
	--lc-s-1: 4px;
	--lc-s-2: 8px;
	--lc-s-3: 12px;
	--lc-s-4: 16px;
	--lc-s-5: 24px;
	--lc-s-6: 32px;
	--lc-s-7: 48px;
	--lc-s-8: 64px;
	--lc-s-9: 96px;
	--lc-s-10: 128px;

	--lc-container: 1320px;
	--lc-gutter: clamp(16px, 2.2vw, 32px);
	--lc-gap: clamp(12px, 1.6vw, 24px); /* gap between drawer fronts */
	--lc-section: clamp(48px, 6vw, 96px);

	/* ---------- Radii ---------- */
	--lc-r-label: 2px; /* paper label */
	--lc-r-holder: 4px; /* label holder */
	--lc-r-drawer: 6px; /* drawer front */
	--lc-r-field: 4px;
	--lc-r-sheet: 12px; /* bottom sheet, dialog */
	--lc-r-pill: 999px;

	/* ---------- Controls: ONE scale for buttons, fields and steppers (measured from the home: hero CTA 56, card CTA 48
	   (44 on a narrow card), pro-strip / WhatsApp / section buttons 56). Heights are minimums; the button label sets the
	   width. Where each size is used is tabulated in FOUNDATION.md. ---------- */
	--lc-ctl-sm: 44px; /* compact: filters, table and toolbar actions, tags, narrow cards. Never below the 44px tap size */
	--lc-ctl-md: 48px; /* default: card CTA, fields, coupon, secondary rows, forms */
	--lc-ctl-lg: 56px; /* page-level primary: hero, pro strip, WhatsApp band, PDP add to cart, cart and checkout CTA */
	--lc-ctl-r: var(--lc-r-field); /* 4px: buttons, fields, steppers and cards' inner controls share it */
	--lc-ctl-bw: 1.5px; /* field, stepper and outline-button border */
	--lc-ctl-border: var(--lc-line-strong); /* 4.8:1 on paper */
	--lc-ctl-border-hover: var(--lc-ink-muted);
	--lc-ctl-border-focus: var(--lc-action);
	--lc-ctl-bg: var(--lc-paper);
	--lc-ctl-px: 0.9em; /* field inline padding */
	--lc-ctl-fs: 1rem; /* field text: 16px (no iOS zoom) */
	/* Button label: Barlow Semi Condensed 700 uppercase, tracked. Font size, tracking, inline and block padding per size. */
	--lc-btn-fw: 700;
	--lc-btn-lh: 1.15;
	--lc-btn-gap: 0.6em;
	--lc-btn-sm-fs: 0.875rem; /* 14px */
	--lc-btn-sm-ls: 0.05em;
	--lc-btn-sm-px: 1.1em;
	--lc-btn-sm-py: 0.45em;
	--lc-btn-md-fs: 0.9375rem; /* 15px */
	--lc-btn-md-ls: 0.06em;
	--lc-btn-md-px: 1.5em;
	--lc-btn-md-py: 0.6em;
	--lc-btn-lg-fs: 1rem; /* 16px */
	--lc-btn-lg-ls: 0.06em;
	--lc-btn-lg-px: 2em;
	--lc-btn-lg-py: 0.7em;

	/* ---------- Depth: honest flat lacquer. A closed drawer and a button are flat fields; real depth (offset + soft
	   blur) only exists where something is pulled forward: the drawer, the panel, a dialog. No inset bevel, no sheen. ---------- */
	--lc-shadow-flush: 0 0 0 0 transparent;
	--lc-shadow-label: 0 0 0 0 transparent;
	--lc-shadow-lacquer: 0 0 0 0 transparent;
	--lc-shadow-pulled: 0 18px 28px -12px rgb(20 36 107 / 0.42), 0 6px 10px -4px rgb(20 36 107 / 0.22);
	--lc-shadow-panel: 0 28px 48px -18px rgb(20 36 107 / 0.4), 0 10px 18px -8px rgb(20 36 107 / 0.2);
	--lc-shadow-bar: 0 12px 18px -14px rgb(20 36 107 / 0.5);
	--lc-shadow-up: 0 -10px 18px -14px rgb(20 36 107 / 0.45);

	/* ---------- Motion: the drawer slide (exponential ease-out) ---------- */
	--lc-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
	--lc-dur-fast: 120ms;
	--lc-dur-med: 240ms;
	--lc-dur-drawer: 520ms;

	/* ---------- Breakpoints (documentation: CSS variables cannot drive @media).
	   They match Blocksy's own switches so that its WooCommerce layouts and our header agree.
	   mobile <= 689.98px, tablet <= 999.98px, desktop >= 1000px, wide >= 1280px. ---------- */
	--lc-bp-sm: 690px;
	--lc-bp-md: 1000px;
	--lc-bp-lg: 1280px;

	/* ---------- Chrome geometry (kept in sync by ui.js, CSS fallbacks here) ---------- */
	--lc-util-h: 36px; /* utility strip, desktop only */
	--lc-sign-h: 76px;
	--lc-depts-h: 48px;
	--lc-tabbar-h: 60px;
	--lc-hd-h: 124px; /* measured by ui.js: the sticky part of the header */
	--lc-sticky-top: var(--lc-hd-h); /* offset for sticky sidebars / buy bars */
	--lc-tap: 44px; /* minimum target size */
	--lc-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Mobile geometry: the logo row scrolls away, the search row stays. */
@media (max-width: 999.98px) {
	:root {
		--lc-sign-h: 60px;
		--lc-hd-h: 64px;
	}
}

/* ---------- Blocksy bridge: Blocksy renders cart, checkout and grids with these variables ---------- */
:root {
	--theme-palette-color-1: var(--lc-blue-600);
	--theme-palette-color-2: var(--lc-blue-700);
	--theme-palette-color-3: var(--lc-ink);
	--theme-palette-color-4: var(--lc-ink);
	--theme-palette-color-5: var(--lc-line);
	--theme-palette-color-6: var(--lc-stone);
	--theme-palette-color-7: var(--lc-shelf);
	--theme-palette-color-8: var(--lc-paper);

	--theme-text-color: var(--lc-ink);
	--theme-headings-color: var(--lc-ink);
	--theme-link-initial-color: var(--lc-link);
	--theme-link-hover-color: var(--lc-link-hover);
	--theme-border-color: var(--lc-line);
	--theme-selection-text-color: var(--lc-ink);
	--theme-selection-background-color: var(--lc-blue-100);

	--theme-font-family: var(--lc-font-text);
	--theme-font-weight: 400;
	--theme-font-size: 16px;
	--theme-line-height: 1.6;

	--theme-button-font-weight: var(--lc-btn-fw);
	--theme-button-font-size: 15px; /* = --lc-btn-md-fs */
	--theme-button-min-height: var(--lc-ctl-md);
	--theme-button-padding: 0 var(--lc-btn-md-px);
	/* Generic Woo/Blocksy buttons are medical blue (same as .lc-btn). */
	--theme-button-text-initial-color: var(--lc-on-action);
	--theme-button-text-hover-color: var(--lc-on-action);
	--theme-button-background-initial-color: var(--lc-action);
	--theme-button-background-hover-color: var(--lc-action-hover);
	--theme-button-border: none;
	--theme-button-border-radius: var(--lc-ctl-r);
	--theme-button-font-family: var(--lc-font-label);
	--theme-button-text-transform: uppercase;
	--theme-button-letter-spacing: var(--lc-btn-md-ls);
	--theme-button-shadow: none;

	--theme-form-field-border-initial-color: var(--lc-line-strong);
	--theme-form-field-border-focus-color: var(--lc-action);
	--theme-form-selection-field-initial-color: var(--lc-line-strong);
	--theme-form-selection-field-active-color: var(--lc-action);
	--theme-form-field-height: var(--lc-ctl-md);
	--theme-form-field-border-width: var(--lc-ctl-bw);
	--theme-form-field-border-radius: var(--lc-ctl-r);
	--theme-form-border-radius: var(--lc-ctl-r);
	--theme-form-font-size: 16px;
	--theme-form-text-initial-color: var(--lc-ink);
	--theme-form-text-focus-color: var(--lc-ink);
	--theme-form-field-background-initial-color: var(--lc-paper);
	--theme-form-field-background-focus-color: var(--lc-paper);

	--theme-normal-container-max-width: var(--lc-container);
	--theme-container-edge-spacing: calc(100vw - 2 * var(--lc-gutter));
	--theme-content-vertical-spacing: var(--lc-section);
	--theme-wide-offset: 0px;
	--header-height: var(--lc-hd-h);
}

/* ---------- Dark lacquer surfaces (footer, sign strip, dark panels) ---------- */
.lc-on-dark {
	--lc-focus: #ffffff;
	--lc-focus-halo: var(--lc-navy-950);
	--lc-text: #ffffff;
	--lc-text-muted: var(--lc-navy-200); /* 10.6:1 on navy-900 */
	--lc-link: #ffffff;
	--lc-link-hover: var(--lc-navy-200);
	--lc-accent: var(--lc-blue-500); /* 4.96:1 on navy-900 */
	--lc-line: rgb(255 255 255 / 0.16);
	--theme-text-color: var(--lc-text);
	--theme-link-initial-color: var(--lc-link);
	--theme-link-hover-color: var(--lc-link-hover);
	color: var(--lc-text);
}

/* ---------- Browser surfaces: the parts nobody draws ---------- */
html {
	accent-color: var(--lc-action);
	caret-color: var(--lc-action);
	scrollbar-color: var(--lc-navy-600) var(--lc-shelf-2);
	scrollbar-width: auto;
	-webkit-tap-highlight-color: rgb(27 116 198 / 0.14);
	text-size-adjust: 100%;
	hanging-punctuation: first;
}

::selection {
	background: var(--lc-blue-100);
	color: var(--lc-ink);
}

.lc-on-dark ::selection {
	background: var(--lc-navy-200);
	color: var(--lc-navy-950);
}

::marker {
	color: var(--lc-action);
}

::placeholder {
	color: var(--lc-ink-faint);
	opacity: 1;
}

::file-selector-button {
	font: inherit;
	font-weight: 700;
	margin-inline-end: var(--lc-s-3);
	padding: 0.5em 1em;
	border: 1.5px solid var(--lc-action);
	border-radius: var(--lc-r-field);
	background: var(--lc-paper);
	color: var(--lc-link);
	cursor: pointer;
}

::-webkit-scrollbar {
	inline-size: 12px;
	block-size: 12px;
}

::-webkit-scrollbar-track {
	background: var(--lc-shelf-2);
}

::-webkit-scrollbar-thumb {
	background: var(--lc-navy-600);
	border: 3px solid var(--lc-shelf-2);
	border-radius: var(--lc-r-pill);
}

::-webkit-scrollbar-thumb:hover {
	background: var(--lc-navy-700);
}

mark {
	background: var(--lc-navy-100);
	color: var(--lc-ink);
	padding-inline: 0.15em;
}

/* One numeral voice. Atkinson's zero is slashed and cannot be switched off, which reads as a stray mark in a price, an
   hour or a phone number; so figures that carry meaning (prices, hours, phones, years, quantities, cart counts) are
   set in the label face: Barlow Semi Condensed, tabular lining. `.lc-num` is the utility; prices, Woo amounts and Woo's tax
   lines (`small.includes_tax`: "(dont 413,33 DH TVA 20 %)") follow it, whole. Generated prose goes through
   lc_theme_num_html() / lc_theme_amount_html() so figures, units and percentages share the voice. */
.lc-num,
.lc-phone,
.price,
.amount,
.woocommerce-Price-amount,
.lc-cart-count,
.includes_tax,
.woocommerce-price-suffix,
.tax_label,
input[type='number'],
.quantity input,
time {
	font-family: var(--lc-font-label);
	font-variant-numeric: tabular-nums lining-nums;
	font-feature-settings: 'tnum' 1, 'lnum' 1;
}

.lc-num,
.lc-phone {
	font-weight: 600;
	letter-spacing: 0.02em;
}

table,
.quantity {
	font-variant-numeric: tabular-nums lining-nums;
}

@media (prefers-reduced-motion: reduce) {
	:root {
		--lc-dur-fast: 0.01ms;
		--lc-dur-med: 0.01ms;
		--lc-dur-drawer: 0.01ms;
	}

	html {
		scroll-behavior: auto !important;
	}
}
