/*
 * FRONTEND-NAVACTIVE-001 + hover/focus colours. Shared by the design's shadow root, Home and every shop page.
 *
 * Colours are the site's own three: coral #f04a2a, ink #1a1816, cream #f6f4ec (the --ck-* values already used everywhere).
 * Contrast (WCAG): ink on cream 15.5:1, ink on coral 4.7:1, cream on ink 15.5:1.
 * Coral #f04a2a is 3.3:1 on cream, 3.7:1 on white and 4.7:1 on ink: fine for a 2px focus ring / border (needs 3:1) and for text on the
 * dark footer, but too light for small TEXT on cream, so link text on cream hovers to ink with a coral underline instead of coral text.
 */
:root,
:host {
	--ck-coral: #f04a2a;
	--ck-ink: #1a1816;
	--ck-cream: #f6f4ec;
}

/* ---------- Text links: coral on dark, ink + coral underline on cream/white (AA) ---------- */
a[class~="hover:text-coral"]:hover {
	color: var(--ck-ink);
	text-decoration: underline;
	text-decoration-color: var(--ck-coral);
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}
footer a[class~="hover:text-coral"]:hover,
.ck-footer a:hover {
	color: var(--ck-coral);
	text-decoration: none;
}
body.ck-shop-page .woocommerce a:not(.button):not(.wc-block-components-button):hover {
	color: var(--ck-ink);
	text-decoration-color: var(--ck-coral);
	text-decoration-thickness: 2px;
}

/* ---------- Outlined pill buttons: light coral tint + coral border, text stays ink (was: fill ink) ---------- */
:is(a, button)[class~="border"][class*="rounded-full"]:not([class~="bg-ink"]):not([class~="bg-coral"]):not([class*="bg-cream"]):hover,
body.ck-shop-page .qikink-pdp__bulk-cta.qikink-pdp__bulk-cta:hover,
.ck-btn--outline:hover {
	background: rgba(240, 74, 42, 0.1);
	border-color: var(--ck-coral);
	color: var(--ck-ink);
}
/* the selected/filled state of filter pills keeps its ink fill */

/* ---------- PDP option pills / swatches / related cards: ink border on hover ---------- */
body.ck-shop-page .qikink-pdp__pill.qikink-pdp__pill:hover:not(.is-selected),
body.ck-shop-page .qikink-pdp__swatch.qikink-pdp__swatch:hover:not(.is-selected) {
	border-color: var(--ck-ink);
}
body.ck-shop-page .qikink-pdp__related-card:hover {
	border-color: var(--ck-coral);
}

/* ---------- Header: active + hover state for the current page's link ---------- */
/* Desktop links (shared header .ck-desk-nav, Home header .ck-nav). The underline is an absolutely placed pseudo-element inside the
   header's fixed 64px height, so nothing moves. Active = full 3px coral bar, ink text; hover = half-width, lighter bar. */
:is(.ck-desk-nav, .ck-nav) a {
	position: relative;
	top: 2px; /* 1.4.409: Hind sets capitals 1.9px above the middle of the line; this centres "About" in the 64px header (the bar moves with it) */
}
:is(.ck-desk-nav, .ck-nav) a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -8px;
	height: 3px;
	border-radius: 2px;
	background: var(--ck-coral);
	transform: scaleX(0);
	transform-origin: left center;
	opacity: 0;
	transition: transform 0.2s ease, opacity 0.2s ease;
	pointer-events: none;
}
:is(.ck-desk-nav, .ck-nav) a:hover {
	color: var(--ck-ink);
	text-decoration: none;
}
:is(.ck-desk-nav, .ck-nav) a:hover::after {
	transform: scaleX(0.5);
	opacity: 0.55;
}
:is(.ck-desk-nav, .ck-nav) a[aria-current="page"] {
	color: var(--ck-ink);
}
:is(.ck-desk-nav, .ck-nav) a[aria-current="page"]::after,
:is(.ck-desk-nav, .ck-nav) a[aria-current="page"]:hover::after {
	transform: scaleX(1);
	opacity: 1;
}

/* Mobile drawer: left coral bar (inset shadow, no layout shift) + light coral tint for the current page; half-strength bar on hover */
.ck-mobile-nav a {
	box-shadow: inset 3px 0 0 transparent;
	transition: background 0.15s ease, box-shadow 0.15s ease;
}
.ck-mobile-nav a:hover {
	background: rgba(26, 24, 22, 0.06);
	box-shadow: inset 3px 0 0 rgba(240, 74, 42, 0.45);
	color: var(--ck-ink);
}
.ck-mobile-nav a[aria-current="page"] {
	background: rgba(240, 74, 42, 0.1);
	box-shadow: inset 3px 0 0 var(--ck-coral);
	color: var(--ck-ink);
}

@media (prefers-reduced-motion: reduce) {
	:is(.ck-desk-nav, .ck-nav) a::after,
	.ck-mobile-nav a {
		transition: none;
	}
}

/* =====================================================================================================================
 * FRONTEND-BTNBORDER-001: light outlined controls get a 3:1 border.
 * ink at 50% alpha = 3.3:1 on cream #f6f4ec and 3.4:1 on white (WCAG 1.4.11 needs 3:1). Radius, width and look are unchanged.
 * ===================================================================================================================== */
:root,
:host {
	--ck-border-strong: rgba(26, 24, 22, 0.5);
}
/* design pages: outlined pill links/buttons (Shop filter pills and pagination, "Ask about bulk pricing", 404 "Browse shop", ...) */
:is(a, button)[class*="rounded-full"][class~="border"][class*="border-ink/"] {
	border-color: var(--ck-border-strong);
}
/* /custom-product/: option pills, colour swatches, "Ask about bulk pricing" (selected/hover states keep their own colours) */
body.ck-shop-page .qikink-pdp__pill.qikink-pdp__pill:not(.is-selected),
body.ck-shop-page .qikink-pdp__swatch.qikink-pdp__swatch:not(.is-selected),
body.ck-shop-page .qikink-pdp__bulk-cta.qikink-pdp__bulk-cta {
	border-color: var(--ck-border-strong);
}
/* Home review-slider arrows */
.ck-home button.ck-slider__btn.ck-slider__btn {
	border-color: var(--ck-border-strong);
}

/* =====================================================================================================================
 * FRONTEND-PRESSED-001: pressed state (scale .97, the same as the PDP buttons) and 150ms hover transitions.
 * ===================================================================================================================== */
:is(a, button)[class*="rounded-full"],
.ck-btn,
.ck-cart,
.wc-block-components-button,
.woocommerce :is(a.button, button.button) {
	transition-property: color, background-color, border-color, box-shadow, transform, opacity;
	transition-duration: 0.15s;
	transition-timing-function: ease;
}
:is(a, button)[class*="rounded-full"]:active,
.ck-btn:active,
.ck-cart:active,
.wc-block-components-button:active,
.woocommerce :is(a.button, button.button):active {
	transform: scale(0.97);
}
body.ck-shop-page .qikink-pdp__swatch.qikink-pdp__swatch,
.ck-home button.ck-slider__btn.ck-slider__btn,
body.ck-shop-page .qikink-pdp__other .qikink-pdp__slider-prev,
body.ck-shop-page .qikink-pdp__other .qikink-pdp__slider-next {
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.ck-home button.ck-slider__btn:active:not(:disabled),
body.ck-shop-page .qikink-pdp__other .qikink-pdp__slider-prev:active:not(:disabled),
body.ck-shop-page .qikink-pdp__other .qikink-pdp__slider-next:active:not(:disabled) {
	transform: scale(0.95);
}
@media (prefers-reduced-motion: reduce) {
	:is(a, button)[class*="rounded-full"]:active,
	.ck-btn:active,
	.ck-cart:active,
	.wc-block-components-button:active,
	.woocommerce :is(a.button, button.button):active,
	.ck-home button.ck-slider__btn:active:not(:disabled),
	body.ck-shop-page .qikink-pdp__other .qikink-pdp__slider-prev:active:not(:disabled),
	body.ck-shop-page .qikink-pdp__other .qikink-pdp__slider-next:active:not(:disabled) {
		transform: none;
		opacity: 0.85;
	}
	:is(a, button)[class*="rounded-full"],
	.ck-btn,
	.ck-cart,
	body.ck-shop-page .qikink-pdp__swatch.qikink-pdp__swatch,
	.ck-home button.ck-slider__btn.ck-slider__btn {
		transition-duration: 0.01ms;
	}
}

/* =====================================================================================================================
 * FRONTEND-TAPTARGET-001: 44px minimum tap area on phones WITHOUT changing what is drawn or where anything sits.
 * An invisible ::before (absolute, centred, at least 44x44) enlarges the hit area; header/footer layout does not move.
 * ===================================================================================================================== */
@media (max-width: 767px) {
	:is(a, button)[class*="rounded-full"][class~="py-2"],
	.ck-cart,
	.ck-menu-btn,
	.wc-block-cart-item__remove-link,
	body.ck-shop-page .qikink-pdp__pill.qikink-pdp__pill,
	body.ck-shop-page .qikink-pdp__swatch.qikink-pdp__swatch {
		position: relative;
	}
	.ck-plus,
	.wc-block-cart-item__remove-link {
		position: relative;
		overflow: visible;
	}
	/* option pills and swatches clipped their children; the hit area must stick out */
	body.ck-shop-page .qikink-pdp__pill.qikink-pdp__pill,
	body.ck-shop-page .qikink-pdp__swatch.qikink-pdp__swatch {
		overflow: visible;
	}
	:is(a, button)[class*="rounded-full"][class~="py-2"]::before,
	.ck-cart::before,
	.ck-menu-btn::before,
	.ck-plus::before,
	.wc-block-cart-item__remove-link::after,
	.mobile-nav-close::before,
	body.ck-shop-page .qikink-pdp__pill.qikink-pdp__pill::before,
	body.ck-shop-page .qikink-pdp__swatch.qikink-pdp__swatch::before {
		content: "";
		display: block;
		position: absolute;
		left: 50%;
		top: 50%;
		width: max(100%, 44px);
		height: max(100%, 44px);
		transform: translate(-50%, -50%);
	}
	/* WooCommerce hides this button's pseudo-elements, so the hit area needs !important */
	body.ck-shop-page .wc-block-cart-item__remove-link.wc-block-cart-item__remove-link::after {
		display: block !important;
	}
	body.ck-shop-page .wc-block-cart-item__remove-link.wc-block-cart-item__remove-link {
		overflow: visible;
	}
	/* swatches are 24px: 16px between them leaves the 44px hit areas meeting in the middle of each gap */
	body.ck-shop-page .qikink-pdp__pills:has(.qikink-pdp__swatch) {
		gap: 1rem;
	}
}

/* footer links: rows are 28px apart, so the hit area grows to 28px (padding cancelled by margin, nothing moves). 1.4.409: on every width,
   not only phones (they were 23px tall from 768px up, under the 24px minimum). */
footer li > a {
	display: inline-block;
	padding: 4px 0;
	margin: -4px 0;
}

/* Shop cards on phones: a long one-word name (Bookmark) was cut in the middle of the word next to the price. The name keeps its column, and only
   when its longest word cannot fit beside the price does the price go on the line below. */
@media (max-width: 767px) {
	.group > p.flex.items-center.justify-between.gap-2.p-4 {
		flex-wrap: wrap;
	}
	.group > p.flex.items-center.justify-between.gap-2.p-4 > span:first-child {
		flex: 1 1 0%;
		min-width: min-content;
		overflow-wrap: normal;
		word-break: normal;
	}
	.group > p.flex.items-center.justify-between.gap-2.p-4 > span:first-child > .font-display {
		overflow-wrap: normal;
		min-width: auto;
	}
}

/* Shop cards: the whole card is the link (an empty link stretched over it, named by aria-label), so the product name, category and price stay plain text. */
.ck-card-link {
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: inherit;
}
/* Their name and price were <p> elements, which the type spec gives line-height 1.43 (20.02px at 14px); as <span> they keep that. */
.ck-lh-143 {
	line-height: 1.43;
}

/* =====================================================================================================================
 * 1.4.508 phone UI + forms (no colour changes; only the site's own error colour, as the Bulk form uses).
 * ===================================================================================================================== */
/* Shop search box: 16px on a phone so iPhone Safari does not zoom in when it is tapped. */
@media (max-width: 782px) {
	input[type="search"][name="q"] {
		font-size: 16px;
	}
}
/* Footer links: a 44px tall tap area on a phone (the gap between rows moves into the links, so the footer grows only a little). */
@media (max-width: 899px) {
	.lv-footer ul > li {
		margin: 0;
	}
	.lv-footer ul > li > a {
		display: flex;
		align-items: center;
		min-height: 44px;
	}
}
/* Contact form: required marker, one clear error line under each box, status line. */
.ck-req {
	color: var(--ck-msg-error-text, #c42a0c);
}
.ck-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
.ck-field-err {
	margin: 0.25rem 0 0;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--ck-msg-error-text, #c42a0c);
}
form[data-ck-contact] [aria-invalid="true"] {
	border-color: var(--ck-msg-error-text, #c42a0c);
}
form[data-ck-contact] [data-ck-status] {
	font-size: 1rem;
	line-height: 1.4;
}
