/*
 * WooCommerce and header refinements for the Axioma theme.
 * Colours and fonts come from theme.json presets; only layout details live here.
 */

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

.axioma-header {
	position: sticky;
	top: 0;
	z-index: 50;
}

.admin-bar .axioma-header {
	top: var(--wp-admin--admin-bar--height, 0);
}

.axioma-header__actions .wp-block-search__button,
.axioma-header__actions .wc-block-mini-cart__button,
.axioma-header__actions .wc-block-customer-account a {
	min-width: 44px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	color: var(--wp--preset--color--contrast);
	border: 0;
	padding: 0.5rem;
}

.axioma-header__search .wp-block-search__input {
	border: 1px solid var(--wp--preset--color--accent-4);
	border-radius: var(--wp--custom--radius);
	min-height: 44px;
}

.wp-block-navigation .wp-block-navigation-item__content {
	padding-block: 0.5rem;
}

.wp-block-navigation__submenu-container {
	border: 1px solid var(--wp--preset--color--accent-6) !important;
	background: var(--wp--preset--color--base) !important;
	padding: 0.5rem 0;
	text-transform: none;
	letter-spacing: 0;
}

/* In the full-screen mobile menu the submenu is a plain indented list. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	border: 0 !important;
	padding: 0;
}

/* Tablet / small laptop: keep the menu on one line and the site name unbroken. */
.axioma-header .wp-block-site-title,
.axioma-header .wp-block-navigation-item__label {
	white-space: nowrap;
}

@media (min-width: 600px) and (max-width: 1100px) {
	.axioma-header .wp-block-navigation {
		--wp--style--block-gap: 1rem;
		gap: 1rem;
		font-size: 0.75rem;
		letter-spacing: 0.03em;
	}

	.axioma-header .wp-block-navigation .wp-block-navigation__container {
		flex-wrap: nowrap;
		gap: 1rem;
	}

	/* Delivery and Contact stay reachable from the footer; inside the burger menu they are shown. */
	.axioma-header .wp-block-navigation__responsive-container:not(.is-menu-open) .axioma-nav-secondary {
		display: none;
	}
}

/* Mobile: logo left, burger + icons right. */
@media (max-width: 781px) {
	.axioma-header .wp-block-site-title {
		font-size: 1.4rem;
	}

	.axioma-header > .alignwide {
		gap: 0.25rem;
	}

	.axioma-header .wp-block-navigation {
		order: 3;
	}
}

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

.is-style-axioma-plain {
	list-style: none;
	padding-left: 0;
	margin-top: 0.75rem;
}

.axioma-footer a {
	text-decoration: none;
}

.axioma-footer a:hover,
.axioma-footer a:focus-visible {
	text-decoration: underline;
}

/* ---------- Category tiles ---------- */

.axioma-category-tile {
	width: 100%;
}

.axioma-category-tile .wp-block-image {
	width: 100%;
	margin: 0;
	overflow: hidden;
	background: var(--wp--preset--color--accent-3);
}

.axioma-category-tile img {
	width: 100%;
	transition: transform 0.6s ease;
}

.axioma-category-tile:hover img {
	transform: scale(1.03);
}

.axioma-category-tile h3 {
	margin: 0;
}

.axioma-category-tile h3 a {
	text-decoration: none;
}

.axioma-category-tile h3 a::after {
	content: " →";
	color: var(--wp--preset--color--accent-1);
}

.axioma-steps li + li {
	margin-top: 0.75rem;
}

/* ---------- Product grids ---------- */

.wc-block-product-template .wc-block-components-product-image img,
.wc-block-grid__product-image img,
ul.products li.product img {
	aspect-ratio: 4 / 5;
	object-fit: cover;
	width: 100%;
	background: var(--wp--preset--color--accent-3);
}

.wc-block-product-template .wp-block-post-title a,
ul.products li.product .woocommerce-loop-product__title {
	text-decoration: none;
	font-family: var(--wp--preset--font-family--cormorant);
}

.wc-block-components-product-price,
.price {
	color: var(--wp--preset--color--contrast);
}

/* Old price is struck through and labelled by WooCommerce for screen readers;
   the sale badge carries text, so the discount is never shown by colour alone. */
.wc-block-components-product-price del,
.price del {
	color: var(--wp--preset--color--accent-4);
	font-weight: 400;
}

.wc-block-components-product-sale-badge,
.onsale {
	background: var(--wp--preset--color--contrast) !important;
	color: var(--wp--preset--color--base) !important;
	border: 0 !important;
	border-radius: var(--wp--custom--radius) !important;
	font-size: 0.75rem !important;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* ---------- Single product ---------- */

.single-product .wp-block-woocommerce-product-image-gallery img,
.woocommerce-product-gallery__image img {
	background: var(--wp--preset--color--accent-3);
}

.single-product .stock {
	font-weight: 600;
}

.single-product .stock.out-of-stock::before {
	content: "✕ ";
}

.single-product .stock.in-stock::before {
	content: "✓ ";
}

.wc-block-components-quantity-selector,
.quantity .qty {
	min-height: 44px;
}

.woocommerce-tabs .tabs,
.wc-tabs {
	border-bottom: 1px solid var(--wp--preset--color--accent-6);
}

.axioma-product-details dt {
	font-weight: 600;
	margin-top: 0.75rem;
}

.axioma-product-details dd {
	margin-left: 0;
}

.axioma-made-to-order {
	padding: 0.75rem 1rem;
	border-left: 2px solid var(--wp--preset--color--accent-1);
	background: var(--wp--preset--color--accent-3);
	font-size: var(--wp--preset--font-size--small);
}

/* ---------- Forms: cart, checkout, account ---------- */

.wc-block-components-text-input input,
.wc-block-components-textarea,
.wc-blocks-components-select select,
.woocommerce form .input-text,
.woocommerce form select {
	border-color: var(--wp--preset--color--accent-4) !important;
	border-radius: var(--wp--custom--radius) !important;
}

.wc-block-components-validation-error,
.woocommerce-error {
	font-weight: 600;
}

.wc-block-components-validation-error::before {
	content: "! ";
}

.wc-block-components-button:not(.is-link),
.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button {
	border-radius: var(--wp--custom--radius) !important;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-weight: 600;
	min-height: 48px;
}

/* ---------- Store notice / coming soon ---------- */

.woocommerce-store-notice,
p.demo_store {
	background: var(--wp--preset--color--contrast) !important;
	color: var(--wp--preset--color--base) !important;
}

/* ---------- Catalog: category chips ---------- */

.axioma-category-chips ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	margin: var(--wp--preset--spacing--30) 0 0;
	padding: 0;
}

.axioma-category-chips a {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0.35rem 1rem;
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: 999px;
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
}

.axioma-category-chips a:hover {
	border-color: var(--wp--preset--color--contrast);
}

/* Current category: filled and bold, so it is not marked by colour alone. */
.axioma-category-chips a[aria-current="page"] {
	background: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font-weight: 600;
}

.wc-block-catalog-sorting select,
.woocommerce-ordering select {
	min-height: 44px;
	padding: 0 2rem 0 0.75rem;
	border: 1px solid var(--wp--preset--color--accent-4);
	border-radius: var(--wp--custom--radius);
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}
