/* =====================================================================
   Ecommerce theme — base.css
   Custom-property–driven. The :root vars come from inc/customizer-css.php.
   ===================================================================== */

/* ---------- Reset (minimal modern) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; tab-size: 4; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; -webkit-font-smoothing: antialiased; }
img, svg, video { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
ul, ol { padding: 0; margin: 0; list-style: none; }
h1, h2, h3, h4, h5, h6, p { margin: 0 0 .8em; }

/* ---------- Base typography ---------- */
:where(:root) {
	--container-max: 1280px;
	--gap: 1.5rem;
	--radius: 12px;
	--density: 1;
	--fs-base: 16px;
}
html { font-size: var(--fs-base); }
body {
	font-family: var(--font-body);
	color: var(--c-text);
	background: var(--c-bg);
	line-height: 1.6;
}
h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-heading);
	line-height: 1.15;
	font-weight: 600;
	color: var(--c-text);
	letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5 { font-size: var(--fs-h5); }
h6 { font-size: var(--fs-h6); }

/* ---------- Layout ---------- */
.container {
	width: min(100% - 2rem, var(--container-max));
	margin-inline: auto;
}
.container--narrow { width: min(100% - 2rem, 760px); }
.container--medium { width: min(100% - 2rem, 960px); }

/* Block alignment — for blocks rendered inside the_content() on front-page,
   single, page templates. .alignfull breaks out of the parent container,
   .alignwide is a wider-than-default container. */
.front-page .alignfull,
.entry-content .alignfull,
.page-content .alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.front-page .alignwide,
.entry-content .alignwide,
.page-content .alignwide { width: min(100vw - 2rem, calc(var(--container-max) + 240px)); max-width: none; margin-left: auto; margin-right: auto; }
.shop-single { padding: 1.5rem 0 3rem; }
.shop-flow   { padding: 1.5rem 0 3rem; }

.site-main { padding: calc(2rem * var(--density)) 0; min-height: 60vh; }
/* Homepage runs its own section spacing — don't double-pad. */
body.home .site-main,
body.page-template-front-page .site-main { padding: 0; }

/* ---------- Buttons ---------- */
.button, button.button, input[type="submit"], .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: .5em;
	padding: var(--btn-padding, .7em 1.2em);
	border-radius: var(--btn-radius);
	font-weight: 500;
	background: var(--c-btn-bg);
	color: var(--c-btn-text);
	border: 1px solid var(--c-btn-bg);
	transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}
.button:hover, button.button:hover, .wp-block-button__link:hover, input[type="submit"]:hover {
	background: var(--c-btn-hover-bg);
	border-color: var(--c-btn-hover-bg);
	color: var(--c-btn-text);
	text-decoration: none;
}
.button:active { transform: translateY(1px); }

/* Outline variant — body.btn-style-outline applies it everywhere. */
body.btn-style-outline .button,
body.btn-style-outline button.button,
body.btn-style-outline input[type="submit"],
body.btn-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--c-btn-bg);
	border-color: var(--c-btn-bg);
}
body.btn-style-outline .button:hover,
body.btn-style-outline button.button:hover,
body.btn-style-outline input[type="submit"]:hover,
body.btn-style-outline .wp-block-button__link:hover {
	background: var(--c-btn-bg);
	color: var(--c-btn-text);
	border-color: var(--c-btn-bg);
}

/* Soft variant — tinted background, dark text. */
body.btn-style-soft .button,
body.btn-style-soft button.button,
body.btn-style-soft input[type="submit"],
body.btn-style-soft .wp-block-button__link {
	background: color-mix(in srgb, var(--c-btn-bg) 14%, var(--c-bg));
	color: var(--c-btn-bg);
	border-color: transparent;
}
body.btn-style-soft .button:hover,
body.btn-style-soft button.button:hover,
body.btn-style-soft input[type="submit"]:hover,
body.btn-style-soft .wp-block-button__link:hover {
	background: var(--c-btn-bg);
	color: var(--c-btn-text);
	border-color: var(--c-btn-bg);
}

.button--ghost {
	background: transparent;
	color: var(--c-text);
	border-color: var(--c-border);
}
.button--ghost:hover { background: var(--c-surface); color: var(--c-text); border-color: var(--c-border); }
.button--accent { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.button--accent:hover { background: var(--c-accent); border-color: var(--c-accent); color: #fff; opacity: .9; }

/* ---------- Forms ---------- */
input[type="text"], input[type="email"], input[type="search"], input[type="number"],
input[type="tel"], input[type="url"], input[type="password"], textarea, select {
	width: 100%;
	padding: .7em .9em;
	border: 1px solid var(--c-border);
	border-radius: var(--radius);
	background: var(--c-bg);
	color: var(--c-text);
	transition: border-color .15s ease;
}
input:focus, textarea:focus, select:focus {
	outline: 2px solid var(--c-primary);
	outline-offset: 1px;
	border-color: var(--c-primary);
}

/* ---------- Skip link / a11y ---------- */
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px; overflow: hidden;
	clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
	position: fixed; top: 1rem; left: 1rem;
	width: auto; height: auto; clip: auto;
	padding: .75em 1em; background: var(--c-primary); color: var(--c-bg);
	z-index: 9999; border-radius: var(--radius);
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.text-muted { color: var(--c-muted); }
.surface { background: var(--c-surface); }

/* ---------- Pagination ---------- */
.page-numbers {
	display: inline-flex; gap: .25em; align-items: center;
	flex-wrap: wrap; padding: 1.5rem 0; justify-content: center;
}
.page-numbers li { display: inline; }
.page-numbers a, .page-numbers span {
	display: inline-flex; min-width: 2.5em; height: 2.5em;
	align-items: center; justify-content: center;
	padding: 0 .8em;
	border: 1px solid var(--c-border);
	border-radius: var(--radius);
}
.page-numbers .current { background: var(--c-primary); color: var(--c-bg); border-color: var(--c-primary); }
.page-numbers a:hover { background: var(--c-surface); text-decoration: none; }

/* ---------- Topbar ---------- */
.topbar {
	background: var(--c-text);
	color: var(--c-bg);
	font-size: .875rem;
	padding: .5em 0;
	text-align: center;
}

/* ---------- Footer ---------- */
.site-footer {
	margin-top: 4rem;
	padding: 3rem 0 1.5rem;
	background: var(--c-surface);
	color: var(--c-text);
	font-size: .95rem;
}
.site-footer__widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: var(--gap);
	padding-bottom: 2rem;
}
.site-footer__bottom {
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--c-border);
	color: var(--c-muted);
	font-size: .875rem;
}
.menu--footer {
	display: flex; flex-wrap: wrap; gap: 1.25rem;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
	color: var(--c-muted);
	font-size: .875rem;
	margin-bottom: 1.5rem;
}
.breadcrumb a:hover { color: var(--c-primary); text-decoration: none; }

/* ---------- Cards / posts ---------- */
.post-list {
	display: grid;
	gap: var(--gap);
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.post-card {
	background: var(--c-surface);
	border-radius: var(--radius);
	overflow: hidden;
	border: 1px solid var(--c-border);
}
.post-card__thumb img { aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.post-card__body { padding: 1.25rem; }
.post-card__title { font-size: var(--fs-h5); margin-bottom: .25em; }
.post-card__meta { color: var(--c-muted); font-size: .85rem; margin-bottom: .75em; }

/* ---------- Single post / page ---------- */
.single-post__title, .page-title { font-size: var(--fs-h1); margin-bottom: .25em; }
.single-post__meta { color: var(--c-muted); margin-bottom: 1.5em; }
.single-post__thumb img { width: 100%; border-radius: var(--radius); margin-bottom: 1.5rem; aspect-ratio: 16/9; object-fit: cover; }

/* ---------- 404 ---------- */
.error-404 { text-align: center; padding: 4rem 0; }
.error-404__title { font-size: clamp(4rem, 12vw, 8rem); margin-bottom: 0; line-height: 1; }
.error-404__message { color: var(--c-muted); margin-bottom: 2rem; }

/* ---------- Search form ---------- */
.search-form { display: flex; gap: .5rem; }
.search-form__input { flex: 1; }
.search-form__submit {
	padding: 0 1em;
	background: var(--c-primary); color: var(--c-bg);
	border-radius: var(--radius);
}

/* ---------- Live search ---------- */
.live-search { position: relative; }
.live-search__results {
	position: absolute;
	top: 100%;
	left: 0; right: 0;
	background: var(--c-bg);
	border: 1px solid var(--c-border);
	border-radius: var(--radius);
	box-shadow: 0 8px 24px rgba(0,0,0,.08);
	z-index: 300;
	max-height: 420px;
	overflow-y: auto;
	overscroll-behavior: contain;
	margin-top: .35rem;
}
.live-search__results[hidden] { display: none; }

.live-search__item {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .625rem .875rem;
	text-decoration: none;
	color: var(--c-text);
	transition: background .15s ease, color .15s ease;
	border-left: 2px solid transparent;
}
.live-search__item:hover,
.live-search__item:focus {
	background: var(--c-surface, #f7f7f8);
	border-left-color: var(--c-primary);
	outline: none;
}
.live-search__item:hover .live-search__name,
.live-search__item:focus .live-search__name {
	color: var(--c-primary);
}

.live-search__image {
	flex-shrink: 0;
	width: 48px; height: 48px;
	border-radius: calc(var(--radius) * .5);
	overflow: hidden;
}
.live-search__image img {
	width: 100%; height: 100%;
	object-fit: cover;
	display: block;
}

.live-search__info {
	display: flex;
	flex-direction: column;
	gap: .125rem;
	min-width: 0;
}
.live-search__name {
	font-size: .875rem;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.live-search__price {
	font-size: .875rem;
	font-weight: 600;
	color: var(--c-text);
}
.live-search__price del {
	opacity: .4;
	font-weight: 400;
}
.live-search__price ins {
	text-decoration: none;
	color: var(--c-primary);
	font-weight: 600;
}

.live-search__view-all {
	display: block;
	padding: .75rem .875rem;
	text-align: center;
	font-size: .8125rem;
	font-weight: 600;
	color: var(--c-primary);
	text-decoration: none;
	border-top: 1px solid var(--c-border);
	transition: background .15s ease;
}
.live-search__view-all:hover,
.live-search__view-all:focus {
	background: var(--c-surface, #f7f7f8);
	text-decoration: underline;
	outline: none;
}

.live-search__empty {
	padding: 1.25rem;
	text-align: center;
	font-size: .875rem;
	color: var(--c-muted, #6b7280);
}

.live-search.is-searching .search-form__input {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' stroke='%23999' stroke-width='2' fill='none' stroke-dasharray='32' stroke-linecap='round'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right .75rem center;
	background-size: 18px;
}

/* ---------- Comments ---------- */
.comments-area { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--c-border); }
.comment-list { display: grid; gap: 1.5rem; }
.comment-list .comment { padding: 1rem; background: var(--c-surface); border-radius: var(--radius); }

/* ---------- Cookie consent banner ---------- */
.cookie-banner {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 10000;
	background: var(--c-surface, #fff);
	border-top: 1px solid var(--c-border, #e5e5e5);
	box-shadow: 0 -4px 20px rgba(0, 0, 0, .1);
	transform: translateY(100%);
	transition: transform .35s ease;
}
.cookie-banner[data-visible] {
	transform: translateY(0);
}
.cookie-banner__inner {
	max-width: var(--container-max, 1280px);
	margin: 0 auto;
	padding: 1.25rem 1.5rem;
	display: flex;
	align-items: center;
	gap: 1.5rem;
}
.cookie-banner__text {
	flex: 1;
	font-size: .9rem;
	line-height: 1.5;
	color: var(--c-text, #333);
}
.cookie-banner__link {
	margin-left: .25rem;
	text-decoration: underline;
	color: var(--c-primary, #222);
}
.cookie-banner__actions {
	display: flex;
	gap: .75rem;
	flex-shrink: 0;
}
.cookie-banner__btn {
	padding: .6em 1.4em;
	font-size: .85rem;
	font-weight: 600;
	border-radius: var(--radius, 6px);
	border: 1px solid transparent;
	cursor: pointer;
	white-space: nowrap;
	transition: background .2s, color .2s, border-color .2s;
}
.cookie-banner__btn--accept {
	background: var(--c-btn-bg, #222);
	color: var(--c-btn-text, #fff);
}
.cookie-banner__btn--accept:hover {
	background: var(--c-btn-hover, #111);
}
.cookie-banner__btn--reject {
	background: transparent;
	color: var(--c-text, #333);
	border-color: var(--c-border, #ccc);
}
.cookie-banner__btn--reject:hover {
	background: var(--c-border, #eee);
}

@media (max-width: 600px) {
	.cookie-banner__inner {
		flex-direction: column;
		text-align: center;
		padding: 1rem;
		gap: 1rem;
	}
	.cookie-banner__actions {
		width: 100%;
	}
	.cookie-banner__btn {
		flex: 1;
	}
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
