/*
 * WooCommerce presentation layer.
 * Loaded only on WooCommerce pages. Commerce logic stays in WooCommerce.
 * The shop reads like the bookshop window: covers on washed panels,
 * editorial titles, one clear action per card.
 */

/* Soft corners on every WooCommerce image. More specific rules still
   win where they exist (gallery frames, product cards). */
.woocommerce img,
.woocommerce-page img {
	border-radius: 6px;
}

/* ---------------------------------- Cards --------------------------------- */

/* Both the block Product Collection (shop archive) and the classic loop
   (related products) share the card look. */
.woocommerce ul.products li.product,
.kkh-woocommerce ul.products li.product,
.wc-block-product-template > li.wc-block-product {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--preset--border-radius--md);
	padding: var(--wp--preset--spacing--30);
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	position: relative;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.woocommerce ul.products li.product:hover,
.wc-block-product-template > li.wc-block-product:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 28px rgba(43, 33, 25, 0.12);
}

/* Photos read like the front-page cards: a plain, full-width square,
   not a framed panel. */
.woocommerce ul.products li.product img,
.wc-block-components-product-image {
	background: none;
	padding: 0;
}

.woocommerce ul.products li.product img,
.wc-block-components-product-image img {
	border-radius: var(--wp--preset--border-radius--sm);
	box-shadow: none;
}

/* Titles match the front-page cards: heading font at the default h3 size. */
.wc-block-product-template .wp-block-post-title {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	line-height: 1.3;
	margin: 0;
}

.wc-block-product-template .wp-block-post-title a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.wc-block-product-template .wp-block-post-title a:hover,
.wc-block-product-template .wp-block-post-title a:focus-visible {
	color: var(--wp--preset--color--primary);
}

/* Prices read in the brand green. */
.woocommerce ul.products li.product .price,
.wc-block-components-product-price,
.woocommerce div.product p.price {
	color: var(--wp--preset--color--primary);
	font-weight: 600;
}

/* One clear action per card, spanning it like the Order Now button.
   On phones the label wraps in the narrow card columns, so the button
   slims down instead of dominating the card. */
.wc-block-components-product-button .wp-block-button__link {
	width: 100%;
	margin-top: 0.25rem;
}

@media (max-width: 600px) {
	.wc-block-components-product-button .wp-block-button__link {
		padding: 0.4rem 0.75rem;
		font-size: 0.8125rem;
		white-space: nowrap;
	}
}

/* Sale badge: gold, round, in the corner. */
.woocommerce span.onsale,
.wc-block-components-product-sale-badge {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--ink);
	border-radius: var(--wp--preset--border-radius--round);
	font-weight: 600;
	line-height: 1;
	min-height: auto;
	min-width: auto;
	padding: 0.5rem 0.875rem;
	top: 0.75rem;
	left: 0.75rem;
	right: auto;
}

/* --------------------------- Buttons and forms ---------------------------- */

.woocommerce ul.products li.product .button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--background);
	border-radius: var(--wp--preset--border-radius--sm);
	font-weight: 600;
	text-decoration: none;
}

.woocommerce ul.products li.product .button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
	background: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--background);
}

.woocommerce a.button.alt,
.woocommerce button.button.alt {
	background: var(--wp--preset--color--secondary);
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce .woocommerce-ordering select {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--preset--border-radius--sm);
	padding: 0.625rem 0.75rem;
}

/* Quantity inputs (single product, cart): same boxed field look. They
   render without the .form-row wrapper, so the rule above misses them. */
.woocommerce .quantity .qty {
	box-sizing: border-box;
	width: 4.5rem;
	height: auto;
	text-align: center;
	background: var(--wp--preset--color--background);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--preset--border-radius--sm);
	padding: 0.625rem 0.75rem;
	font: inherit;
}

/* Checkout rules live in woocommerce-checkout.css, order-confirmation
   rules in woocommerce-order.css — both page-scoped like this sheet. */

/* Cart line-item photos match the 6px rounding every WooCommerce image
   gets; the cart block renders outside the .woocommerce wrapper, so it
   needs its own rule. */
table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image img {
	border-radius: 6px;
}

/* Notices. */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	border-top-color: var(--wp--preset--color--primary);
}

.woocommerce-message::before,
.woocommerce-info::before {
	color: var(--wp--preset--color--primary);
}

/* Star ratings use the theme accent. */
.woocommerce .star-rating span::before {
	color: var(--wp--preset--color--accent);
}

/* --------------------------- Shop archive chrome --------------------------- */

/* Breadcrumb reads as a small eyebrow above the archive title. */
.woocommerce-breadcrumb {
	color: var(--wp--preset--color--muted);
	font-size: 0.8125rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-bottom: 0.5rem;
}

.woocommerce-breadcrumb a {
	color: var(--wp--preset--color--muted);
}

.woocommerce-breadcrumb a:hover,
.woocommerce-breadcrumb a:focus-visible {
	color: var(--wp--preset--color--primary);
}

/* On phones the trail reads as one line — Home/Accessories/Royal Albert
   — scrolling sideways instead of wrapping to a second row. */
@media (max-width: 600px) {
	.woocommerce-breadcrumb {
		white-space: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		text-transform: none;
		letter-spacing: normal;
	}

	.woocommerce-breadcrumb::-webkit-scrollbar {
		display: none;
	}
}

/* Archive header: breadcrumb, title, and description sit as one compact
   block — the theme's default 2rem gap between them reads as a hole. */
.woocommerce-page main.wp-block-group > .wp-block-query-title {
	margin-top: 0.25rem;
}

.woocommerce-page main.wp-block-group > .wp-block-term-description {
	margin-top: 0.75rem;
	max-width: 44rem;
}

.woocommerce-page main.wp-block-group > .wp-block-group.alignwide {
	margin-top: 1.25rem;
}

/* Archive title: heading type at display weight, with the gold bar the
   section headings wear. Kept a step below a page display heading so the
   header stays compact under the breadcrumb. */
.woocommerce-page .wp-block-query-title {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	line-height: 1.15;
	font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem);
}

.woocommerce-page .wp-block-query-title::after {
	content: "";
	display: block;
	width: 3rem;
	height: 3px;
	margin-top: 0.625rem;
	border-radius: var(--wp--preset--border-radius--round);
	background: var(--wp--preset--color--accent);
}

/* Category descriptions read as a short intro under the title. */
.woocommerce-page .wp-block-term-description {
	color: var(--wp--preset--color--muted);
}

/* Toolbar between the header and the grid: results left, sorting right.
   The toolbar is the only direct-child group of main. */
.woocommerce-page main > .wp-block-group.alignwide {
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding-bottom: 1rem;
}

.woocommerce-result-count,
.wc-block-components-product-results-count {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

.woocommerce-result-count {
	margin: 0;
}

/* On phones the toolbar stacks: count above, full-width sorting below. */
@media (max-width: 600px) {
	.woocommerce-page main > .wp-block-group.alignwide {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.875rem;
		padding-bottom: 0.875rem;
	}

	.woocommerce-page .wc-block-catalog-sorting,
	.woocommerce-ordering,
	.woocommerce-ordering .orderby {
		width: 100%;
	}
}
/* Currency switcher styles live in style.css: product cards and the
   header dropdown render outside WooCommerce pages too. */
