/* ==========================================================================
   KiwwwiCommerce - Main Stylesheet
   ========================================================================== */

/* Design System — Shadows, Curves, Radii
   ========================================================================== */
:root {
	/* Elevation shadows */
	--kw-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
	--kw-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
	--kw-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
	--kw-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.04);
	--kw-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.14), 0 4px 16px rgba(0, 0, 0, 0.06);

	/* Animation curves */
	--kw-ease: cubic-bezier(0.4, 0, 0.2, 1);
	--kw-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
	--kw-ease-out: cubic-bezier(0, 0, 0.2, 1);

	/* Border radii */
	--kw-radius-sm: 6px;
	--kw-radius-md: 10px;
	--kw-radius-lg: 14px;
	--kw-radius-xl: 20px;
	--kw-radius-full: 999px;

	/* Focus ring */
	--kw-focus-ring: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--accent) 25%, transparent);
}

/* Reset & Base
   ========================================================================== */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	font-family: var(--wp--preset--font-family--system);
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.6;
	color: var(--wp--preset--color--text);
	background-color: var(--wp--preset--color--surface);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--wp--preset--color--accent);
	text-decoration: none;
}

a:hover:not(.button):not(.wp-element-button):not([class*="__btn"]):not([class*="-btn"]):not([role="button"]) {
	color: var(--wp--preset--color--highlight);
}

/* Layout
   ========================================================================== */
.container {
	width: 100%;
	max-width: var(--wp--style--global--wide-size, 1400px);
	margin-inline: auto;
	padding-inline: 1rem;
}

@media (min-width: 768px) {
	.container {
		padding-inline: 2rem;
	}
}

.site-main {
	min-height: 60vh;
	padding-block: 2rem;
}

/* Full-width template — no container, no padding */
.site-main--full-width {
	padding-block: 0;
}

.entry-content--full-width {
	max-width: none;
}

/* Gutenberg blocks inside full-width get their own container */
.entry-content--full-width > .wp-block-group,
.entry-content--full-width > .wp-block-columns,
.entry-content--full-width > .wp-block-heading,
.entry-content--full-width > .wp-block-paragraph,
.entry-content--full-width > .wp-block-shortcode,
.entry-content--full-width > .wp-block-buttons,
.entry-content--full-width > .wp-block-spacer {
	max-width: var(--wp--style--global--wide-size, 1400px);
	margin-inline: auto;
	padding-inline: 1rem;
}

@media (min-width: 768px) {
	.entry-content--full-width > .wp-block-group,
	.entry-content--full-width > .wp-block-columns,
	.entry-content--full-width > .wp-block-heading,
	.entry-content--full-width > .wp-block-paragraph,
	.entry-content--full-width > .wp-block-shortcode,
	.entry-content--full-width > .wp-block-buttons,
	.entry-content--full-width > .wp-block-spacer {
		padding-inline: 2rem;
	}
}

/* Cover & full-width blocks go edge-to-edge */
.entry-content--full-width > .wp-block-cover,
.entry-content--full-width > .wp-block-image.alignfull,
.entry-content--full-width > .wp-block-group.alignfull {
	max-width: none;
	padding-inline: 0;
}

.woocommerce-checkout .site-main {
	padding-block: 0;
}

/* Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--kw--color--heading, var(--wp--preset--color--primary));
}

h1 { font-size: var(--wp--preset--font-size--xx-large); letter-spacing: -0.02em; }
h2 { font-size: var(--wp--preset--font-size--x-large); letter-spacing: -0.015em; }
h3 { font-size: var(--wp--preset--font-size--large); }

/* Buttons — base + variants
   ========================================================================== */

/* .button = Primary Color fill (add to cart, checkout, proceed, place order) */
.button,
button[type="submit"],
input[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.625rem 1.5rem;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.4;
	border: none;
	border-radius: var(--kw-radius-md);
	cursor: pointer;
	text-decoration: none;
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--surface);
	box-shadow: var(--kw-shadow-xs);
	transition: all 0.2s var(--kw-ease);
}

.button:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
	box-shadow: var(--kw-shadow-sm);
	transform: translateY(-1px);
	filter: brightness(1.1);
	color: var(--wp--preset--color--surface);
}

.button:active,
button[type="submit"]:active,
input[type="submit"]:active {
	transform: translateY(0);
	box-shadow: var(--kw-shadow-xs);
}

.button:focus-visible,
button[type="submit"]:focus-visible,
input[type="submit"]:focus-visible {
	outline: none;
	box-shadow: var(--kw-focus-ring);
}

.button:disabled,
button[type="submit"]:disabled,
input[type="submit"]:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* .button--secondary = Secondary Color fill (view cart, continue shopping, back) */
.button--secondary {
	background-color: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--surface);
}

/* Small variant */
.button--sm {
	padding: 0.375rem 1rem;
	font-size: 0.8125rem;
}

/* Full width */
.button--block {
	width: 100%;
	justify-content: center;
}

/* Pill shape */
.button--pill {
	border-radius: 999px;
}

/* Forms
   ========================================================================== */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
textarea,
select {
	width: 100%;
	padding: 0.5rem 0.75rem;
	font-size: 0.875rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--kw-radius-md);
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--text);
	transition: border-color 0.2s var(--kw-ease), box-shadow 0.2s var(--kw-ease);
}

input:not([type="range"]):focus,
textarea:focus,
select:focus {
	outline: none;
	border-color: var(--wp--preset--color--accent);
	box-shadow: var(--kw-focus-ring);
}

input:not([type="range"]):focus-visible,
textarea:focus-visible,
select:focus-visible {
	outline: none;
	border-color: var(--wp--preset--color--accent);
	box-shadow: var(--kw-focus-ring);
}

/* Post Grid
   ========================================================================== */
.posts-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 2rem;
}

/* Page Header
   ========================================================================== */
.page-header {
	margin-bottom: 2rem;
}

.page-title {
	margin-bottom: 0.5rem;
}

.archive-description {
	color: var(--wp--preset--color--text-light);
}

/* Post Card
   ========================================================================== */
.post-card {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--kw-radius-lg);
	overflow: hidden;
	box-shadow: var(--kw-shadow-xs);
	transition: box-shadow 0.25s var(--kw-ease), transform 0.25s var(--kw-ease);
}

.post-card:hover {
	box-shadow: var(--kw-shadow-md);
	transform: translateY(-2px);
}

.post-card__image img {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.post-card__content {
	padding: 1.25rem;
}

.post-card__title {
	font-size: 1.125rem;
	margin-bottom: 0.5rem;
}

.post-card__title a {
	color: var(--wp--preset--color--primary);
}

.post-card__meta {
	font-size: 0.8125rem;
	color: var(--wp--preset--color--text-light);
	margin-bottom: 0.5rem;
}

/* Pagination
   ========================================================================== */
.nav-links {
	display: flex;
	justify-content: center;
	gap: 0.25rem;
	margin-top: 2rem;
}

.nav-links .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0.25rem 0.75rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--kw-radius-sm);
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--wp--preset--color--text);
	transition: all 0.2s var(--kw-ease);
}

.nav-links .page-numbers:hover:not(.current):not(.dots) {
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
	background-color: var(--wp--preset--color--surface-alt);
}

.nav-links .page-numbers.current {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--surface);
	border-color: var(--wp--preset--color--primary);
}

/* Error 404
   ========================================================================== */
.error-404 {
	text-align: center;
	padding-block: 4rem;
}

/* Utility
   ========================================================================== */
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute;
	height: 1px;
	width: 1px;
	overflow: hidden;
}
