/*
Theme Name: Shop Kit Theme
Description: Premium, technical block theme for physical-product WooCommerce shops. Installed and branded by the Shop Kit plugin.
Version: 1.1.0
Requires at least: 7.0
Requires PHP: 8.1
Text Domain: shopkit-theme
License: GPL-2.0-or-later
*/

:root {
	--shopkit-rule: 1px solid var(--wp--preset--color--border);
	--shopkit-radius: 2px;
}
/* Set on body so the Site Editor palette applies; the fallbacks cover palettes saved before these colours existed */
body {
	--shopkit-highlight: var(--wp--preset--color--highlight, #355f8a);
	--shopkit-highlight-light: var(--wp--preset--color--highlight-light, #a8c8e6);
	--shopkit-deep: var(--wp--preset--color--deep, #0b1b2d);
	--shopkit-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* ---------- Base ---------- */

/* Visible keyboard focus everywhere; dark panels switch to their own text colour */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--contrast);
	outline-offset: 2px;
}
.shopkit-hero :focus-visible,
.shopkit-footer :focus-visible { outline-color: currentColor; }
/* Text links only, so a link styled as a button keeps its own readable colour */
:where(main) :where(p, li, td, figcaption, h2, h3) > a:not([class*="button"]):hover { color: var(--shopkit-highlight); }
img { max-width: 100%; height: auto; }
body { -webkit-font-smoothing: antialiased; }
h1, h2, h3 { text-wrap: balance; }
/* Figures line up in prices and tables */
.price, .wc-block-components-product-price, .woocommerce-Price-amount, table { font-variant-numeric: tabular-nums; }

/* Keeps the footer at the bottom of short pages */
.wp-site-blocks { display: flex; flex-direction: column; min-height: 100vh; }
.admin-bar .wp-site-blocks { min-height: calc(100vh - 32px); }
.wp-site-blocks > footer { margin-top: auto; }

/* ---------- Header ---------- */

.shopkit-promo { text-align: center; }
.shopkit-promo p { margin: 0; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.shopkit-header { border-bottom: var(--shopkit-rule); }
.shopkit-header .wp-block-site-logo img { max-height: 56px; width: auto; }
/* The logo already names the shop, so the text title is only shown without one */
.shopkit-header .wp-block-site-logo ~ .wp-block-site-title { display: none; }
.shopkit-header .wp-block-navigation { font-weight: 500; }
.shopkit-header .wp-block-navigation-item__content:hover,
.shopkit-header .current-menu-item > .wp-block-navigation-item__content {
	text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.5em;
}

/* Search sits between the shop name and the menu, and takes its own row on phones */
.shopkit-header .shopkit-search { flex: 1 1 14rem; max-width: 24rem; margin-inline: auto; }
.shopkit-search .wp-block-search__inside-wrapper {
	padding: 0; border: 1px solid var(--wp--preset--color--muted); border-radius: var(--shopkit-radius); background: var(--wp--preset--color--surface);
}
.shopkit-search .wp-block-search__input {
	min-width: 0; min-height: 2.75rem; padding: 0 0.75rem; border: 0; background: transparent; color: inherit; font: inherit; font-size: var(--wp--preset--font-size--small);
}
.shopkit-search .wp-block-search__button {
	min-width: 2.75rem; margin: 0; padding: 0; border: 0; background: transparent; color: var(--wp--preset--color--contrast);
}
.shopkit-search .wp-block-search__input::placeholder { color: var(--wp--preset--color--muted); opacity: 1; }
@media (max-width: 781px) {
	.shopkit-header .shopkit-search { order: 3; flex-basis: 100%; max-width: none; }
}

/* ---------- Home page ---------- */

.shopkit-hero { position: relative; overflow: hidden; isolation: isolate; }
/* Decorative lattice, drawn in the banner's text colour so it suits any brand colour */
.shopkit-hero::after {
	content: ""; position: absolute; inset: 0 0 0 52%; z-index: -1; pointer-events: none;
	background: currentColor; opacity: 0.17;
	-webkit-mask: url("assets/images/lattice.svg") right center / cover no-repeat;
	mask: url("assets/images/lattice.svg") right center / cover no-repeat;
}
.shopkit-hero__inner { padding-block: clamp(0rem, 3vw, 2.5rem); }
.shopkit-hero__inner > * { max-width: 36rem; }
.shopkit-hero .shopkit-eyebrow { margin: 0; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.shopkit-hero h1 { margin-block: 1rem 0; }
.shopkit-hero p:not(.shopkit-eyebrow) { font-size: var(--wp--preset--font-size--large); font-weight: 400; line-height: 1.5; }
.shopkit-hero .wp-block-buttons { margin-top: 2rem; gap: 0.75rem; }
.shopkit-hero .wp-block-button__link { border: 1px solid transparent; }
.shopkit-hero .is-style-outline > .wp-block-button__link { background: transparent; color: inherit; border-color: currentColor; }
.shopkit-hero .wp-block-button__link:hover { text-decoration: underline; text-underline-offset: 0.25em; }
@media (max-width: 960px) { .shopkit-hero::after { display: none; } }

/* Banner picture: right half on wide screens, below the text on small ones */
.shopkit-hero__media { position: relative; aspect-ratio: 4 / 3; }
.shopkit-hero__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shopkit-hero.has-hero-image::after { display: none; }
@media (min-width: 961px) {
	.shopkit-hero .shopkit-hero__media { position: absolute; inset: 0 0 0 52%; aspect-ratio: auto; max-width: none; margin: 0 !important; }
	.shopkit-hero.has-hero-image .shopkit-hero__inner { padding-block: clamp(2.5rem, 6vw, 5.5rem); }
	.shopkit-hero.has-hero-image .shopkit-hero__inner > * { max-width: min(36rem, 42vw); }
}
@media (max-width: 960px) {
	.shopkit-hero .shopkit-hero__media { margin-top: 2.5rem; margin-bottom: calc(-1 * var(--wp--preset--spacing--60)); }
}

.shopkit-section > h2 { margin: 0 0 1.75rem; padding-top: 1.5rem; border-top: var(--shopkit-rule); }
.shopkit-reasons > .wp-block-column { padding-top: 1.25rem; border-top: 2px solid var(--shopkit-highlight); }
/* The story sits on a full-width grey band */
.shopkit-section:has(> .shopkit-story) {
	padding-block: var(--wp--preset--spacing--50); background: var(--wp--preset--color--surface);
	box-shadow: 0 0 0 100vmax var(--wp--preset--color--surface); clip-path: inset(0 -100vmax);
}
.shopkit-reasons h3 { margin: 0 0 0.5rem; font-size: var(--wp--preset--font-size--medium); }
.shopkit-reasons p { margin: 0; color: var(--wp--preset--color--muted); }
.wp-block-media-text .wp-block-media-text__content { padding-inline: clamp(0rem, 4vw, 3.5rem); }
@media (max-width: 600px) { .wp-block-media-text .wp-block-media-text__content { padding: 1.5rem 0 0; } }

.shopkit-testimonials { display: grid; gap: var(--wp--preset--spacing--40); grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.shopkit-testimonials figure { display: flex; flex-direction: column; margin: 0; padding: var(--wp--preset--spacing--40); border: var(--shopkit-rule); border-radius: var(--shopkit-radius); }
.shopkit-testimonials blockquote { margin: 0 0 1.25rem; }
.shopkit-testimonials blockquote p { margin: 0; }
.shopkit-testimonials figcaption { margin-top: auto; font-size: var(--wp--preset--font-size--small); font-weight: 600; color: var(--wp--preset--color--muted); }

/* ---------- Product cards (home page shortcodes and shop grid) ---------- */

/* WooCommerce floats these lists; a grid keeps cards the same height */
body .woocommerce ul.products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--wp--preset--spacing--40); margin: 0; }
body .woocommerce.columns-3 ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body .woocommerce ul.products::before,
body .woocommerce ul.products::after { display: none; }
body .woocommerce ul.products li.product,
body .wc-block-product-template .wc-block-product {
	display: flex; flex-direction: column; box-sizing: border-box; margin: 0; padding: 0 0 1.25rem;
	border: var(--shopkit-rule); border-radius: var(--shopkit-radius); background: var(--wp--preset--color--base);
	transition: border-color 0.15s ease;
}
/* The columns class is needed to outrank WooCommerce's percentage widths */
body .woocommerce ul.products li.product,
body .woocommerce[class*="columns-"] ul.products li.product { width: 100%; margin: 0; float: none; clear: none; text-align: left; }
body .woocommerce ul.products li.product:hover,
body .wc-block-product-template .wc-block-product:hover { border-color: var(--wp--preset--color--contrast); }
body .woocommerce ul.products li.product img,
body .wc-block-product-template .wc-block-product .wc-block-components-product-image { width: 100%; margin: 0 0 1rem; border-bottom: var(--shopkit-rule); border-radius: 0; }
body .woocommerce ul.products li.product .woocommerce-loop-category__title,
body .woocommerce ul.products li.product .woocommerce-loop-product__title,
body .wc-block-product-template .wc-block-product .wp-block-post-title {
	margin: 0; padding: 0 1.25rem; font-size: var(--wp--preset--font-size--medium); line-height: 1.35; letter-spacing: -0.005em; text-align: left;
}
body .woocommerce ul.products li.product .price,
body .wc-block-product-template .wc-block-product .wc-block-components-product-price {
	margin: 0.4rem 0 1.25rem; padding: 0 1.25rem; font-size: var(--wp--preset--font-size--medium); text-align: left; color: var(--wp--preset--color--contrast);
}
.woocommerce-price-suffix, .woocommerce-price-suffix small { font-size: 0.75rem; color: var(--wp--preset--color--muted); }
body .woocommerce ul.products li.product .button,
body .wc-block-product-template .wc-block-product .wp-block-button { margin: auto 1.25rem 0; align-self: flex-start; }
/* Quieter outline buttons in grids, filled on hover */
body .woocommerce ul.products li.product .button,
body .wc-block-product-template .wc-block-product .wp-block-button__link {
	padding: 0.6rem 1.1rem; border: 1px solid var(--wp--preset--color--contrast); border-radius: var(--shopkit-radius);
	background: transparent; color: var(--wp--preset--color--contrast); font-size: var(--wp--preset--font-size--small); font-weight: 600;
}
body .woocommerce ul.products li.product .button:hover,
body .wc-block-product-template .wc-block-product .wp-block-button__link:hover { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }
body .woocommerce ul.products li.product a.added_to_cart { margin: 0.5rem 1.25rem 0; }

/* Category cards: the whole card is one link */
body .woocommerce ul.products li.product-category { padding-bottom: 0; }
body .woocommerce ul.products li.product-category a { text-decoration: none; }
body .woocommerce ul.products li.product-category img { margin: 0; }
body .woocommerce ul.products li.product-category .woocommerce-loop-category__title { padding: 1rem 1.25rem; }
body .woocommerce ul.products li.product mark.count { background: none; color: var(--wp--preset--color--muted); font-weight: 400; }

@media (max-width: 960px) {
	body .woocommerce ul.products,
	body .woocommerce.columns-3 ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
	/* Three categories stay in one row on tablets */
	body .woocommerce.columns-3 ul.products:has(> li.product-category) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
	/* Categories become rows, so an odd number never leaves a gap */
	body .woocommerce.columns-3 ul.products:has(> li.product-category) { grid-template-columns: 1fr; }
	body .woocommerce ul.products li.product-category a { display: flex; align-items: center; }
	body .woocommerce ul.products li.product-category img { width: 6rem; border: 0; border-right: var(--shopkit-rule); }
	body .woocommerce ul.products li.product .woocommerce-loop-category__title,
	body .woocommerce ul.products li.product .woocommerce-loop-product__title,
	body .woocommerce ul.products li.product .price { padding-inline: 0.875rem; }
	body .woocommerce ul.products li.product .button { margin-inline: 0.875rem; }
	/* Tighter two-column cards on phones */
	body .wc-block-product-template .wc-block-product .wp-block-post-title,
	body .wc-block-product-template .wc-block-product .wc-block-components-product-price { padding-inline: 0.875rem; }
	body .wc-block-product-template .wc-block-product .wp-block-button { margin-inline: 0.875rem; }
	body .woocommerce ul.products li.product:not(.product-category) .woocommerce-loop-product__title,
	body .woocommerce ul.products li.product .price,
	body .wc-block-product-template .wc-block-product .wp-block-post-title,
	body .wc-block-product-template .wc-block-product .wc-block-components-product-price { font-size: var(--wp--preset--font-size--small); }
	body .woocommerce ul.products li.product .button,
	body .wc-block-product-template .wc-block-product .wp-block-button__link { padding: 0.5rem 0.65rem; font-size: 0.8125rem; }
}

/* Category and reference lines, on shop cards and home page cards alike */
body .shopkit-card__category, body .shopkit-card__reference { display: block; padding: 0 1.25rem; line-height: 1.4; text-align: left; }
body .shopkit-card__category {
	margin-bottom: 0.35rem; color: var(--shopkit-highlight); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
}
body .shopkit-card__reference { margin-top: 0.4rem; color: var(--wp--preset--color--muted); font-family: var(--shopkit-mono); font-size: 0.75rem; font-weight: 400; overflow-wrap: anywhere; }
body .wc-block-product-template .wc-block-product > :not(.shopkit-card__category, .shopkit-card__reference) { margin-block: 0; }
body .wc-block-product-template .wc-block-product .wc-block-components-product-image { margin-bottom: 1rem; }
/* Prices are the same size on every card; the block's own size class is marked important */
body .wc-block-product-template .wc-block-product .wc-block-components-product-price { margin-block: 0.4rem 1.25rem; font-size: var(--wp--preset--font-size--medium) !important; }
body .wc-block-product-template .wc-block-product .wp-block-button { margin-top: auto; }
/* Outranks the default bottom gap the product block gives every child */
body .wc-block-product-template .wc-block-product .shopkit-card__reference { margin-bottom: 0; }
.shopkit-prior-price { font-size: 0.75rem; font-weight: 400; color: var(--wp--preset--color--muted); }
@media (max-width: 600px) {
	body .shopkit-card__category, body .shopkit-card__reference { padding-inline: 0.875rem; }
	body .wc-block-product-template .wc-block-product .wp-block-post-title,
	body .wc-block-product-template .wc-block-product .wc-block-components-product-price { font-size: var(--wp--preset--font-size--small) !important; }
}

/* ---------- Shop page ---------- */

.shopkit-shop { align-items: flex-start; }
@media (max-width: 781px) {
	.shopkit-shop > .wp-block-column { flex-basis: 100% !important; }
}
.wc-block-product-filters h2.wp-block-heading {
	margin-bottom: 0.75rem; padding-top: 1rem; border-top: var(--shopkit-rule);
	font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase;
}
.woocommerce-breadcrumb, .wc-block-breadcrumbs { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }

/* ---------- Product page ---------- */

.single-product .wp-block-woocommerce-product-image-gallery img { border-radius: var(--shopkit-radius); }
.single-product .woocommerce-product-gallery { border: var(--shopkit-rule); border-radius: var(--shopkit-radius); }
.single-product .wp-block-woocommerce-product-price .wc-block-components-product-price { font-weight: 600; }
.single-product form.cart { padding-block: 1.5rem; border-block: var(--shopkit-rule); }
.single-product .wc-block-product .has-text-align-center { text-align: left; }
/* The tab already says "Description", so the repeated heading is kept for screen readers only */
.single-product .woocommerce-Tabs-panel--description > h2:first-child {
	position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* Reference, category and tags read as a short specification list */
.single-product .wp-block-woocommerce-product-meta > .wp-block-group { flex-direction: column; align-items: stretch; gap: 0; }
.single-product .wp-block-woocommerce-product-meta > .wp-block-group > * {
	display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0; padding-block: 0.6rem; border-bottom: var(--shopkit-rule); font-size: var(--wp--preset--font-size--small);
}
.single-product .wp-block-woocommerce-product-meta .wp-block-post-terms__prefix { min-width: 7rem; color: var(--wp--preset--color--muted); }
.single-product .wp-block-woocommerce-product-meta .sku { font-family: var(--shopkit-mono); }
.single-product table.woocommerce-product-attributes th { width: 14rem; text-align: left; font-weight: 600; }
.single-product table.woocommerce-product-attributes :is(th, td) { padding: 0.65rem 0.75rem; border-bottom: var(--shopkit-rule); font-style: normal; }
.single-product table.woocommerce-product-attributes td p { margin: 0; padding: 0; }
/* Side-by-side tabs only: stacked tabs on phones already have WooCommerce's side marker */
@media (min-width: 782px) {
	.woocommerce div.product .woocommerce-tabs ul.tabs li.active,
	.single-product .wc-block-components-product-details ul.tabs li.active { box-shadow: inset 0 -2px 0 var(--shopkit-highlight); }
}

/* ---------- Cart and checkout ---------- */

/* Totals sit in a grey panel. At checkout only when beside the form: narrow screens use WooCommerce's fold-out summary */
.wc-block-cart .wc-block-components-sidebar,
.wc-block-components-sidebar-layout.is-large .wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block {
	box-sizing: border-box; padding-block: 0.5rem 1rem; border: var(--shopkit-rule); border-top: 3px solid var(--wp--preset--color--accent);
	border-radius: var(--shopkit-radius); background: var(--wp--preset--color--surface);
}
.wc-block-cart .wc-block-components-sidebar { padding-inline: 1rem; }
.wc-block-components-sidebar-layout.is-large .wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block { overflow: hidden; }
.wc-block-components-text-input input[type], .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input,
.wc-blocks-components-select .wc-blocks-components-select__container, .wc-block-components-textarea { border-radius: var(--shopkit-radius) !important; }
.wc-block-components-checkout-step__title { font-size: var(--wp--preset--font-size--large) !important; }

/* Checkout keeps the legal pages one click away, without the full footer */
.shopkit-checkout-footer { border-top: var(--shopkit-rule); font-size: var(--wp--preset--font-size--small); }
.shopkit-checkout-footer ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.75rem; margin: 0; padding: 0; list-style: none; }
.shopkit-checkout-footer a { display: inline-block; padding-block: 0.25rem; color: var(--wp--preset--color--muted); }

/* ---------- Account ---------- */

.woocommerce-account .woocommerce-MyAccount-navigation ul { margin: 0; padding: 0; list-style: none; border-top: var(--shopkit-rule); }
body.woocommerce-account .woocommerce-MyAccount-navigation li { margin: 0; padding: 0; border-bottom: var(--shopkit-rule); }
/* Lines the account area up with its page title */
body.woocommerce-account main .entry-content > .woocommerce { max-width: 1000px; }
.woocommerce-account .woocommerce-MyAccount-navigation li a { display: block; padding: 0.65rem 0.75rem; text-decoration: none; }
.woocommerce-account .woocommerce-MyAccount-navigation li a:hover { background: var(--wp--preset--color--surface); }
.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a { box-shadow: inset 3px 0 0 var(--shopkit-highlight); background: var(--wp--preset--color--surface); font-weight: 600; }
.woocommerce-account table.shop_table { border: var(--shopkit-rule); border-radius: var(--shopkit-radius); font-size: var(--wp--preset--font-size--small); }
.woocommerce-account table.shop_table th { background: var(--wp--preset--color--surface); text-align: left; }
/* Order actions: compact outline buttons rather than a stack of solid blocks */
body.woocommerce-account table.shop_table .woocommerce-button.button {
	display: inline-block; width: auto; margin: 0.2rem 0.25rem 0.2rem 0; padding: 0.45rem 0.8rem; border: 1px solid var(--wp--preset--color--contrast);
	border-radius: var(--shopkit-radius); background: transparent; color: var(--wp--preset--color--contrast); font-size: 0.8125rem; text-align: center;
}
body.woocommerce-account table.shop_table .woocommerce-button.button:hover { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }

/* ---------- Cookie banner (restyles the plugin's banner to match) ---------- */

body .shopkit-consent {
	border: var(--shopkit-rule); border-top: 3px solid var(--wp--preset--color--accent); border-radius: var(--shopkit-radius);
	background: var(--wp--preset--color--base); color: var(--wp--preset--color--contrast); box-shadow: 0 12px 40px rgba(11, 27, 45, 0.18);
}
/* Both choices stay identical on purpose */
body .shopkit-consent .shopkit-consent__actions button {
	border: 2px solid var(--wp--preset--color--accent); border-radius: var(--shopkit-radius);
	background: var(--wp--preset--color--accent); color: var(--wp--preset--color--accent-contrast);
}

/* ---------- Forms ---------- */

select, .woocommerce-ordering select, .quantity input, table.variations select {
	padding: 0.55rem 0.75rem; border: 1px solid var(--wp--preset--color--muted); border-radius: var(--shopkit-radius);
	background-color: var(--wp--preset--color--base); color: inherit; font: inherit; font-size: var(--wp--preset--font-size--small);
}
/* WooCommerce fixes a height that would clip the chosen option */
select, table.variations select { height: auto; min-height: 2.75rem; line-height: 1.4; }
table.variations select { padding-right: 2.25rem; }
/* Fields are limited rather than the form, so forms line up with the page text */
.shopkit-form input[type="text"], .shopkit-form input[type="email"], .shopkit-form textarea { max-width: 36rem; }
.shopkit-form label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.shopkit-form input[type="text"], .shopkit-form input[type="email"], .shopkit-form textarea {
	box-sizing: border-box; width: 100%; padding: 0.65rem 0.75rem; font: inherit;
	border: 1px solid var(--wp--preset--color--muted); border-radius: var(--shopkit-radius); background: var(--wp--preset--color--base); color: inherit;
}
.shopkit-form input:focus, .shopkit-form textarea:focus { border-color: var(--shopkit-highlight); }
.shopkit-link-button { margin-left: 0.75rem; padding: 0.5rem 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- Footer ---------- */

.shopkit-footer { background: var(--shopkit-deep); color: #fff; }
.shopkit-footer h2 { color: var(--shopkit-highlight-light); }
.shopkit-footer a { color: inherit; text-decoration: none; }
.shopkit-footer a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.shopkit-footer p { margin-block: 0.4rem; }
.shopkit-footer .shopkit-footer-brand img { max-width: 100%; max-height: 56px; width: auto; }
.shopkit-footer ul { list-style: none; padding: 0; margin: 0; }
.shopkit-footer li { margin-block: 0.55rem; }
.shopkit-footer h2 { margin-bottom: 1rem; font-size: 0.75rem !important; letter-spacing: 0.12em; text-transform: uppercase; }
/* Legal line and cookie settings sit under a faint rule */
.shopkit-footer > .wp-block-group:last-child { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
