/*
Theme Name: haij merch
Theme URI: https://merch.haij.eu
Description: Dark storefront for haij merch, styled after haij.eu. Child theme of Twenty Twenty-Five.
Author: Uppereight
Template: twentytwentyfive
Version: 1.2.3
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: haij-merch
*/

/* Header: translucent bar like haij.eu's nav. Logo | nav | actions */
.haij-header {
	position: sticky;
	top: 0;
	z-index: 50;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 1rem;
	min-height: 68px;
	margin: 0;
	padding: 0 max(var(--wp--preset--spacing--50), calc((100% - 1240px) / 2));
	background: var(--wp--custom--nav-bg);
	backdrop-filter: blur(14px) saturate(140%);
	-webkit-backdrop-filter: blur(14px) saturate(140%);
	border-bottom: 1px solid var(--wp--preset--color--accent-6);
}

.haij-header > * {
	margin: 0 !important;
}

.admin-bar .haij-header {
	top: var(--wp-admin--admin-bar--height, 32px);
}

.haij-logo {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	justify-self: start;
	text-decoration: none;
}

.haij-logo img {
	display: block;
	height: 26px;
	width: auto;
}

.haij-logo span {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.8125rem;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--accent-4);
}

.haij-logo .haij-logo__tag {
	padding: 0.15rem 0.55rem;
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: 999px;
	background: #ffffff08;
	font-size: 0.6875rem;
	line-height: 1.4;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

/* Centre nav: quiet links that light up, like haij.eu */
.haij-header__nav .wp-block-navigation__container {
	flex-wrap: nowrap;
	gap: 0.25rem;
}

.haij-header__nav .wp-block-navigation-item__content {
	padding: 0.45rem 0.85rem !important;
	border-radius: 0.5rem;
	color: var(--wp--preset--color--accent-4);
	font-size: 0.9375rem;
	font-weight: 500;
	text-decoration: none;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.haij-header__nav .wp-block-navigation-item__content:hover,
.haij-header__nav .wp-block-navigation-item__content:focus-visible,
.haij-header__nav .current-menu-item > .wp-block-navigation-item__content,
.haij-header__nav [aria-current="page"] {
	background: #ffffff0d;
	color: var(--wp--preset--color--contrast);
}

/* Right: account + cart as outlined buttons */
.haij-header__actions {
	justify-self: end;
}

.haij-header .wp-block-woocommerce-customer-account a,
.haij-header .wc-block-mini-cart__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	height: 40px;
	min-width: 40px;
	padding: 0 0.7rem;
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: 0.6rem;
	background: #ffffff05;
	color: var(--wp--preset--color--contrast);
	font-size: 0.875rem;
	font-weight: 600;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.haij-header .wp-block-woocommerce-customer-account a {
	padding: 0;
}

.haij-header .wp-block-woocommerce-customer-account a:hover,
.haij-header .wc-block-mini-cart__button:hover {
	border-color: #ffffff33;
	background: #ffffff0d;
}

.haij-header .wc-block-customer-account__account-icon,
.haij-header .wc-block-mini-cart__icon {
	width: 20px;
	height: 20px;
}

.haij-header .wc-block-mini-cart__amount {
	color: var(--wp--preset--color--contrast);
}

.haij-header .wc-block-mini-cart__badge {
	border: 2px solid var(--wp--preset--color--base);
	background: var(--wp--preset--color--accent-1) !important;
	color: var(--wp--preset--color--ink) !important;
	font-weight: 700;
}

/* Checkout header: logo, reassurance, way back */
.haij-secure {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	color: var(--wp--preset--color--accent-4);
	font-size: 0.875rem;
}

.haij-secure svg {
	color: var(--wp--preset--color--accent-1);
}

.haij-back {
	justify-self: end;
	color: var(--wp--preset--color--accent-4);
	font-size: 0.875rem;
	text-decoration: none;
}

.haij-back:hover {
	color: var(--wp--preset--color--contrast);
}

@media (max-width: 781px) {
	.haij-header {
		grid-template-columns: auto 1fr auto;
	}

	.haij-header__nav {
		justify-self: end;
	}

	.haij-header .haij-nav-wide {
		display: none;
	}

	.haij-header .wc-block-mini-cart__amount {
		display: none;
	}

	.haij-header--checkout .haij-secure {
		justify-self: end;
	}

	.haij-header--checkout .haij-back {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.haij-header__nav .wp-block-navigation-item__content,
	.haij-header .wp-block-woocommerce-customer-account a,
	.haij-header .wc-block-mini-cart__button {
		transition: none;
	}
}

/* Hero */
.haij-pill {
	display: inline-block;
	padding: 0.4rem 1rem;
	border: 1px solid #8b5cf666;
	border-radius: 999px;
	background: #8b5cf61a;
	color: #a78bfa;
	font-size: 0.9375rem;
	font-weight: 500;
}

.haij-gradient {
	background: linear-gradient(135deg, #a78bfa 0%, #818cf8 50%, #6366f1 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.haij-hero {
	background:
		radial-gradient(60% 50% at 50% 0%, var(--wp--custom--glow-color) 0%, transparent 70%),
		var(--wp--preset--color--base);
}

.haij-colours {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.25rem;
	max-width: 1080px;
	margin: 0 auto;
}

.haij-colours a {
	display: block;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: 1rem;
	background: var(--wp--preset--color--accent-5);
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
	transition: transform 0.2s ease, border-color 0.2s ease;
}

.haij-colours a:hover,
.haij-colours a:focus-visible {
	transform: translateY(-3px);
	border-color: #00bc7d80;
}

.haij-colours img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
}

.haij-colours span {
	display: flex;
	justify-content: space-between;
	padding: 0.9rem 1.1rem;
	font-weight: 600;
}

.haij-colours small {
	color: var(--wp--preset--color--accent-4);
	font-weight: 400;
}

@media (max-width: 640px) {
	.haij-colours {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.haij-colours a {
		transition: none;
	}
}

/* WooCommerce: product images as rounded cards */
.wc-block-components-product-image img,
.woocommerce-product-gallery img,
.wp-block-woocommerce-product-image-gallery img,
ul.products li.product img {
	border-radius: 1rem;
}

/* WooCommerce: dark form controls (checkout, cart, account) */
.woocommerce input.input-text,
.woocommerce textarea,
.woocommerce select,
.wc-block-components-text-input input,
.wc-block-components-textarea,
.wc-blocks-components-select select,
.wc-block-components-combobox .wc-block-components-combobox-control input,
.wc-block-components-quantity-selector,
.variations select {
	background-color: var(--wp--custom--input-bg) !important;
	border: 1px solid var(--wp--preset--color--accent-6) !important;
	border-radius: 0.5rem;
	color: var(--wp--preset--color--contrast) !important;
}

.wc-block-components-text-input label,
.wc-block-components-combobox label,
.wc-blocks-components-select label {
	color: var(--wp--preset--color--accent-4) !important;
}

.wc-block-components-quantity-selector input,
.wc-block-components-quantity-selector button {
	color: var(--wp--preset--color--contrast) !important;
}

.wc-block-components-panel,
.wc-block-components-totals-wrapper,
.wc-block-components-order-summary,
.wc-block-cart-items,
.wc-block-components-sidebar .wc-block-components-panel {
	border-color: var(--wp--preset--color--accent-6) !important;
}

.wc-block-mini-cart__drawer .components-modal__content,
.wc-block-mini-cart__drawer .wc-block-mini-cart__template-part {
	background: var(--wp--preset--color--accent-5);
	color: var(--wp--preset--color--contrast);
}

.woocommerce-store-notice,
p.demo_store {
	background: #8b5cf6;
}

.wc-block-components-notice-banner {
	border-radius: 0.75rem;
	border-color: var(--wp--preset--color--accent-6);
	background-color: var(--wp--preset--color--accent-5);
	color: var(--wp--preset--color--contrast);
}

.wc-block-components-notice-banner.is-success {
	border-color: #00bc7d66;
	background-color: #00bc7d14;
}

.wc-block-components-notice-banner.is-error {
	border-color: #ef444466;
	background-color: #ef444414;
}

.wc-block-components-notice-banner.is-success > svg {
	background-color: var(--wp--preset--color--accent-1);
}

.wc-block-components-notice-banner a {
	color: var(--wp--preset--color--contrast);
}

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

.haij-pdp-main .woocommerce-breadcrumb,
.haij-pdp-main .wc-block-breadcrumbs {
	margin-bottom: var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--accent-4);
}

.haij-pdp-main .wc-block-breadcrumbs a,
.haij-pdp-main .woocommerce-breadcrumb a {
	color: var(--wp--preset--color--accent-4);
	text-decoration: none;
}

.haij-pdp-main .wc-block-breadcrumbs a:hover,
.haij-pdp-main .woocommerce-breadcrumb a:hover {
	color: var(--wp--preset--color--contrast);
}

.haij-pdp {
	align-items: flex-start !important;
}

/* Gallery: front and back of the chosen colour, stacked */
.haij-gallery {
	display: grid;
	gap: 1rem;
}

.haij-gallery__item {
	position: relative;
	margin: 0;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: 1.25rem;
	background: var(--wp--preset--color--accent-5);
}

.haij-gallery__item img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
}

.haij-gallery__item figcaption {
	position: absolute;
	top: 1rem;
	left: 1rem;
	padding: 0.3rem 0.75rem;
	border-radius: 999px;
	background: #0a0a0fb3;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	color: #fff;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* Buy box stays in view while the gallery scrolls */
.haij-pdp__buy {
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) + 96px);
}

.haij-pdp__buy .wp-block-post-title {
	margin-bottom: 0.25rem;
}

.haij-pdp__buy .wc-block-components-product-price,
.haij-pdp__buy .wp-block-woocommerce-product-price {
	margin-top: 0;
	color: var(--wp--preset--color--contrast);
	font-weight: 600;
}

.haij-summary p {
	margin: 0;
	font-size: 1.0625rem;
}

/* Swatches and size buttons (the real dropdowns stay hidden in the form) */
.haij-has-options table.variations,
.haij-has-options .reset_variations {
	display: none !important;
}

.haij-options {
	margin-bottom: 1.5rem;
}

.haij-options__label {
	margin-bottom: 0.65rem;
	color: var(--wp--preset--color--contrast);
	font-size: 0.9375rem;
	font-weight: 600;
}

.haij-options__value {
	margin-left: 0.5rem;
	color: var(--wp--preset--color--accent-4);
	font-weight: 400;
}

.haij-options__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.haij-swatch,
.haij-size {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	min-height: 44px;
	padding: 0 1rem;
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: 0.75rem;
	background: var(--wp--preset--color--accent-5);
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-size: 0.9375rem;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.haij-size {
	min-width: 56px;
	padding: 0 0.75rem;
}

.haij-swatch:hover,
.haij-size:hover {
	border-color: #ffffff40;
}

.haij-swatch[aria-checked="true"],
.haij-size[aria-checked="true"] {
	border-color: var(--wp--preset--color--accent-1);
	background: #00bc7d1a;
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--accent-1);
}

.haij-swatch:focus-visible,
.haij-size:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-3);
	outline-offset: 2px;
}

.haij-swatch__dot {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	box-shadow: inset 0 0 0 1px #ffffff40;
}

/* Quantity + add to cart on one row, button fills it */
.haij-pdp__buy .single_variation_wrap .woocommerce-variation-price {
	display: none;
}

.haij-pdp__buy .woocommerce-variation-add-to-cart,
.haij-pdp__buy form.cart:not(.variations_form) {
	display: flex;
	gap: 0.75rem;
	align-items: stretch;
}

.haij-pdp__buy .quantity input.qty {
	width: 4.5rem;
	height: 100%;
	min-height: 52px;
	border-radius: 0.75rem;
	text-align: center;
}

.haij-pdp__buy .single_add_to_cart_button {
	flex: 1;
	min-height: 52px;
	border-radius: 0.75rem !important;
	font-size: 1.0625rem !important;
}

.haij-pdp__buy .single_add_to_cart_button.disabled {
	opacity: 0.5;
}

/* Design notes under the buy button */
.haij-details {
	margin-top: var(--wp--preset--spacing--50);
	padding-top: var(--wp--preset--spacing--40);
	border-top: 1px solid var(--wp--preset--color--accent-6);
	font-size: 0.9375rem;
}

.haij-details h2,
.haij-details h3 {
	margin: 1.25rem 0 0.35rem;
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.haij-details p {
	margin: 0;
}

@media (max-width: 781px) {
	.haij-pdp__buy {
		position: static;
	}

	.haij-options__list:not(.is-colour) {
		display: grid;
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}

	.haij-size {
		min-width: 0;
		padding: 0;
	}

	/* Front/back as a swipeable row on phones */
	.haij-gallery {
		grid-auto-flow: column;
		grid-auto-columns: 85%;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		margin-right: calc(-1 * var(--wp--preset--spacing--50));
		padding-right: var(--wp--preset--spacing--50);
		scrollbar-width: none;
	}

	.haij-gallery::-webkit-scrollbar {
		display: none;
	}

	.haij-gallery__item {
		scroll-snap-align: start;
	}
}

@media (prefers-reduced-motion: reduce) {
	.haij-swatch,
	.haij-size {
		transition: none;
	}
}

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

.haij-checkout .wp-block-post-title {
	margin-bottom: var(--wp--preset--spacing--30);
}

.haij-checkout .wp-block-woocommerce-checkout,
.haij-checkout .wc-block-checkout {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

.wc-block-components-checkout-order-summary__title-text,
.wp-block-woocommerce-checkout-order-summary-block .wc-block-components-title {
	color: var(--wp--preset--color--contrast);
}

.wc-block-checkout__form .wc-block-components-title,
.wc-block-components-checkout-step__title {
	color: var(--wp--preset--color--contrast);
	font-weight: 600;
}

.wc-block-components-checkout-step__description,
.wc-block-checkout__guest-checkout-notice,
.wc-block-checkout__terms {
	color: var(--wp--preset--color--accent-4);
}

/* Order summary as a card */
.wp-block-woocommerce-checkout-order-summary-block,
.wp-block-woocommerce-cart-totals-block {
	border: 1px solid var(--wp--preset--color--accent-6) !important;
	border-radius: 1rem;
	background: var(--wp--preset--color--accent-5);
	overflow: hidden;
}

.wc-block-components-order-summary-item__image img,
.wc-block-cart-item__image img {
	border-radius: 0.5rem;
}

.wc-block-components-order-summary-item__quantity {
	border-color: var(--wp--preset--color--accent-5) !important;
	background: var(--wp--preset--color--accent-1) !important;
	color: var(--wp--preset--color--ink) !important;
	box-shadow: none !important;
}

.wc-block-components-totals-item__label,
.wc-block-components-product-metadata {
	color: var(--wp--preset--color--accent-4);
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
	color: var(--wp--preset--color--contrast);
}

/* Checkboxes and radios */
.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"],
.wc-block-components-radio-control__input {
	border: 1px solid #ffffff40 !important;
	background-color: var(--wp--custom--input-bg) !important;
}

.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"]:checked {
	border-color: var(--wp--preset--color--accent-1) !important;
	background-color: var(--wp--preset--color--accent-1) !important;
}

.wc-block-components-checkbox .wc-block-components-checkbox__mark {
	fill: var(--wp--preset--color--ink) !important;
}

.wc-block-components-radio-control__input:checked {
	border-color: var(--wp--preset--color--accent-1) !important;
}

.wc-block-components-radio-control__input:checked::before {
	background: var(--wp--preset--color--accent-1) !important;
}

.wc-block-components-checkbox__input:focus-visible,
.wc-block-components-radio-control__input:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-3) !important;
	outline-offset: 2px;
}

/* Shipping and payment choices as cards */
.wc-block-components-radio-control--highlight-checked,
.wc-block-components-radio-control-accordion-option,
.wc-block-components-radio-control__option {
	border-color: var(--wp--preset--color--accent-6) !important;
}

.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option-checked,
.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control-accordion-option--checked-option-highlighted {
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--accent-1) !important;
	background: #00bc7d0d;
}

.wc-block-components-radio-control__label,
.wc-block-components-radio-control__secondary-label {
	color: var(--wp--preset--color--contrast);
}

.wc-block-components-radio-control__description,
.wc-block-components-radio-control__secondary-description {
	color: var(--wp--preset--color--accent-4);
}

/* Fields: placeholder-labels readable, focus in brand green */
.wc-block-components-text-input input:focus,
.wc-blocks-components-select select:focus,
.wc-block-components-textarea:focus {
	border-color: var(--wp--preset--color--accent-1) !important;
	box-shadow: 0 0 0 1px var(--wp--preset--color--accent-1) !important;
	outline: none;
}

.wc-blocks-components-select .wc-blocks-components-select__container {
	border-radius: 0.5rem;
	background: var(--wp--custom--input-bg);
}

.wc-blocks-components-select .wc-blocks-components-select__expand {
	fill: var(--wp--preset--color--accent-4);
}

.wc-block-components-address-card {
	border-color: var(--wp--preset--color--accent-6) !important;
	border-radius: 0.75rem;
}

.wc-block-components-address-card__edit {
	color: var(--wp--preset--color--accent-3);
}

/* Place order */
.wc-block-components-checkout-place-order-button,
.wc-block-cart__submit-button {
	min-height: 56px;
	border-radius: 0.75rem !important;
	font-size: 1.0625rem !important;
	font-weight: 600 !important;
}

.wc-block-components-checkout-return-to-cart-button {
	color: var(--wp--preset--color--accent-4);
}

/* Phone checkout: order summary collapses into the card's title row */
.wc-block-checkout.is-mobile .wp-block-woocommerce-checkout-order-summary-block > *:first-child {
	margin-top: 0 !important;
}

.wc-block-checkout.is-mobile .wc-block-components-checkout-order-summary__title {
	margin: 0;
	padding: 1rem 1.25rem;
	border-top: 0;
}

.wc-block-checkout.is-mobile .wc-block-components-checkout-order-summary__content {
	padding: 0 1.25rem;
}
