/*
Theme Name: Sklep
Template: twentytwentyfive
Description: Shop theme of the wp-kamal template, a child theme of Twenty Twenty-Five: catalogue with filters, collections, variation buttons, size charts, InPost points, GPSR. Colours and fonts are set per shop in theme.json.
Version: 0.6.0
Requires at least: 6.7
Requires PHP: 8.4
Text Domain: wpk
License: proprietary
*/

/* Demo store notice: shown at the top of every page, cannot be dismissed. */
.woocommerce-store-notice.demo_store {
	position: static;
	width: auto;
	box-sizing: border-box;
	display: block !important;
	margin: 0;
	padding: 0.4rem 1rem;
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--small);
	text-align: center;
	box-shadow: none;
}

/* Header */
.wpk-header {
	border-bottom: 1px solid var(--wp--preset--color--accent-6);
}
.wpk-header .wp-block-site-title a {
	text-decoration: none;
}
.wpk-header__logo img {
	display: block;
	width: auto;
	height: 2.5rem;
}
@media (max-width: 781px) {
	.wpk-header__logo img {
		height: 2rem;
	}
}
.wpk-header__bar {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) minmax(12rem, 18rem) auto;
	grid-template-areas: "title nav search tools";
	align-items: center;
	gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
	padding-block: var(--wp--preset--spacing--30);
}
.wpk-header__bar > * {
	margin: 0 !important;
}
.wpk-header__title { grid-area: title; }
.wpk-header__nav { grid-area: nav; }
.wpk-header__search { grid-area: search; }
.wpk-header__tools { grid-area: tools; gap: var(--wp--preset--spacing--20); }
.wpk-header__search .wp-block-search__inside-wrapper {
	border-radius: 2px;
	padding: 2px;
}
.wpk-header__search .wp-block-search__input {
	padding-block: 0.5rem;
	font-size: var(--wp--preset--font-size--small);
}
.wpk-header__search .wp-block-search__button {
	border-radius: 2px;
	padding: 0.5rem 0.75rem;
}
@media (max-width: 781px) {
	.wpk-header__bar {
		grid-template-columns: minmax(0, 1fr) auto auto;
		grid-template-areas:
			"title tools nav"
			"search search search";
	}
}

/* Prices: sale price in the rust accent, regular price muted. */
.wc-block-components-product-price ins,
.wp-block-woocommerce-product-price ins,
.price ins {
	color: var(--wp--preset--color--accent-3);
	text-decoration: none;
	font-weight: 600;
}
.wc-block-components-product-price del,
.price del {
	color: var(--wp--preset--color--accent-4);
}
.woocommerce span.onsale,
.wc-block-components-product-sale-badge {
	background: var(--wp--preset--color--accent-3);
	border-color: var(--wp--preset--color--accent-3);
	color: var(--wp--preset--color--accent-5);
	border-radius: 2px;
	min-width: 0;
	min-height: 0;
	padding: 0.2rem 0.6rem;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	line-height: 1.4;
}

/* Omnibus lowest-price note (WC Price History). */
.wc-price-history.prior-price {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--accent-4);
}

/* Catalogue: sidebar with categories and filters */
.wpk-catalog__sidebar h3.wp-block-heading {
	margin-block: 1.5rem 0.5rem;
	font-family: var(--wp--preset--font-family--karla);
	font-weight: 700;
	font-size: 0.95rem;
	letter-spacing: 0.02em;
}
.wpk-categories ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.wpk-categories li {
	padding-block: 0.2rem;
}
.wpk-categories a {
	text-decoration: none;
}
.wpk-categories a:hover {
	text-decoration: underline;
}
.wpk-catalog__toolbar {
	margin-bottom: 1rem;
}
.wpk-catalog__toolbar p {
	margin: 0;
}

/* Product cards: the button at its natural width at the bottom of the card, so
 * buttons in a row line up whatever the price notes above them. */
.wc-block-product-template > .wc-block-product {
	display: flex;
	flex-direction: column;
}
.wc-block-product > .wc-block-components-product-button {
	margin-top: auto;
	align-items: flex-start;
}
/* Specific enough to beat WooCommerce's ".wp-block-button.wc-block-components-product-button …". */
.wc-block-product .wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button {
	width: auto;
	white-space: nowrap;
}
@media (max-width: 599px) {
	.wc-block-product .wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button {
		padding-inline: 0.75rem;
	}
}

/* Home page */
.wpk-hero__image img {
	border-radius: 2px;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}
/* On a phone the image becomes a low strip above the heading. */
@media (max-width: 781px) {
	.wpk-hero > .wp-block-column:last-child {
		order: -1;
	}
	.wpk-hero__image img {
		aspect-ratio: 2 / 1;
		width: 100%;
	}
}
.wpk-perks {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1rem 1.5rem;
	margin-top: var(--wp--preset--spacing--50);
	padding: 1.25rem 1.5rem;
	background: var(--wp--preset--color--accent-5);
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 12%, transparent);
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 12%, transparent);
	font-size: 0.9rem;
	line-height: 1.35;
}
.wpk-perks > * {
	margin: 0;
}
/* Icons from assets/icons (Lucide, ISC licence), drawn in the text colour. */
.wpk-perk {
	position: relative;
	padding-left: 2.25rem;
}
.wpk-perk::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	width: 1.5rem;
	height: 1.5rem;
	background: currentColor;
	mask: var(--wpk-icon) center / contain no-repeat;
}
.wpk-perk--truck { --wpk-icon: url(assets/icons/truck.svg); }
.wpk-perk--card { --wpk-icon: url(assets/icons/credit-card.svg); }
.wpk-perk--return { --wpk-icon: url(assets/icons/undo-2.svg); }
.wpk-perk--price { --wpk-icon: url(assets/icons/badge-percent.svg); }
@media (max-width: 781px) {
	.wpk-perks {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.9rem 0.75rem;
		padding: 1rem 0.75rem;
		font-size: 0.85rem;
	}
	.wpk-perk {
		padding-left: 1.75rem;
	}
	.wpk-perk::before {
		width: 1.2rem;
		height: 1.2rem;
	}
}
/* Category tiles: stretched over the full width, at most six in a row; two in a row on a phone. */
.wpk-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(max(10rem, calc((100% - 5 * var(--wpk-tiles-gap)) / 6)), 1fr));
	gap: var(--wpk-tiles-gap);
	--wpk-tiles-gap: var(--wp--preset--spacing--30);
}
.wpk-tiles > * {
	margin: 0;
}
@media (max-width: 599px) {
	.wpk-tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
.wpk-tile .wp-block-image img {
	aspect-ratio: 1;
	object-fit: cover;
	width: 100%;
}
.wpk-tile .wp-block-image {
	margin-bottom: 0.5rem;
}
.wpk-tile__name {
	margin: 0;
	font-family: var(--wp--preset--font-family--newsreader);
	font-size: 1.25rem;
}
.wpk-tile__name a {
	text-decoration: none;
}
.wpk-section h2 {
	margin: 0;
}
/* Collection sections on a phone: one row of two products, the link leads to the rest. */
@media (max-width: 599px) {
	.wpk-section .wc-block-product-template {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.wpk-section .wc-block-product-template > .wc-block-product:nth-child(n + 3) {
		display: none;
	}
}

/* Brands page */
.wpk-brands {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
	gap: var(--wp--preset--spacing--50);
}
.wpk-brands > .wpk-brand {
	margin-block: 0;
}
.wpk-brand__image {
	margin: 0 0 1rem;
}
.wpk-brand__image img {
	aspect-ratio: 4 / 3;
	object-fit: cover;
	width: 100%;
	border-radius: 2px;
}
.wpk-brand__name {
	margin: 0 0 0.5rem;
	font-size: var(--wp--preset--font-size--x-large);
}
.wpk-brand__name a,
.wpk-brand__link a {
	text-decoration: none;
}
.wpk-brand__description {
	margin: 0 0 0.75rem;
}
.wpk-brand__link {
	margin: 0;
}
.wpk-brand__link a:hover {
	text-decoration: underline;
}

/* Header navigation */
.wpk-nav__sale a {
	color: var(--wp--preset--color--accent-3);
}
.wpk-catalog__sidebar .wc-block-product-filter-price-slider input[type="text"] {
	width: 100%;
	min-width: 0;
}
.wpk-catalog__sidebar .wc-block-product-filter-price-slider__content {
	max-width: 100%;
}

/* Footer */
.wpk-footer h3.wp-block-heading {
	margin: 0 0 0.5rem;
	font-family: var(--wp--preset--font-family--karla);
	font-weight: 700;
	font-size: 0.95rem;
}
.wpk-footer__nav {
	gap: 0.35rem;
}
.wpk-footer__seller {
	margin: 0.25rem 0 0;
	color: var(--wp--preset--color--accent-4);
	line-height: 1.6;
}
.wpk-nowrap {
	white-space: nowrap;
}
.wpk-footer__note {
	margin-top: var(--wp--preset--spacing--50);
	padding-top: 1rem;
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 12%, transparent);
	color: var(--wp--preset--color--accent-4);
}
@media (max-width: 781px) {
	.wpk-catalog__categories {
		display: none;
	}
}

/* Variation buttons: colour swatches and sizes (assets/js/variation-buttons.js) */
.wpk-variation-buttons {
	display: none;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0.25rem 0 0.5rem;
}
.wpk-variation-buttons-ready .wpk-variation-buttons {
	display: flex;
}
/* Specific enough to beat WooCommerce's ".woocommerce div.product form.cart .variations select". */
form.variations_form.wpk-variation-buttons-ready table.variations td.value select:has(+ .wpk-variation-buttons) {
	display: none;
}
.variations_form table.variations tr {
	display: flex;
	flex-direction: column;
}
.variations_form table.variations th,
.variations_form table.variations td {
	display: block;
	padding: 0;
	text-align: start;
}
.variations_form table.variations th label {
	font-weight: 700;
}
.wpk-variation-chosen:not(:empty)::before {
	content: ": ";
}
.wpk-variation-chosen {
	font-weight: 400;
}
.wpk-variation-button {
	min-width: 3rem;
	min-height: 2.75rem;
	padding: 0.4rem 0.9rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 30%, transparent);
	border-radius: 0;
	background: var(--wp--preset--color--accent-5);
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-size: 0.95rem;
	cursor: pointer;
}
.wpk-variation-button:hover {
	border-color: var(--wp--preset--color--contrast);
}
.wpk-variation-button[aria-pressed="true"] {
	border-color: var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}
.wpk-variation-button:disabled {
	opacity: 0.45;
	text-decoration: line-through;
	cursor: not-allowed;
}
.wpk-variation-button:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-1);
	outline-offset: 2px;
}
.wpk-variation-button--swatch {
	min-width: 0;
	width: 2.75rem;
	height: 2.75rem;
	padding: 3px;
	border-radius: 50%;
	background: transparent;
}
.wpk-variation-button--swatch[aria-pressed="true"] {
	background: transparent;
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--contrast);
}
.wpk-variation-button__swatch {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: var(--wpk-swatch);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wp--preset--color--contrast) 15%, transparent);
}
.wpk-variation-button--swatch:disabled {
	opacity: 0.35;
}
.variations_form .reset_variations {
	display: inline-block;
	margin-top: 0.25rem;
}

/* Size chart: link next to the size buttons, chart in a popover */
.wpk-size-chart-toggle {
	/* "Wyczyść" (reset_variations) follows in the same cell once a size is picked. */
	margin-inline-end: 1.5rem;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 0.9rem;
	text-decoration: underline;
	text-underline-offset: 0.2em;
	cursor: pointer;
}
.wpk-size-chart {
	inset: 0;
	margin: auto;
	width: min(40rem, calc(100vw - 2rem));
	height: fit-content;
	max-height: calc(100vh - 2rem);
	overflow: auto;
	box-sizing: border-box;
	padding: 1.25rem 1.5rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 20%, transparent);
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}
.wpk-size-chart::backdrop {
	background: color-mix(in srgb, var(--wp--preset--color--contrast) 40%, transparent);
}
.wpk-size-chart__header {
	display: flex;
	justify-content: space-between;
	align-items: start;
	gap: 1rem;
}
.wpk-size-chart__header h2 {
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
}
.wpk-size-chart__close {
	padding: 0 0.25rem;
	border: 0;
	background: none;
	color: inherit;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
}
.wpk-size-chart .wp-block-table table {
	table-layout: auto;
}
.wpk-size-chart .wp-block-table td,
.wpk-size-chart .wp-block-table th {
	padding: 0.45rem 0.6rem;
	font-size: 0.95rem;
	word-break: normal;
	overflow-wrap: normal;
}
@media (max-width: 599px) {
	.wpk-size-chart {
		padding: 1rem;
	}
	.wpk-size-chart .wp-block-table td,
	.wpk-size-chart .wp-block-table th {
		padding: 0.4rem;
		font-size: 0.85rem;
	}
}
.wpk-size-chart p {
	font-size: 0.9rem;
}

/* Forms: labels inside fields (block cart and checkout) and placeholders muted,
   so an empty field does not look filled in; typed text stays in the text colour. */
/* Specific enough to beat WooCommerce's ".wc-block-components-form .wc-block-components-text-input label";
   errors keep its red label; the order note textarea sets its placeholder to currentColor. */
.wc-block-components-form .wc-block-components-text-input:not(.has-error) label,
.wc-block-components-text-input:not(.has-error) label,
input::placeholder,
textarea::placeholder,
.wc-block-components-textarea::placeholder {
	color: var(--wp--preset--color--accent-4);
	opacity: 1;
}

/* Legal pages: note that the document is a template for the demo shop */
.wpk-legal-note {
	padding: 0.75rem 1rem;
	border-left: 3px solid var(--wp--preset--color--accent-2);
	background: var(--wp--preset--color--accent-5);
	font-size: 0.9rem;
}

/* Checkout: parcel lockers nearest to the address (assets/js/inpost-near-address.js) */
.wpk-inpost-nearby {
	margin: 1rem 0;
}
.wpk-inpost-nearby__title {
	margin: 0 0 0.5rem;
	font-weight: 600;
}
.wpk-inpost-nearby__points {
	display: grid;
	gap: 0.5rem;
}
.wpk-inpost-nearby__hint {
	margin: 0.75rem 0 0;
	font-size: 0.9rem;
}
.wpk-inpost-point {
	display: grid;
	gap: 0.15rem;
	width: 100%;
	padding: 0.7rem 0.9rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 30%, transparent);
	border-radius: 0;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-size: 0.9rem;
	text-align: left;
	cursor: pointer;
}
.wpk-inpost-point:hover {
	border-color: var(--wp--preset--color--contrast);
}
.wpk-inpost-point:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-1);
	outline-offset: 2px;
}
.wpk-inpost-point[aria-pressed="true"] {
	border-color: var(--wp--preset--color--contrast);
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--accent-5);
}
.wpk-inpost-point__head {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
}
.wpk-inpost-point__name {
	font-weight: 600;
}
.wpk-inpost-point[aria-pressed="true"] .wpk-inpost-point__name::before {
	content: "✓ ";
}
.wpk-inpost-point__distance {
	white-space: nowrap;
}
.wpk-inpost-point__place {
	font-style: italic;
}
.wpk-inpost-point__hours {
	font-size: 0.85rem;
	opacity: 0.75;
}

/* GPSR product safety tab (mu-plugin gpsr.php) */
.wpk-gpsr {
	display: grid;
	grid-template-columns: minmax(10rem, 15rem) 1fr;
	gap: 0.75rem 2rem;
	margin: 0;
}
.wpk-gpsr dt {
	font-weight: 600;
}
.wpk-gpsr dd {
	margin: 0;
}
@media (max-width: 599px) {
	.wpk-gpsr {
		grid-template-columns: 1fr;
		gap: 0.25rem;
	}
	.wpk-gpsr dd + dt {
		margin-top: 0.75rem;
	}
}

/* Sale unit and unit price (mu-plugin unit-price.php) */
.wpk-sale-unit {
	font-weight: 400;
}
.wpk-unit-price {
	display: block;
	font-size: 0.8em;
	font-weight: 400;
	opacity: 0.75;
}
.quantity:has(.wpk-quantity-unit) {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}
.wpk-quantity-unit {
	white-space: nowrap;
}

/* Kit contents (mu-plugin product-contents.php) */
.wpk-kit {
	margin-block: 1.25rem;
}
.wpk-kit__title {
	margin: 0 0 0.5rem;
	font-weight: 600;
}
.wpk-kit__items {
	display: grid;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}
.wpk-kit__item {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}
.wpk-kit__image {
	flex: none;
	width: 3rem;
	height: 3rem;
	object-fit: cover;
	background: var(--wp--preset--color--accent-5);
}
.wpk-kit__note {
	display: block;
	font-size: 0.85em;
	opacity: 0.75;
}

/* Contact form (mu-plugins/contact-form.php) */
.wpk-contact form {
	display: grid;
	gap: 1rem;
	max-width: 36rem;
}
.wpk-contact p {
	margin: 0;
}
.wpk-contact__field label {
	display: block;
	margin-bottom: 0.3rem;
	font-weight: 600;
}
.wpk-contact__optional {
	font-weight: 400;
	color: var(--wp--preset--color--accent-4);
}
.wpk-contact input[type="text"],
.wpk-contact input[type="email"],
.wpk-contact textarea {
	box-sizing: border-box;
	width: 100%;
	padding: 0.6rem 0.75rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 35%, transparent);
	border-radius: 4px;
	background: var(--wp--preset--color--accent-5);
	color: inherit;
	font: inherit;
}
.wpk-contact [aria-invalid="true"] {
	border-color: var(--wp--preset--color--accent-3);
}
.wpk-contact__error {
	display: block;
	margin-top: 0.3rem;
	color: var(--wp--preset--color--accent-3);
	font-size: 0.9rem;
}
.wpk-contact > .wpk-contact__error,
.wpk-contact__sent {
	margin-bottom: 1rem;
	padding: 0.75rem 1rem;
	border-left: 3px solid currentColor;
	background: var(--wp--preset--color--accent-5);
}
.wpk-contact__sent {
	color: var(--wp--preset--color--accent-1);
}
.wpk-contact__privacy {
	font-size: 0.9rem;
	color: var(--wp--preset--color--accent-4);
}
.wpk-contact__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* FAQ page: questions as details blocks */
.wpk-faq.wp-block-details {
	margin: 0;
	padding: 0.9rem 0;
	border-bottom: 1px solid var(--wp--preset--color--accent-6);
}
.wpk-faq summary {
	cursor: pointer;
	font-weight: 600;
}
.wpk-faq[open] summary {
	margin-bottom: 0.5rem;
}
