/* ============================================================
   Kenklin — Base styles
   Resets, typography base, links, buttons, forms, utilities.
   Strict rules: 0px corners, no shadows, monochrome base,
   electric-blue accent only for sale/active states.
   ============================================================ */

/* ---------- Reset ---------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

body {
	margin: 0;
	background-color: var(--kk-background);
	color: var(--kk-on-background);
	font-family: var(--kk-font-body);
	font-size: var(--kk-body-md-size);
	font-weight: var(--kk-body-md-weight);
	line-height: var(--kk-body-md-line-height);
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
	height: auto;
}

figure {
	margin: 0;
}

hr {
	border: 0;
	border-top: var(--kk-border-width) solid var(--kk-border-color);
	margin: 0;
}

ul,
ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* ---------- Typography base ---------- */

h1, h2, h3, h4, h5, h6 {
	margin: 0;
	font-family: var(--kk-font-display);
	font-weight: var(--kk-headline-lg-weight);
	letter-spacing: var(--kk-headline-lg-tracking);
	text-transform: uppercase;
	color: var(--kk-on-background);
}

h1 {
	font-size: var(--kk-headline-lg-mobile-size);
	line-height: var(--kk-headline-lg-mobile-line-height);
}

h2 {
	font-size: var(--kk-headline-md-size);
	line-height: var(--kk-headline-md-line-height);
}

h3 {
	font-size: 24px;
	line-height: 28px;
}

h4 {
	font-size: 20px;
	line-height: 24px;
}

h5,
h6 {
	font-size: 16px;
	line-height: 20px;
}

@media (min-width: 768px) {
	h1 {
		font-size: var(--kk-headline-lg-size);
		line-height: var(--kk-headline-lg-line-height);
		letter-spacing: var(--kk-headline-lg-tracking);
	}
}

p {
	margin: 0 0 var(--kk-space-2);
	font-family: var(--kk-font-body);
	font-size: var(--kk-body-md-size);
	line-height: var(--kk-body-md-line-height);
}

p:last-child {
	margin-bottom: 0;
}

small {
	font-size: var(--kk-label-md-size);
	line-height: var(--kk-label-md-line-height);
	letter-spacing: var(--kk-label-md-tracking);
}

strong,
b {
	font-weight: 600;
}

/* ---------- Links ---------- */

a {
	color: inherit;
	text-decoration: none;
	transition: color var(--kk-transition-fast), opacity var(--kk-transition-fast);
}

a:hover {
	opacity: 0.65;
}

a:focus-visible {
	outline: 2px solid var(--kk-on-background);
	outline-offset: 2px;
}

/* ---------- Buttons ---------- */

button,
.kk-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--kk-touch-target);
	padding: 0 var(--kk-space-3);
	border: var(--kk-border-width) solid transparent;
	border-radius: var(--kk-radius);
	background-color: transparent;
	color: inherit;
	font-family: var(--kk-font-body);
	font-size: var(--kk-button-size);
	font-weight: var(--kk-button-weight);
	line-height: var(--kk-button-line-height);
	letter-spacing: var(--kk-button-tracking);
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color var(--kk-transition-base),
				color var(--kk-transition-base),
				border-color var(--kk-transition-base);
}

button:focus-visible,
.kk-btn:focus-visible {
	outline: 2px solid var(--kk-on-background);
	outline-offset: 2px;
}

button:disabled,
.kk-btn:disabled,
.kk-btn[aria-disabled="true"] {
	opacity: 0.4;
	cursor: not-allowed;
}

/* Primary — solid black, white text. Inverts on hover. */
.kk-btn--primary {
	background-color: var(--kk-primary);
	color: var(--kk-on-primary);
	border-color: var(--kk-primary);
}

.kk-btn--primary:hover {
	background-color: var(--kk-on-primary);
	color: var(--kk-primary);
	opacity: 1;
}

/* Secondary — outlined, inverts to solid black on hover. */
.kk-btn--secondary {
	background-color: var(--kk-on-primary);
	color: var(--kk-primary);
	border-color: var(--kk-primary);
}

.kk-btn--secondary:hover {
	background-color: var(--kk-primary);
	color: var(--kk-on-primary);
	opacity: 1;
}

/* Ghost — text-only, no border. */
.kk-btn--ghost {
	background-color: transparent;
	color: var(--kk-primary);
	border-color: transparent;
	padding-inline: 0;
}

/* Ghost on image — transparent fill, 1px white border, white text.
   Inverts to solid white with black text on hover. Used over hero imagery. */
.kk-btn--ghost-on-image {
	background-color: transparent;
	color: #fff;
	border-color: #fff;
}

.kk-btn--ghost-on-image:hover {
	background-color: #fff;
	color: var(--kk-primary);
	opacity: 1;
}

/* Full-width modifier — used by sticky mobile CTAs. */
.kk-btn--block {
	width: 100%;
}

/* ---------- Form inputs ---------- */

input,
select,
textarea {
	font-family: var(--kk-font-body);
	font-size: var(--kk-body-md-size);
	color: var(--kk-on-background);
}

/* Bottom-border-only minimalist inputs (DESIGN.md spec). */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"],
textarea,
select {
	width: 100%;
	min-height: var(--kk-touch-target);
	padding: var(--kk-space-1) 0;
	background-color: transparent;
	border: 0;
	border-bottom: var(--kk-border-width) solid var(--kk-border-color);
	border-radius: var(--kk-radius);
	box-shadow: none;
	outline: none;
	transition: border-color var(--kk-transition-base);
}

input:focus,
textarea:focus,
select:focus {
	border-bottom-color: var(--kk-on-background);
}

input::placeholder,
textarea::placeholder {
	color: var(--kk-on-surface-variant);
	opacity: 1;
}

textarea {
	min-height: calc(var(--kk-touch-target) * 2);
	resize: vertical;
}

label {
	display: block;
	font-size: var(--kk-label-md-size);
	font-weight: var(--kk-label-md-weight);
	line-height: var(--kk-label-md-line-height);
	letter-spacing: var(--kk-label-md-tracking);
	text-transform: uppercase;
	margin-bottom: var(--kk-space-1);
}

/* Native checkboxes/radios — keep accessible but visually flatten. */
input[type="checkbox"],
input[type="radio"] {
	min-height: 0;
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--kk-primary);
}

/* ---------- Selection ---------- */

::selection {
	background-color: var(--kk-primary);
	color: var(--kk-on-primary);
}

/* ============================================================
   Utility classes
   Namespaced .kk-* so we never collide with Blocksy/Woo.
   ============================================================ */

/* ---- Typography utilities ---- */

.kk-display-lg {
	font-family: var(--kk-font-display);
	font-size: var(--kk-display-lg-size);
	font-weight: var(--kk-display-lg-weight);
	line-height: var(--kk-display-lg-line-height);
	letter-spacing: var(--kk-display-lg-tracking);
	text-transform: uppercase;
}

.kk-headline-lg {
	font-family: var(--kk-font-display);
	font-size: var(--kk-headline-lg-mobile-size);
	font-weight: var(--kk-headline-lg-weight);
	line-height: var(--kk-headline-lg-mobile-line-height);
	letter-spacing: var(--kk-headline-lg-tracking);
	text-transform: uppercase;
}

@media (min-width: 768px) {
	.kk-headline-lg {
		font-size: var(--kk-headline-lg-size);
		line-height: var(--kk-headline-lg-line-height);
	}
}

.kk-headline-md {
	font-family: var(--kk-font-display);
	font-size: var(--kk-headline-md-size);
	font-weight: var(--kk-headline-md-weight);
	line-height: var(--kk-headline-md-line-height);
	text-transform: uppercase;
}

/* The single most important class in this system —
   used on every product card for the brand name. */
.kk-brand-label {
	font-family: var(--kk-font-body);
	font-size: var(--kk-brand-label-size);
	font-weight: var(--kk-brand-label-weight);
	line-height: var(--kk-brand-label-line-height);
	letter-spacing: var(--kk-brand-label-tracking);
	text-transform: uppercase;
}

.kk-body-lg {
	font-family: var(--kk-font-body);
	font-size: var(--kk-body-lg-size);
	font-weight: var(--kk-body-lg-weight);
	line-height: var(--kk-body-lg-line-height);
}

.kk-body-md {
	font-family: var(--kk-font-body);
	font-size: var(--kk-body-md-size);
	font-weight: var(--kk-body-md-weight);
	line-height: var(--kk-body-md-line-height);
}

.kk-label-md {
	font-family: var(--kk-font-body);
	font-size: var(--kk-label-md-size);
	font-weight: var(--kk-label-md-weight);
	line-height: var(--kk-label-md-line-height);
	letter-spacing: var(--kk-label-md-tracking);
}

.kk-button-text {
	font-family: var(--kk-font-body);
	font-size: var(--kk-button-size);
	font-weight: var(--kk-button-weight);
	line-height: var(--kk-button-line-height);
	letter-spacing: var(--kk-button-tracking);
	text-transform: uppercase;
}

/* ---- Color utilities ---- */

.kk-text-accent  { color: var(--kk-accent); }
.kk-text-muted   { color: var(--kk-on-surface-variant); }
.kk-text-inverse { color: var(--kk-on-primary); }

.kk-bg-surface   { background-color: var(--kk-background); }
.kk-bg-inverse   { background-color: var(--kk-primary); color: var(--kk-on-primary); }

/* ---- Layout utilities ---- */

.kk-container {
	width: 100%;
	margin-inline: auto;
	padding-inline: var(--kk-container-margin-mobile);
}

@media (min-width: 1024px) {
	.kk-container {
		padding-inline: var(--kk-container-margin-desktop);
		max-width: 1440px;
	}
}

.kk-section {
	padding-block: var(--kk-space-6);
}

@media (min-width: 1024px) {
	.kk-section {
		padding-block: var(--kk-section-gap);
	}
}

.kk-stack > * + * {
	margin-top: var(--kk-space-2);
}

.kk-flex      { display: flex; }
.kk-flex-col  { display: flex; flex-direction: column; }
.kk-items-center { align-items: center; }
.kk-justify-between { justify-content: space-between; }

/* ---- Hairline divider ---- */

.kk-hairline {
	border: 0;
	border-top: var(--kk-border-width) solid var(--kk-hairline);
}

.kk-hairline-top    { border-top:    var(--kk-border-width) solid var(--kk-hairline); }
.kk-hairline-bottom { border-bottom: var(--kk-border-width) solid var(--kk-hairline); }

/* ---- Visually hidden (accessibility) ---- */

.kk-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---- Touch target helper ---- */

.kk-tap {
	min-height: var(--kk-touch-target);
	min-width:  var(--kk-touch-target);
}

/* ---- Aspect-ratio boxes ----
   1:1 is the canonical product-card aspect (real product photos shot on
   neutral backgrounds, often at varying intrinsic ratios — see
   .kk-card__media in main.css for the full contain treatment).
   3:4 is kept for legacy editorial blocks that still want the tall crop. */

.kk-aspect-1-1 {
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

.kk-aspect-3-4 {
	aspect-ratio: 3 / 4;
	overflow: hidden;
}

.kk-aspect-3-4 > img,
.kk-aspect-3-4 > picture > img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
