/* ==========================================================================
   Components: buttons, cards, product cards, switches, segmented controls,
   chips, notices, breadcrumbs, pagination
   ========================================================================== */

/* Buttons ----------------------------------------------------------------- */
.wk-btn,
.button, button.button, a.button, input.button,
button[type="submit"]:not(.wk-icon-btn):not(.wk-plain),
.wp-element-button, .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: var(--wk-btn-h);
	padding: 0 22px;
	border: 0;
	border-radius: var(--wk-r);
	background: var(--wk-btn);
	color: var(--wk-btn-ink);
	font-family: var(--wk-font);
	font-size: var(--wk-fs-m);
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background var(--wk-d-fast) ease, color var(--wk-d-fast) ease, border-color var(--wk-d-fast) ease, opacity var(--wk-d-fast) ease;
}
.wk-btn:hover,
.button:hover, button.button:hover, a.button:hover, input.button:hover,
button[type="submit"]:not(.wk-icon-btn):not(.wk-plain):hover,
.wp-element-button:hover, .wp-block-button__link:hover { background: var(--wk-btn-hover); color: var(--wk-btn-ink); }

.wk-btn:disabled, .button:disabled, .button.disabled, button[disabled] { opacity: .45; cursor: not-allowed; }

.wk-btn--line, .button.wk-btn--line {
	background: transparent;
	color: var(--wk-ink);
	box-shadow: inset 0 0 0 1.5px var(--wk-ink);
}
.wk-btn--line:hover, .button.wk-btn--line:hover { background: var(--wk-ink); color: var(--wk-surface); }
.wk-btn--light:hover { color: var(--wk-ink); }
.wk-btn--light { background: var(--wk-surface); color: var(--wk-ink); }
.wk-btn--light:hover { background: var(--wk-bg); }
.wk-btn--sm { min-height: var(--wk-btn-h-sm); padding: 0 16px; font-size: var(--wk-fs); }
.wk-btn--block { width: 100%; }

/* Button icons: data-bi="name" draws an icon of assets/icons in the text colour. Arrows stand after the text, all others before it.
   The WooCommerce buttons that the theme does not print itself (Zur Kasse, Zahlungspflichtig bestellen) get theirs here. */
[data-bi]::before,
.wc-proceed-to-checkout .checkout-button::before,
#place_order::before {
	content: "";
	flex: none;
	width: 20px;
	height: 20px;
	background-color: currentColor;
	-webkit-mask: var(--wk-bi) center / contain no-repeat;
	mask: var(--wk-bi) center / contain no-repeat;
}
[data-bi="arrow"], .wc-proceed-to-checkout .checkout-button { --wk-bi: url("../icons/arrow-right.svg"); }
[data-bi="chevron"] { --wk-bi: url("../icons/chevron-down.svg"); }
[data-bi="cart"] { --wk-bi: url("../icons/shopping-cart.svg"); }
[data-bi="shirt"] { --wk-bi: url("../icons/shirt.svg"); }
[data-bi="quote"] { --wk-bi: url("../icons/file-text.svg"); }
[data-bi="mail"] { --wk-bi: url("../icons/mail.svg"); }
[data-bi="user"] { --wk-bi: url("../icons/user.svg"); }
[data-bi="x"] { --wk-bi: url("../icons/x.svg"); }
[data-bi="check"] { --wk-bi: url("../icons/check.svg"); }
[data-bi="pin"] { --wk-bi: url("../icons/map-pin.svg"); }
#place_order { --wk-bi: url("../icons/lock.svg"); }
[data-bi="arrow"]::before, [data-bi="chevron"]::before, .wc-proceed-to-checkout .checkout-button::before { order: 2; }
.wk-btn--sm[data-bi]::before, .wks-offers__act [data-bi]::before { width: 18px; height: 18px; }
.is-busy[data-bi]::before, .is-done[data-bi]::before { display: none; } /* the cart button shows its own spinner and check */

/* Rule: buttons that sit together share one width – side by side or stacked */
.wk-btns { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; justify-self: start; align-self: flex-start; }
@media (max-width: 600px) {
	.wk-btns { grid-auto-flow: row; grid-auto-columns: auto; align-self: stretch; width: 100%; }
}

.wk-icon-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--wk-touch);
	height: var(--wk-touch);
	padding: 0;
	border: 0;
	border-radius: var(--wk-r);
	background: transparent;
	color: var(--wk-ink);
	text-decoration: none;
	cursor: pointer;
	transition: background var(--wk-d-fast) ease, color var(--wk-d-fast) ease;
}
.wk-icon-btn:hover { background: var(--wk-fill-2); color: var(--wk-ink); }
.wk-badge {
	position: absolute; top: 4px; right: 2px;
	min-width: 18px; height: 18px; padding: 0 5px;
	border-radius: 9px;
	background: var(--wk-orange); color: var(--wk-ink);
	font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
}
.wk-badge[data-count="0"] { display: none; }

.wk-link { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-weight: 600; font-size: var(--wk-fs-s); text-decoration: none; }

/* Cards: one white area, no border, no shadow. Same look as the cart, checkout and studio. ------------- */
.wk-card {
	background: var(--wk-surface);
	border-radius: var(--wk-r-xl);
	padding: var(--wk-box-pad);
}
.wk-card + .wk-card { margin-top: var(--wk-s4); }
/* Phones: a white area on an inner page runs from screen edge to screen edge, like the checkout. */
@media (max-width: 600px) {
	.wk-page .wk-card { margin-inline: calc(-1 * var(--wk-gutter)); padding-inline: var(--wk-gutter); border-radius: 0; }
}
.wk-card__title { margin: 0 0 var(--wk-s4); font-size: var(--wk-h3); }

/* Product card: one box, image area tinted, text area white */
.wk-pcard {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--wk-surface);
	border: 1px solid var(--wk-line-card);
	border-radius: var(--wk-r-lg);
	overflow: hidden;
	box-shadow: var(--wk-shadow-1);
	color: var(--wk-ink);
	text-decoration: none;
	transition: transform .35s var(--wk-ease), box-shadow .35s var(--wk-ease);
}
.wk-pcard:hover { transform: translateY(-2px); box-shadow: var(--wk-shadow-hover); color: var(--wk-ink); }
.wk-pcard__img {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1.05;
	background: var(--wk-tile);
	border-radius: var(--wk-r-lg) var(--wk-r-lg) 0 0;
	overflow: hidden;
	isolation: isolate; /* the multiply blend stays inside the photo box, so the zoom does not repaint the card */
}
.wk-pcard__img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	mix-blend-mode: multiply; /* white photo backgrounds take the tile colour */
	transition: transform .45s var(--wk-ease);
	will-change: transform;
}
.wk-pcard:hover .wk-pcard__img img { transform: scale(1.05); }
.wk-pcard__tag {
	position: absolute; top: 14px; left: 14px;
	padding: 6px 10px; border-radius: var(--wk-r-pill);
	background: var(--wk-ink); color: var(--wk-on-dark);
	font-size: var(--wk-fs-xs); font-weight: 600;
}
.wk-pcard__tag--aktion { background: var(--wk-orange); color: var(--wk-ink); }
.wk-pcard__body { display: flex; flex-direction: column; flex: 1; gap: 10px; padding: var(--wk-box-pad); }
.wk-pcard__name { margin: 0; font-family: var(--wk-font); font-size: var(--wk-fs-l); font-weight: 600; line-height: 1.3; transition: color var(--wk-d-fast) ease; }
.wk-pcard:hover .wk-pcard__name { color: var(--wk-orange-text); }
.wk-pcard__meta { font-size: var(--wk-fs-s); color: var(--wk-muted); }
.wk-pcard__foot { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: auto; padding-top: 4px; }
.wk-pcard__price { font-size: var(--wk-fs); }
.wk-pcard__price .price { color: var(--wk-ink); }
.wk-pcard__price ins { text-decoration: none; }
.wk-pcard__stock { font-size: var(--wk-fs-sm); font-weight: 500; color: var(--wk-green); white-space: nowrap; }
.wk-pcard__stock.is-low { color: var(--wk-orange-text); }
.wk-pcard__stock.is-out { color: var(--wk-muted); }
.wk-swatches { display: flex; align-items: center; gap: 6px; }
.wk-swatch { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }

.wk-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--wk-s6); margin: 0; padding: 0; list-style: none; }
.wk-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .wk-grid, .wk-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--wk-s4); } }

/* Switch with sliding thumb ----------------------------------------------- */
.wk-switch {
	position: relative; flex: none;
	width: 52px; height: 30px; padding: 0;
	border: 0; border-radius: 15px;
	background: var(--wk-sep);
	cursor: pointer;
	transition: background var(--wk-d) ease;
}
.wk-switch::after {
	content: ""; position: absolute; top: 3px; left: 3px;
	width: 24px; height: 24px; border-radius: 50%;
	background: var(--wk-surface); box-shadow: var(--wk-shadow-thumb);
	transition: transform var(--wk-d) ease;
}
.wk-switch[aria-checked="true"] { background: var(--wk-orange); }
.wk-switch[aria-checked="true"]::after { transform: translateX(22px); }

/* Segmented control with sliding thumb ------------------------------------ */
.wk-seg {
	--n: 2; --i: 0;
	position: relative;
	display: grid;
	grid-template-columns: repeat(var(--n), minmax(0, 1fr));
	padding: 4px;
	border-radius: var(--wk-r-md);
	background: var(--wk-fill);
}
.wk-seg::before {
	content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px;
	width: calc((100% - 8px) / var(--n));
	border-radius: 9px; background: var(--wk-surface); box-shadow: 0 1px 2px rgba(20, 22, 24, .08);
	transform: translateX(calc(100% * var(--i)));
	transition: transform var(--wk-d) ease;
}
.wk-seg > button {
	position: relative; z-index: 1;
	display: flex; align-items: center; justify-content: center; gap: 6px;
	height: 40px; border: 0; border-radius: 9px; background: transparent;
	font-size: var(--wk-fs-s); font-weight: 600; color: var(--wk-ink); cursor: pointer;
}

/* Chips ------------------------------------------------------------------- */
.wk-chip { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: var(--wk-r-pill); background: var(--wk-fill-2); font-size: var(--wk-fs-sm); font-weight: 600; }

/* Horizontal scroll rows: first snaps to start, last to end, others centred */
.wk-hscroll { display: flex; gap: var(--wk-s3); padding-top: 4px; margin-top: -4px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.wk-hscroll::-webkit-scrollbar { display: none; }
.wk-hscroll > * { flex: none; scroll-snap-align: center; }
.wk-hscroll > *:first-child { scroll-snap-align: start; }
.wk-hscroll > *:last-child { scroll-snap-align: end; }
/* On phones a sideways row runs from screen edge to screen edge: it breaks out of the page gutter, and the same
   gutter is added back inside, so at rest the first item starts at the gutter and the last one ends at it. */
@media (max-width: 600px) {
	.wk-hscroll { margin-inline: calc(-1 * var(--wk-gutter)); padding-inline: var(--wk-gutter); scroll-padding-inline: var(--wk-gutter); }
}

/* Back to top: round button, bottom right. Hidden while scrolling, fades in when scrolling has stopped. */
.wk-totop {
	position: fixed; right: 20px; bottom: calc(20px + var(--wk-totop-lift, 0px) + env(safe-area-inset-bottom)); z-index: 60;
	display: flex; align-items: center; justify-content: center;
	width: 48px; height: 48px; padding: 0; border: 1px solid var(--wk-line-card); border-radius: 50%;
	background: var(--wk-surface); color: var(--wk-ink); cursor: pointer;
	box-shadow: var(--wk-shadow-1);
	opacity: 0; visibility: hidden; transform: translateY(8px);
	transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s, background var(--wk-d-fast) ease, border-color var(--wk-d-fast) ease;
}
.wk-totop.is-show { opacity: 1; visibility: visible; transform: none; transition: opacity .4s ease, transform .4s var(--wk-ease), visibility 0s, background var(--wk-d-fast) ease, border-color var(--wk-d-fast) ease; }
.wk-totop:hover { background: var(--wk-orange); border-color: var(--wk-orange); }
.wk-totop:focus-visible { outline: 2px solid var(--wk-orange); outline-offset: 3px; }
html.wks-lock .wk-totop { display: none; }
#wk-header:focus { outline: 0; }
@media (max-width: 600px) { .wk-totop { right: 16px; bottom: calc(16px + var(--wk-totop-lift, 0px) + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .wk-totop, .wk-totop.is-show { transition: none; } }

/* Notices (theme + WooCommerce) ------------------------------------------- */
.woocommerce-notices-wrapper:empty { display: none; }
.woocommerce-message, .woocommerce-info, .woocommerce-error, .wk-notice {
	display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
	margin: 0 0 var(--wk-s6); padding: 16px 20px;
	border: 1px solid var(--wk-line); border-radius: var(--wk-r-md);
	background: var(--wk-surface); list-style: none; font-size: var(--wk-fs);
}
.woocommerce-message { border-color: var(--wk-ok-line); background: var(--wk-ok-bg); }
.woocommerce-error { border-color: var(--wk-error-line); background: var(--wk-error-bg); }
.woocommerce-error li { width: 100%; }
.woocommerce-message .button, .woocommerce-info .button { order: 2; margin-left: auto; min-height: var(--wk-btn-h-sm); }

/* Breadcrumbs ------------------------------------------------------------- */
.woocommerce-breadcrumb, .wk-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--wk-s4); font-size: var(--wk-fs-s); color: var(--wk-muted); }
.woocommerce-breadcrumb a, .wk-breadcrumb a { color: var(--wk-muted); text-decoration: none; }
.woocommerce-breadcrumb a:hover, .wk-breadcrumb a:hover { color: var(--wk-ink); }

/* Pagination -------------------------------------------------------------- */
/* WooCommerce gives the <ul> the class "page-numbers" too, so only the items inside the <li> are buttons. */
.woocommerce-pagination ul, .nav-links { display: flex; flex-wrap: wrap; gap: 8px; margin: var(--wk-s10) 0 0; padding: 0; list-style: none; border: 0; }
.woocommerce-pagination li { margin: 0; border: 0; }
.woocommerce-pagination li > .page-numbers, .nav-links > .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 44px; height: 44px; padding: 0 12px;
	border: 1px solid var(--wk-line); border-radius: var(--wk-r);
	background: var(--wk-surface); color: var(--wk-ink); text-decoration: none; font-weight: 600;
}
.woocommerce-pagination li > a.page-numbers:hover, .nav-links > a.page-numbers:hover { border-color: var(--wk-ink); }
.woocommerce-pagination li > .page-numbers.current, .nav-links > .page-numbers.current { background: var(--wk-ink); border-color: var(--wk-ink); color: var(--wk-surface); }
.woocommerce-pagination li > .page-numbers.dots, .nav-links > .page-numbers.dots { min-width: 20px; padding: 0; border-color: transparent; background: none; }
@media (max-width: 600px) {
	.woocommerce-pagination ul, .nav-links { justify-content: center; gap: 4px; }
	.woocommerce-pagination li > .page-numbers, .nav-links > .page-numbers { min-width: 36px; height: 40px; padding: 0 6px; font-size: var(--wk-fs-s); }
	.woocommerce-pagination li > .page-numbers.dots, .nav-links > .page-numbers.dots { min-width: 20px; padding: 0; }
}

/* Stars are not used */
.star-rating, .woocommerce-product-rating { display: none; }
