/*
 * AICC base layer: fonts, reset, typography, layout primitives, header, footer,
 * skip link, focus, language switcher, accessibility dialog.
 *
 * Rules (see docs/unified-experience/design-system.md):
 *  - semantic tokens only (var(--aicc-*)), never raw hex, except inside SVG data;
 *  - logical properties only (margin-inline, padding-block, inset-inline, text-align: start),
 *    so Hebrew RTL mirrors without a second stylesheet;
 *  - sizes in rem, so the "Larger text" preference scales everything.
 */

/* ── Fonts: self-hosted, variable, no runtime request to any third party ─────────────────── */
@font-face {
	font-family: "Geist";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/geist-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Geist";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/geist-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Geist";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/geist-cyrillic.woff2") format("woff2");
	unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* Geist has no Hebrew glyphs: Heebo (OFL) is the Hebrew face named in the token font stack. */
@font-face {
	font-family: "Heebo";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/heebo-hebrew.woff2") format("woff2");
	unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

/* ── Reset / document ───────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-block-start: 5.5rem; /* WCAG 2.2 2.4.11: a focused element is never hidden under the sticky header */ }
@media (prefers-reduced-motion: no-preference) { html:focus-within:not([data-aicc-motion="reduce"]) { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) { html:focus-within { scroll-behavior: auto; } }
:root[data-aicc-motion="reduce"] html:focus-within, :root[data-aicc-motion="reduce"] { scroll-behavior: auto; }

body.aicc-theme {
	margin: 0;
	background: var(--aicc-bg);
	color: var(--aicc-text);
	font-family: var(--aicc-font-sans);
	font-size: var(--aicc-text-base);
	line-height: var(--aicc-leading-body);
	font-kerning: normal;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-wrap: break-word;
	min-block-size: 100vh;
	min-block-size: 100dvh;
	display: flex;
	flex-direction: column;
}
.aicc-main { flex: 1 0 auto; }
:where(.aicc-theme) :is(img, svg, video) { max-inline-size: 100%; block-size: auto; }
:where(.aicc-theme) svg { flex-shrink: 0; }
:where(.aicc-theme) [hidden] { display: none !important; }

:where(.aicc-theme) :is(h1, h2, h3, h4) {
	font-weight: 700;
	line-height: var(--aicc-leading-snug);
	letter-spacing: var(--aicc-tracking-display);
	color: var(--aicc-text);
	margin: 0 0 var(--aicc-space-3);
	text-wrap: balance;
}
:where(.aicc-theme) h1 { font-size: var(--aicc-text-3xl); line-height: var(--aicc-leading-tight); }
:where(.aicc-theme) h2 { font-size: var(--aicc-text-2xl); }
:where(.aicc-theme) h3 { font-size: var(--aicc-text-xl); }
:where(.aicc-theme) h4 { font-size: var(--aicc-text-lg); }
:where(.aicc-theme) p { margin: 0 0 var(--aicc-space-4); }
:where(.aicc-theme) :is(p, li) { text-wrap: pretty; }
:where(.aicc-theme) a { color: var(--aicc-link); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
/* Zero specificity on purpose (whole selector in :where), and never on kit components: a plain `a:hover` rule (0,1,1) would beat
   `.aicc-btn--primary` (0,1,0) and turn the button's white text dark on hover. */
:where(.aicc-theme a:not(.aicc-btn, .aicc-navlink, .aicc-lang__item, .aicc-site-header__logo, .aicc-brand):hover) { color: var(--aicc-link-hover); }
:where(.aicc-theme) strong { font-weight: 600; }
:where(.aicc-theme) hr { border: 0; border-block-start: 1px solid var(--aicc-border); margin-block: var(--aicc-space-6); }
:where(.aicc-theme) :is(code, kbd) { font-family: var(--aicc-font-mono); font-size: 0.9em; background: var(--aicc-surface-sunken); padding: 0.1em 0.35em; border-radius: var(--aicc-radius-sm); }
:where(.aicc-theme) ::selection { background: var(--aicc-cyan-300); color: var(--aicc-navy-950); }

/* Shared type scale with the marketing site (measured against it, see docs/unified-experience/visual-alignment.md): the home hero H1 is 60/36,
   page titles are clamp(1.75rem, 1.2rem + 2.4vw, 3rem) (48 on desktop), section H2 is the token --aicc-text-3xl (48 on desktop, 32 on a phone) at line-height 1.15.
   The tokens file is not edited; these are page-level sizes. */
.aicc-theme { --aicc-h1: clamp(2.25rem, 1.55rem + 2.8vw, 3.5rem); --aicc-h2: var(--aicc-text-3xl); }
.aicc-pagehead h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 3rem); line-height: var(--aicc-leading-tight); }
.aicc-section__head h2, .aicc-cta-band h2, .aicc-section > .aicc-container > h2 { font-size: var(--aicc-h2); line-height: var(--aicc-leading-tight); }

/* Prices, dates, emails, store domains and plan names keep their own order inside RTL text. */
:where(.aicc-theme) bdi { unicode-bidi: isolate; }
.aicc-ltr { direction: ltr; unicode-bidi: isolate; }
.aicc-num { font-variant-numeric: tabular-nums; }

.screen-reader-text, .aicc-sr-only {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	block-size: 1px; inline-size: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute; white-space: nowrap; word-wrap: normal;
}
.screen-reader-text:focus, .aicc-sr-only:focus { clip: auto; clip-path: none; block-size: auto; inline-size: auto; margin: 0; overflow: visible; position: static; white-space: normal; }

/* ── Focus: always visible, never removed ───────────────────────────────────────────────── */
.aicc-theme :focus { outline: none; }
.aicc-theme :focus-visible {
	outline: 2px solid var(--aicc-focus);
	outline-offset: 2px;
	border-radius: var(--aicc-radius-sm);
}
.aicc-theme .aicc-on-dark :focus-visible, .aicc-footer :focus-visible { outline-color: var(--aicc-focus-on-dark); }
.aicc-theme input:focus-visible, .aicc-theme select:focus-visible, .aicc-theme textarea:focus-visible { outline-offset: 0; border-radius: var(--aicc-radius-md); }
/* Checkboxes, radios and range sliders: the 2px outline must stay visible (the soft halo alone is ~1.5:1). */
.aicc-theme input[type="checkbox"]:focus-visible, .aicc-theme input[type="radio"]:focus-visible, .aicc-theme input[type="range"]:focus-visible,
.aicc-theme .wc-block-components-checkbox__input:focus-visible, .aicc-theme .wc-block-components-radio-control__input:focus-visible { outline: 2px solid var(--aicc-focus); outline-offset: 2px; box-shadow: none; }
.aicc-theme .aicc-switch:has(input:focus-visible) { outline: 2px solid var(--aicc-focus); outline-offset: 2px; }
@media (forced-colors: active) { .aicc-theme :focus-visible { outline: 2px solid CanvasText; } }

/* ── Skip link ──────────────────────────────────────────────────────────────────────────── */
.aicc-skip {
	position: absolute; inset-inline-start: var(--aicc-space-4); inset-block-start: -4rem; z-index: var(--aicc-z-skip);
	background: var(--aicc-surface-inverse); color: var(--aicc-text-inverse); padding: var(--aicc-space-3) var(--aicc-space-5);
	border-radius: var(--aicc-radius-pill); font-weight: 600; text-decoration: none;
	transition: inset-block-start var(--aicc-dur-fast) var(--aicc-ease);
}
.aicc-skip:focus { inset-block-start: var(--aicc-space-3); color: var(--aicc-text-inverse); outline: 2px solid var(--aicc-focus-on-dark); outline-offset: 2px; }

/* ── Layout primitives ──────────────────────────────────────────────────────────────────── */
/* Same grid as the legacy header and the marketing site: max 80rem, 1.5rem side padding (2rem from 64rem). A narrow container keeps the
   grid edge and limits its children to the reading measure (not centred), so the logo and the content share one left edge. */
.aicc-container { box-sizing: border-box; inline-size: 100%; max-inline-size: var(--aicc-container); margin-inline: auto; padding-inline: 1.5rem; }
@media (min-width: 64rem) { .aicc-container { padding-inline: 2rem; } }
.aicc-container--narrow > * { max-inline-size: var(--aicc-container-narrow); }
.aicc-container--start > :where(h2, p, ul, ol, details, .aicc-accordion, .aicc-prose) { max-inline-size: 46rem; }
.aicc-main { display: block; outline: none; }
.aicc-section { padding-block: clamp(3rem, 2rem + 3.5vw, 5rem); background: var(--aicc-surface); } /* the marketing site's section rhythm (tighter than --aicc-section-y) */
.aicc-section--tight { padding-block: calc(var(--aicc-section-y) * 0.6); }
.aicc-section--sunken { background: var(--aicc-surface-sunken); }
.aicc-section--inverse { background: var(--aicc-surface-inverse); color: var(--aicc-text-inverse); }
.aicc-section--inverse h1, .aicc-section--inverse h2, .aicc-section--inverse h3 { color: var(--aicc-text-inverse); }
.aicc-section--inverse a { color: var(--aicc-focus-on-dark); }
.aicc-stack > * + * { margin-block-start: var(--aicc-space-4); }
.aicc-stack--lg > * + * { margin-block-start: var(--aicc-space-6); }
.aicc-cluster { display: flex; flex-wrap: wrap; gap: var(--aicc-space-3); align-items: center; }
.aicc-grid { display: grid; gap: var(--aicc-space-5); }
.aicc-lede { font-size: var(--aicc-text-lg); color: var(--aicc-text-muted); max-inline-size: var(--aicc-measure); }
.aicc-eyebrow { display: inline-flex; align-items: center; gap: var(--aicc-space-2); font-size: var(--aicc-text-sm); font-weight: 600; color: var(--aicc-success); margin: 0 0 var(--aicc-space-3); }
.aicc-muted { color: var(--aicc-text-muted); }
.aicc-subtle { color: var(--aicc-text-subtle); font-size: var(--aicc-text-sm); }

/* The page title area used by generic pages (cart, checkout, account, legal). */
/* Same page header as the marketing site: soft blue glow in the corner, a hairline under it, breadcrumb above the title. The fixed header's height is
   already in .aicc-main's padding, so only the site's own padding (clamp 1.5-3rem) is added here. */
.aicc-pagehead { padding-block: clamp(1.5rem, 1rem + 2vw, 3rem); background: radial-gradient(40rem 18rem at 90% -20%, rgb(37 99 235 / 0.1), transparent 70%), var(--aicc-bg); border-block-end: 1px solid var(--aicc-border); }
:where(.aicc-pagehead) > .aicc-container { display: grid; gap: var(--aicc-space-4); }
.aicc-pagehead > .aicc-container > * { min-inline-size: 0; } /* a long word (ru "конфиденциальности") wraps inside the column instead of widening the page at 320px */
.aicc-pagehead h1 { overflow-wrap: anywhere; }
.aicc-pagehead h1 { margin: 0; }
.aicc-pagehead p { margin: 0; color: var(--aicc-text-muted); max-inline-size: var(--aicc-measure); }
.aicc-crumbs { font-size: var(--aicc-text-sm); }
.aicc-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; align-items: center; }
.aicc-crumbs li + li::before { content: "/"; margin-inline-end: 0.5rem; color: var(--aicc-text-muted); }
.aicc-crumbs a { color: var(--aicc-link); display: inline-flex; align-items: center; min-block-size: var(--aicc-tap); min-inline-size: var(--aicc-tap); }
.aicc-crumbs [aria-current] { color: var(--aicc-text-muted); }
.aicc-pagebody { padding-block-end: var(--aicc-space-9); }

/* ── Header, buttons, language menu: the brand kit (aicc-brand.css). Only the footer logo lockup lives here. ── */
.aicc-brand { display: inline-flex; align-items: center; gap: 0.625rem; text-decoration: none; color: var(--aicc-text-inverse); min-block-size: var(--aicc-tap); flex-shrink: 0; }
.aicc-brand img { inline-size: 2rem; block-size: 2rem; display: block; }
.aicc-brand__name { font-weight: 600; letter-spacing: -0.025em; font-size: 1rem; line-height: 1.5rem; white-space: nowrap; }

/* ── Footer ─────────────────────────────────────────────────────────────────────────────── */
.aicc-footer { background: var(--aicc-surface-inverse); color: var(--aicc-text-inverse-muted); padding-block: var(--aicc-space-8) var(--aicc-space-6); margin-block-start: auto; }
.aicc-footer a { color: var(--aicc-text-inverse); text-decoration: none; }
.aicc-footer a:hover { text-decoration: underline; color: var(--aicc-text-inverse); }
.aicc-footer__grid { display: grid; grid-template-columns: 1fr; gap: var(--aicc-space-6); }
@media (min-width: 720px) { .aicc-footer__grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.aicc-footer__brand p { max-inline-size: 32ch; margin-block-start: var(--aicc-space-4); font-size: var(--aicc-text-sm); }
.aicc-footer .aicc-brand { color: var(--aicc-text-inverse); }
.aicc-footer h2 { font-size: var(--aicc-text-sm); font-weight: 600; color: var(--aicc-text-inverse); margin: 0 0 var(--aicc-space-3); letter-spacing: 0; }
.aicc-footer ul { list-style: none; margin: 0; padding: 0; }
.aicc-footer li a { display: inline-flex; align-items: center; min-block-size: var(--aicc-tap); font-size: var(--aicc-text-sm); }
.aicc-footer__bottom { margin-block-start: var(--aicc-space-7); padding-block-start: var(--aicc-space-5); border-block-start: 1px solid rgb(255 255 255 / 0.14); display: flex; flex-wrap: wrap; gap: var(--aicc-space-4) var(--aicc-space-6); align-items: center; justify-content: space-between; font-size: var(--aicc-text-sm); }
.aicc-footer .aicc-lang a { color: var(--aicc-text-inverse-muted); }
.aicc-footer .aicc-lang a:hover { background: rgb(255 255 255 / 0.1); color: var(--aicc-text-inverse); }
.aicc-footer .aicc-lang a[aria-current="true"] { background: var(--aicc-white); color: var(--aicc-navy-950); }
.aicc-footer__link-btn { display: inline-flex; align-items: center; gap: var(--aicc-space-2); min-block-size: var(--aicc-tap); padding-inline: var(--aicc-space-3); background: transparent; border: 1px solid rgb(255 255 255 / 0.28); border-radius: var(--aicc-radius-pill); color: var(--aicc-text-inverse); font: inherit; font-size: var(--aicc-text-sm); cursor: pointer; }
.aicc-footer__link-btn:hover { background: rgb(255 255 255 / 0.1); }

/* ── "(pending)" markers: a value the owner has not supplied. Never invented, always visible. ─ */
.aicc-pending, .aicc-legal-pending, .aicc-muted-note { color: var(--aicc-text-muted); font-style: normal; font-size: inherit; }
.aicc-footer .aicc-muted-note { color: var(--aicc-text-inverse-muted); }
.aicc-muted-note { overflow-wrap: anywhere; }
.aicc-legal-not-applicable { color: var(--aicc-text-muted); font-style: italic; }

/* ── Accessibility preferences dialog ───────────────────────────────────────────────────── */
.aicc-dialog { border: 0; padding: 0; border-radius: var(--aicc-radius-xl); box-shadow: var(--aicc-shadow-lg); inline-size: min(32rem, calc(100% - 2 * var(--aicc-gutter))); max-block-size: calc(100% - 2rem); background: var(--aicc-surface); color: var(--aicc-text); }
.aicc-dialog::backdrop { background: rgb(11 18 32 / 0.55); }
.aicc-dialog__inner { padding: var(--aicc-space-6); display: grid; gap: var(--aicc-space-4); }
.aicc-dialog__head { display: flex; justify-content: space-between; align-items: start; gap: var(--aicc-space-4); }
.aicc-dialog__head h2 { margin: 0; font-size: var(--aicc-text-xl); }
.aicc-dialog__foot { display: flex; flex-wrap: wrap; gap: var(--aicc-space-3); align-items: center; justify-content: space-between; }
.aicc-switch { display: flex; align-items: center; justify-content: space-between; gap: var(--aicc-space-4); padding: var(--aicc-space-3) var(--aicc-space-4); border: 1px solid var(--aicc-border); border-radius: var(--aicc-radius-md); min-block-size: var(--aicc-tap); cursor: pointer; }
.aicc-switch input { inline-size: 1.5rem; block-size: 1.5rem; accent-color: var(--aicc-primary-strong); flex-shrink: 0; }
.aicc-switch span small { display: block; color: var(--aicc-text-muted); font-size: var(--aicc-text-sm); }

/* ── Preference modes that need more than a token swap ──────────────────────────────────── */
:root[data-aicc-motion="reduce"] *, :root[data-aicc-motion="reduce"] *::before, :root[data-aicc-motion="reduce"] *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
:root[data-aicc-contrast="high"] .aicc-theme a:not(.aicc-btn):not(.aicc-site-header__logo):not(.aicc-brand) { text-decoration: underline; }
:root[data-aicc-contrast="high"] .aicc-card, :root[data-aicc-contrast="high"] .aicc-banner { border-color: var(--aicc-border-strong); }
@media (prefers-reduced-motion: reduce) { .aicc-theme *, .aicc-theme *::before, .aicc-theme *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }

/* ── Print: receipts and legal pages print cleanly ──────────────────────────────────────── */
@media print {
	.aicc-header, .aicc-footer, .aicc-skip, .aicc-dialog { display: none !important; }
	body.aicc-theme { background: var(--aicc-white); }
}

/* ── Flow pages (cart, checkout, connect, order received): logo, back link, language, account chip ── */
.aicc-site-header--flow .aicc-site-header__nav--flow { display: block; }
.aicc-site-header--flow .aicc-site-header__links { display: flex; }
.aicc-backlink { display: inline-flex; align-items: center; gap: 0.5rem; }
.aicc-backlink .aicc-icon-back { inline-size: 1.125rem; block-size: 1.125rem; }
.aicc-backlink .aicc-icon.aicc-icon-back { transform: scaleX(-1); }
[dir="rtl"] .aicc-backlink .aicc-icon.aicc-icon-back { transform: none; }
/* Menu paths such as "AI Copilot → Get started with AICC": the arrow points against the ink direction in RTL. */
.aicc-menu-path { white-space: normal; }
/* Each menu label stays on one line (a Hebrew sentence must not split "Get started with AICC" across two lines); the arrow between them may wrap. */
.aicc-menu-path bdi { white-space: normal; }
.aicc-menu-path__label { white-space: nowrap; }
/* The path is one left-to-right isolate (English menu labels), so its arrow keeps pointing right even on a right-to-left page. */
.aicc-menu-path__arrow { display: inline-block; }

/* Header menu button icon swap (state lives in aria-expanded, set by the kit). */
.aicc-site-header__menu-btn .aicc-menu-icon-close { display: none; }
.aicc-site-header__menu-btn[aria-expanded="true"] .aicc-menu-icon-open { display: none; }
.aicc-site-header__menu-btn[aria-expanded="true"] .aicc-menu-icon-close { display: block; }
.aicc-userchip { gap: 0.5rem; }
.aicc-userchip__avatar { display: grid; place-items: center; inline-size: 1.5rem; block-size: 1.5rem; border-radius: 50%; background: var(--aicc-gradient-logomark); color: var(--aicc-white); font-weight: 600; font-size: 0.75rem; flex: none; }
@media (max-width: 35.99rem) { .aicc-site-header--flow .aicc-userchip__label { position: absolute; clip-path: inset(50%); block-size: 1px; inline-size: 1px; overflow: hidden; white-space: nowrap; } .aicc-site-header--flow .aicc-userchip { padding: 0.5rem; min-inline-size: var(--aicc-tap); } .aicc-site-header--flow .aicc-site-header__bar { gap: 0.5rem; padding-inline: 1rem; } .aicc-site-header--flow .aicc-backlink span { max-inline-size: 7.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

/* The header is fixed (legacy): content starts below it. The home hero adds its own larger top padding. */
html { scroll-padding-block-start: calc(var(--aicc-header-h) + 1rem); }
.aicc-main { padding-block-start: var(--aicc-header-h); }
.aicc-main--hero { padding-block-start: 0; }
/* Phones (up to 575px): on the flow header (cart, checkout, connect, order status) the wordmark next to the logomark would overlap the back link: the logo
   shrank to the logomark's width and the "AICC" text spilled over the arrow (EN) and the "Back to pricing" label (HE, RTL). The logomark alone stays (its link keeps the
   accessible name "AICC, AI Commerce Copilot: home"); the back link and its label keep their room. Logical properties only, so RTL needs nothing extra. */
@media (max-width: 35.99rem) {
	.aicc-site-header--flow .aicc-site-header__logo-short,
	.aicc-site-header--flow .aicc-site-header__logo-full { display: none; }
	.aicc-site-header--flow .aicc-site-header__logo { flex: none; }
}
/* Very narrow phones (320-384px): the flow header keeps the logomark, a back arrow (its label stays for screen readers), the language
   control and the account avatar on one row. */
@media (max-width: 24rem) {
	.aicc-site-header--flow .aicc-site-header__logo-short { display: none; }
	.aicc-site-header--flow .aicc-backlink { min-inline-size: var(--aicc-tap); justify-content: center; padding-inline: 0; }
	.aicc-site-header--flow .aicc-backlink span { position: absolute; clip-path: inset(50%); block-size: 1px; inline-size: 1px; overflow: hidden; white-space: nowrap; max-inline-size: none; }
	.aicc-site-header--flow .aicc-site-header__actions { gap: 0.25rem; }
}
