/* =========================================================================
   Pain Stick — theme stylesheet
   Tokens and rules follow design_handoff_painstick_wordpress/README.md.
   Single breakpoint at 900px; 1200px only for the shop grid.
   ========================================================================= */

/* ---- Tokens ------------------------------------------------------------ */
:root {
	/* Green is the action colour (buttons, links, prices, selected states);
	   navy carries structure (headlines, dark bands, borders, labels);
	   grounds, copy and rules are neutral greys. */
	--green: #1F5C34;
	--lime: #8CC63F;
	--navy: #1B2A5B;
	--pale: #F1F2F0;      /* light grey ground (card grounds, inset panels) */
	--grey: #E6E8E7;      /* a step darker, for section grounds */
	--cream: #F0EDE6;     /* ground of the actives-panel label graphic */
	--body: #26292E;
	--muted: #6C7178;
	--hairline: #E3E5E4;
	--border-light: #C9CDCC;
	--inactive: #A8ADB2;
	--inactive-num: #C3C7CC;
	--white: #FFFFFF;
	--on-dark: #D6DBEA;     /* paragraph copy on navy */
	--on-dark-alt: #B9C2DB;

	--font-display: 'Anton', Impact, 'Arial Narrow Bold', sans-serif;
	--font-body: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--font-label: 'Archivo Narrow', 'Arial Narrow', sans-serif;

	--pad-x: 20px;
	--section-y: 28px;
	--ease-slam: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 900px) {
	:root {
		--pad-x: 44px;
		--section-y: 44px;
		/* Ultrawide: content centres within this; backgrounds stay full-bleed */
		--content-max: 1600px;
		--pad-wide: max(var(--pad-x), calc((100% - var(--content-max)) / 2));
	}
}

/* ---- Keyframes (README §Motion language) ------------------------------- */
@keyframes om-marquee     { from { transform: translateX(0); }    to { transform: translateX(-50%); } }
@keyframes om-marquee-rev { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@keyframes om-slam  { 0% { opacity: 0; transform: scale(1.28) translateY(-12px); } 11%, 100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes om-clip  { 0% { clip-path: inset(0 100% 0 0); } 24%, 100% { clip-path: inset(0 0 0 0); } }
@keyframes om-tick  { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes om-spin  { to { transform: rotate(360deg); } }
@keyframes om-step    { 0%, 24% { background: #FFFFFF; transform: translateY(0); } 7%, 17% { background: #F1F2F0; transform: translateY(-8px); } }
@keyframes om-stepnum { 0%, 24% { color: #C3C7CC; } 7%, 17% { color: #1B2A5B; } }
@keyframes om-tumble { 0% { opacity: 0; transform: translateY(-52px) rotate(-20deg); } 100% { opacity: 1; transform: translateY(0) rotate(0); } }

@media (prefers-reduced-motion: reduce) {
	[data-motion], .ps-marquee__track { animation: none !important; }
}

/* ---- Base -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--white);
	color: var(--body);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.55;
	text-wrap: pretty;
}
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--lime); }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 400; text-transform: uppercase; color: var(--navy); }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
html.ps-drawer-open { overflow: hidden; }

.ps-skip { position: absolute; left: -999px; top: 0; background: var(--lime); color: var(--navy); padding: 12px 18px; z-index: 100; }
.ps-skip:focus { left: 12px; top: 12px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); white-space: nowrap; }

/* Display and label utilities used across screens */
.ps-h1 { font-size: clamp(48px, 4.6vw + 30px, 62px); line-height: 0.92; text-shadow: 5px 5px 0 var(--lime); }
@media (min-width: 900px) { .ps-h1 { text-shadow: 6px 6px 0 var(--lime); } }
.ps-eyebrow { font-family: var(--font-label); font-weight: 700; font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--lime); }
.ps-label { font-family: var(--font-label); font-weight: 700; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--navy); }

/* Buttons */
.ps-btn {
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--green); color: var(--white); border: 0;
	padding: 14px 24px;
	font-family: var(--font-display); font-size: 16px; letter-spacing: 0.06em; text-transform: uppercase;
	text-align: center;
}
.ps-btn:hover { color: var(--white); background: #174a29; }
.ps-btn--lime { background: var(--lime); color: var(--navy); }
.ps-btn--lime:hover { background: #7db536; color: var(--navy); }
.ps-btn--pill { border-radius: 999px; }
.ps-btn--outline { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.ps-btn--outline:hover { background: var(--pale); color: var(--navy); }
.ps-btn--block { display: flex; width: 100%; }

/* Actives rows (product, home, ingredients) */
.ps-actives { display: flex; flex-direction: column; gap: 10px; }
.ps-actives__row { display: flex; align-items: baseline; gap: 12px; border-bottom: 2px solid var(--navy); padding-bottom: 7px; }
.ps-actives__row:last-child { border-bottom: 0; }
.ps-actives__num { font-family: var(--font-display); font-size: 40px; line-height: 1; color: var(--navy); min-width: 2.2em; }
.ps-actives__name { display: block; font-family: var(--font-label); font-weight: 700; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--navy); }
.ps-actives__desc { font-size: 14px; color: var(--body); }

/* Three steps, cycling (product, home) */
.ps-steps { display: flex; flex-direction: column; gap: 10px; }
.ps-steps__card { padding: 18px; display: flex; gap: 14px; align-items: center; animation: om-step 5.4s ease-in-out infinite; }
.ps-steps__num { font-family: var(--font-display); font-size: 34px; line-height: 0.9; color: var(--inactive-num); animation: om-stepnum 5.4s ease-in-out infinite; }
.ps-steps__card h4 { font-size: 18px; margin-bottom: 3px; }
.ps-steps__card p { font-size: 14px; }

/* Sticky bottom bars (below 900px) — page variants; product/cart add to it */
.ps-sticky {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
	background: var(--white); border-top: 2px solid var(--navy);
	padding: 12px 16px 20px; padding-bottom: max(20px, env(safe-area-inset-bottom));
	display: flex; align-items: center; gap: 10px;
	box-shadow: 0 -8px 22px rgba(27, 42, 91, 0.14);
	transform: translateY(110%); transition: transform 0.3s var(--ease-slam);
}
.ps-sticky.is-visible { transform: none; }
.ps-sticky__cta { flex: 1; height: 54px; position: relative; overflow: hidden; font-size: 16px; letter-spacing: 0.04em; }
.ps-sticky__cta .ps-buy__added { border-radius: 999px; }
@media (min-width: 900px) { .ps-sticky { display: none; } }

/* "Added ✓" overlay on any .ps-add control (home hero, shop, cart, product) */
.ps-add { position: relative; overflow: hidden; }
.ps-add .ps-buy__added {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	background: var(--lime); color: var(--navy); opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
.ps-add.is-added .ps-buy__added { opacity: 1; }
.ps-btn--lime .ps-buy__added { background: var(--navy); color: var(--white); }

/* The one safety line (README: keep safety copy minimal) */
.ps-external { display: block; font-family: var(--font-label); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

/* Rating line, text link (home, product, shop) */
.ps-rating { display: flex; align-items: center; gap: 10px; font-family: var(--font-label); font-weight: 600; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--navy); }
.ps-stars { color: var(--lime); font-size: 17px; letter-spacing: 0; }
.ps-link { display: inline-block; margin-top: 16px; min-height: 44px; line-height: 44px; font-family: var(--font-label); font-weight: 700; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; border-bottom: 2px solid var(--lime); }
@media (min-width: 900px) { .ps-link { min-height: 0; line-height: 1.4; } }

/* Quantity stepper (product, cart, sticky bars) */
.ps-stepper { display: flex; align-items: center; border: 2px solid var(--navy); color: var(--navy); font-family: var(--font-label); font-weight: 700; font-size: 16px; }
.ps-stepper__btn { width: 40px; height: 100%; min-height: 44px; border: 0; background: none; color: inherit; font: inherit; font-size: 18px; }
.ps-stepper__qty { width: 34px; border: 0; padding: 0; text-align: center; font: inherit; color: inherit; background: none; -moz-appearance: textfield; }
.ps-stepper__qty::-webkit-inner-spin-button, .ps-stepper__qty::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Plain content pages (order received, policies, posts) */
.ps-content { padding: 26px var(--pad-x) 28px; display: flex; flex-direction: column; gap: 14px; font-size: 16px; line-height: 1.6; }
.ps-content__title { font-size: 44px; line-height: 0.9; }
.ps-content p { margin: 0; }
@media (min-width: 900px) { .ps-content { max-width: 900px; margin: 0 auto; padding: 40px 34px; } }

/* ---- Announcement bar -------------------------------------------------- */
.ps-announce {
	background: var(--navy); color: var(--white);
	padding: 8px 12px; text-align: center;
	font-family: var(--font-label); font-weight: 700; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
}
@media (min-width: 900px) {
	.ps-announce { padding: 9px 0; font-size: 12px; letter-spacing: 0.24em; }
}

/* ---- Header ------------------------------------------------------------ */
.ps-header {
	position: sticky; top: 0; z-index: 60;
	display: flex; align-items: center; justify-content: space-between;
	height: 60px; padding: 0 14px;
	border-bottom: 1px solid var(--hairline);
	background: var(--white);
}
/* Logged-in: clear WordPress's admin bar (fixed above 600px, scrolls away below) */
@media (min-width: 601px) { .admin-bar .ps-header { top: 46px; } }
@media (min-width: 783px) { .admin-bar .ps-header { top: 32px; } }
.ps-header-green .ps-header { background: var(--navy); border-bottom: 0; }

.ps-logo img { width: auto; height: 38px; }
.ps-header-green .ps-logo img { height: 36px; }

.ps-nav, .ps-cart-pill { display: none; }

/* Hamburger: 48px target, three 3px rules, 5px gap, 11px inset */
.ps-burger {
	width: 48px; height: 48px; padding: 0 11px; border: 0; background: none;
	display: flex; flex-direction: column; justify-content: center; gap: 5px;
}
.ps-burger span { display: block; height: 3px; background: var(--navy); }
.ps-header-green .ps-burger span { background: var(--white); }

/* Cart icon: 22×20 open-top basket with a lime fill and a badge */
.ps-cart-icon {
	position: relative; width: 48px; height: 48px;
	display: flex; align-items: center; justify-content: center;
}
.ps-cart-icon__basket {
	position: relative; width: 22px; height: 20px;
	border: 3px solid var(--navy); border-top: 0; overflow: hidden;
}
.ps-header-green .ps-cart-icon__basket { border-color: var(--white); }
.ps-cart-icon__fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--lime); }
.ps-cart-icon__badge {
	position: absolute; top: 6px; right: 3px;
	min-width: 18px; height: 18px; padding: 0 4px;
	display: flex; align-items: center; justify-content: center;
	border-radius: 999px; background: var(--navy); color: var(--white);
	font-family: var(--font-label); font-weight: 700; font-size: 11px; line-height: 1;
}
.ps-header-green .ps-cart-icon__badge { background: var(--white); color: var(--navy); }

/* Account icon + cart, kept together so the header's space-between holds */
.ps-header__tools { display: flex; align-items: center; gap: 2px; }
.ps-user-icon {
	position: relative; width: 48px; height: 48px;
	display: flex; align-items: center; justify-content: center; color: var(--navy);
}
.ps-user-icon:hover { color: var(--green); }
.ps-header-green .ps-user-icon { color: var(--white); }
.ps-header-green .ps-user-icon:hover { color: var(--lime); }
.ps-user-icon__dot { position: absolute; top: 11px; right: 11px; width: 9px; height: 9px; border-radius: 50%; background: var(--lime); border: 2px solid var(--white); }
.ps-header-green .ps-user-icon__dot { border-color: var(--navy); }

@media (min-width: 900px) {
	.ps-header { height: auto; padding: 20px var(--pad-wide); }
	.ps-header-inner .ps-header { padding: 20px max(34px, calc((100% - var(--content-max)) / 2)); }
	.ps-logo img, .ps-header-green .ps-logo img { height: 46px; }
	.ps-burger, .ps-cart-icon { display: none; }
	.ps-nav { display: block; }
	.ps-nav__list { display: flex; gap: 26px; }
	.ps-nav__list a {
		font-family: var(--font-label); font-weight: 600; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase;
	}
	.ps-header-green .ps-nav__list a { color: var(--white); }
	.ps-header-green .ps-nav__list a:hover { color: var(--lime); }
	.ps-cart-pill {
		display: inline-block;
		background: var(--lime); color: var(--navy);
		padding: 10px 20px; border-radius: 999px;
		font-family: var(--font-label); font-weight: 700; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
	}
	.ps-cart-pill:hover { background: #7db536; color: var(--navy); }
	.ps-header__tools { gap: 10px; }
	.ps-user-icon { width: 44px; height: 44px; }
}

/* ---- Mobile drawer ----------------------------------------------------- */
.ps-drawer {
	position: fixed; inset: 0; z-index: 90;
	display: flex; flex-direction: column;
	background: var(--navy); color: var(--white);
	overflow-y: auto;
}
.ps-drawer[hidden] { display: none; }
.admin-bar .ps-drawer { top: 46px; }
@media (min-width: 783px) { .admin-bar .ps-drawer { top: 32px; } }
.ps-drawer__bar { display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 14px; }
.ps-drawer__close {
	width: 48px; height: 48px; border: 0; background: none;
	font-family: var(--font-display); font-size: 26px; color: var(--lime); line-height: 1;
}
.ps-drawer__spacer { width: 48px; }
.ps-logo--knockout img { height: 36px; }
.ps-drawer__nav { padding: 18px 24px 0; }
.ps-drawer__list a {
	display: block; color: var(--white);
	font-family: var(--font-display); font-size: 44px; line-height: 1.28; text-transform: uppercase;
	animation: om-slam 0.9s var(--ease-slam) both;
}
.ps-drawer__list li:nth-child(2) a { animation-delay: 0.1s; }
.ps-drawer__list li:nth-child(3) a { animation-delay: 0.2s; }
.ps-drawer__list li:nth-child(4) a { animation-delay: 0.3s; }
.ps-drawer__list li:nth-child(5) a { animation-delay: 0.4s; }
.ps-drawer__list li:nth-child(6) a { animation-delay: 0.5s; }
.ps-drawer__list a:hover { color: var(--lime); }
.ps-drawer__foot { margin-top: auto; }
.ps-drawer__actions { display: flex; gap: 10px; padding: 20px 24px 0; }
.ps-drawer__btn {
	flex: 1; height: 52px; display: flex; align-items: center; justify-content: center;
	font-family: var(--font-label); font-weight: 700; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
}
.ps-drawer__btn--outline { border: 2px solid var(--lime); color: var(--lime); }
.ps-drawer__btn--solid { background: var(--lime); color: var(--navy); }
.ps-drawer__note {
	display: block; padding: 12px 24px 26px;
	font-family: var(--font-label); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--on-dark-alt);
}
@media (prefers-reduced-motion: reduce) { .ps-drawer__list a { animation: none; } }

/* ---- Marquees ---------------------------------------------------------- */
.ps-marquee { overflow: hidden; }
.ps-marquee__track {
	display: flex; gap: 24px; width: max-content; white-space: nowrap;
	font-family: var(--font-display); text-transform: uppercase;
	animation: om-marquee 11s linear infinite;
}
.ps-marquee__track--rev { animation-name: om-marquee-rev; }
.ps-marquee__copy { display: contents; }

.ps-marquee--trust { background: var(--lime); padding: 11px 0; }
.ps-marquee--trust .ps-marquee__track { color: var(--navy); font-size: 14px; letter-spacing: 0.24em; }
.ps-marquee--slogan-lime { background: var(--lime); padding: 10px 0; }
.ps-marquee--slogan-lime .ps-marquee__track { color: var(--navy); font-size: 15px; letter-spacing: 0.2em; gap: 22px; animation-duration: 9s; }
.ps-marquee--slogan-green { background: var(--navy); padding: 10px 0; }
.ps-marquee--slogan-green .ps-marquee__track { color: var(--white); font-size: 20px; letter-spacing: 0.16em; gap: 28px; animation-duration: 9s; }
.ps-marquee--slogan-green .ps-marquee__dot { color: var(--lime); }

@media (min-width: 900px) {
	.ps-marquee--trust { padding: 13px 0; }
	.ps-marquee--trust .ps-marquee__track { font-size: 16px; letter-spacing: 0.28em; gap: 30px; }
}

/* ---- Footer ------------------------------------------------------------ */
.ps-footer {
	background: var(--navy); color: var(--white);
	padding: 26px var(--pad-x) 20px;
	display: flex; flex-direction: column; gap: 4px;
}
.ps-footer__logo { height: 44px; width: auto; margin-top: 0; align-self: flex-start; }
.ps-footer__line { margin-top: 12px; font-size: 13px; line-height: 1.5; color: var(--on-dark-alt); }
.ps-footer__eyebrow { display: none; }
.ps-footer__list a {
	display: block; color: var(--white); min-height: 46px; line-height: 46px; font-size: 15px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.ps-footer__list a:hover { color: var(--lime); }
.ps-footer__col:last-child .ps-footer__list li:last-child a { border-bottom: 0; }
.ps-footer__brand { display: contents; }
.ps-footer__brand .ps-footer__line { order: 10; }

@media (min-width: 900px) {
	.ps-footer {
		display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 30px;
		padding: 44px var(--pad-wide);
	}
	.ps-footer__brand { display: flex; flex-direction: column; gap: 8px; }
	.ps-footer__logo { height: 52px; }
	.ps-footer__line { margin-top: 8px; font-size: 14px; line-height: 1.6; }
	.ps-footer__col { display: flex; flex-direction: column; gap: 9px; }
	.ps-footer__eyebrow {
		display: block;
		font-family: var(--font-label); font-weight: 700; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--lime);
	}
	.ps-footer__list { display: flex; flex-direction: column; gap: 9px; }
	.ps-footer__list a { min-height: 0; line-height: 1.4; font-size: 14px; border: 0; }
}

/* ---- Sign-in gates (wholesaler portal, My Account) --------------------- */
/* Portal gate (signed out): navy brand panel + white form card */
.ps-portal--gate { padding: 0; gap: 0; }
.ps-gate { display: flex; flex-direction: column; }
.ps-gate__brand { position: relative; overflow: hidden; background: var(--navy); color: var(--white); padding: 32px var(--pad-x) 36px; display: flex; flex-direction: column; gap: 14px; }
.ps-gate__brand .ps-eyebrow { color: var(--lime); }
.ps-gate__title { color: var(--white); }
.ps-gate__brand p { font-size: 16px; line-height: 1.55; color: var(--on-dark); max-width: 42ch; }
.ps-gate__brand p { position: relative; z-index: 1; max-width: 60%; }
.ps-gate__cutout { position: absolute; right: -6px; bottom: -34px; height: 230px; width: auto; transform: rotate(-7deg); filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.35)); pointer-events: none; }
.ps-gate__panel { padding: 28px var(--pad-x) 34px; display: flex; flex-direction: column; gap: 14px; background: var(--white); }
.ps-gate__h { font-size: 30px; line-height: 1; }
.ps-gate__note { font-size: 15px; line-height: 1.55; }
.ps-gate__panel form { display: flex; flex-direction: column; gap: 12px; }
.ps-gate__panel form p { margin: 0; }
.ps-gate__panel label { display: block; margin-bottom: 6px; font-family: var(--font-label); font-weight: 700; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--navy); }
.ps-gate__panel input[type="text"], .ps-gate__panel input[type="password"] {
	width: 100%; min-height: 54px; border: 2px solid var(--border-light); border-radius: 0; background: var(--white);
	padding: 14px; font: inherit; font-size: 16px; line-height: 1.4; color: var(--body);
}
.ps-gate__panel input:focus { outline: 0; border-color: var(--navy); box-shadow: 0 0 0 3px var(--lime); }
.ps-gate__panel .login-remember label { display: flex; align-items: center; gap: 10px; min-height: 40px; margin: 0; font-family: var(--font-body); font-weight: 400; font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--muted); }
.ps-gate__panel .login-remember input { width: 18px; height: 18px; margin: 0; accent-color: var(--green); }
.ps-gate__panel .login-submit input {
	display: block; width: 100%; border: 0; padding: 17px; background: var(--green); color: var(--white);
	font-family: var(--font-display); font-size: 17px; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer;
}
.ps-gate__panel .login-submit input:hover { background: #174a29; }
.ps-gate__lost { align-self: flex-start; font-family: var(--font-label); font-weight: 600; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; border-bottom: 2px solid var(--lime); }
.ps-gate__apply { margin-top: 10px; padding-top: 20px; border-top: 1px solid var(--hairline); display: flex; flex-direction: column; gap: 10px; }
.ps-gate__panel .ps-btn--block { width: 100%; }
@media (min-width: 900px) {
	.ps-portal--gate { max-width: 1000px; margin: 40px auto 56px; padding: 0 34px; }
	.ps-gate { flex-direction: row; align-items: stretch; border: 2px solid var(--navy); }
	.ps-gate__brand { flex: 1.1; min-height: 520px; padding: 44px 40px; gap: 16px; }
	.ps-gate__brand p { max-width: 44ch; }
	.ps-gate__cutout { right: 26px; bottom: -40px; height: 330px; }
	.ps-gate__panel { flex: 0.9; padding: 44px 40px; gap: 16px; }
	.ps-gate__h { font-size: 32px; }
}
