/* Small enhancements that theme.json cannot express. */

.wp-site-blocks { overflow-x: clip; }

/* Sticky header */
.nx-header {
	position: sticky;
	top: 0;
	z-index: 50;
}
.admin-bar .nx-header { top: 32px; }
@media (max-width: 782px) {
	.admin-bar .nx-header { top: 0; position: relative; }
}

/* Header search: let it shrink on small screens */
.nx-header .wp-block-search { flex: 1 1 220px; max-width: 420px; }
@media (max-width: 781px) {
	.nx-header .wp-block-search { order: 10; flex-basis: 100%; max-width: none; }
}

.nx-header .wp-block-search,
.nx-header .wp-block-search * { box-sizing: border-box; }
.nx-header .wp-block-search__inside-wrapper { width: 100% !important; max-width: 100%; }
.nx-header .wp-block-search__inside-wrapper { display: flex; }
.nx-header .wp-block-search__input { min-width: 0; flex: 1 1 auto; width: 100%; }

/* Hero media box is shorter on phones */
@media (max-width: 781px) {
	.nx-hero-media { min-height: 240px !important; }
}

/* Product cards */
.nx-product-card {
	height: 100%;
	transition: transform .2s ease, box-shadow .2s ease;
}
.nx-product-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 30px rgba(17, 17, 17, .08);
}
.nx-product-card .wc-block-components-product-image img {
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 8px;
}
.nx-product-card .wp-block-woocommerce-product-button { margin-top: auto; }

/* Sale badge */
.wc-block-components-product-sale-badge {
	background: var(--wp--preset--color--sale) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 999px !important;
	padding: .2em .7em !important;
	font-size: .75rem !important;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
}

/* Prices */
.wc-block-components-product-price del,
.wp-block-woocommerce-product-price del { opacity: .55; font-weight: 400; }
.wc-block-components-product-price ins,
.wp-block-woocommerce-product-price ins { text-decoration: none; }

/* Feature (trust) cards */
.nx-feature { height: 100%; }

/* Buttons: consistent hover */
.wp-element-button,
.wp-block-button__link,
.wc-block-components-button:not(.is-link) {
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

/* Form fields */
input[type="text"], input[type="email"], input[type="search"], input[type="tel"],
input[type="password"], input[type="number"], select, textarea {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 8px;
	padding: .6em .8em;
	font: inherit;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

/* Single product */
.nx-single-product .woocommerce-product-gallery img { border-radius: 12px; }
.nx-single-product .wc-block-add-to-cart-form .quantity .qty {
	min-height: 48px;
	border-radius: 8px;
}
.nx-single-product .wc-block-add-to-cart-form .single_add_to_cart_button {
	min-height: 48px;
	padding-inline: 2em;
}

/* Tabs on single product */
.wp-block-woocommerce-product-details ul.wc-tabs {
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding: 0;
}
.wp-block-woocommerce-product-details ul.wc-tabs li a { font-weight: 600; }

/* Blog cards */
.nx-post-card .wp-block-post-featured-image img { border-radius: 10px; }

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}
