/*
Theme Name: Maskothijos
Theme URI: https://maskothijos.cl
Description: Child block theme of Twenty Twenty-Five for the Maskothijos online store.
Author: Maskothijos
Template: twentytwentyfive
Version: 0.4.2
Requires at least: 6.5
Requires PHP: 8.1
License: GNU General Public License v2 or later
Text Domain: maskothijos
*/

/* Only what theme.json cannot express. */

/* Product card */
.wc-block-product,
.woocommerce ul.products li.product {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px;
	padding: 12px;
	display: flex;
	flex-direction: column;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wc-block-product:hover,
.wc-block-product:focus-within {
	border-color: var(--wp--preset--color--accent);
	box-shadow: 0 4px 14px rgb(0 0 0 / 8%);
}

.wc-block-product .wp-block-post-title {
	margin: 0.5rem 0 0.25rem;
}

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

.wc-block-product .wp-block-woocommerce-product-price {
	font-weight: 700;
	font-size: 18px;
}

/* Full-width add-to-cart button, pinned to the card bottom */
.wc-block-product .wp-block-woocommerce-product-button {
	margin-top: auto;
}

.wc-block-product .wp-block-button__link,
.wc-block-product .wc-block-components-product-button__button {
	width: 100%;
	text-align: center;
	justify-content: center;
}

/* Stock indicator: colored dot + text */
.mh-stock {
	display: flex;
	align-items: center;
	gap: 0.4em;
	margin-top: 0.25rem;
	font-size: 0.85rem;
	font-weight: 500;
	font-family: var(--wp--preset--font-family--figtree);
}

.mh-stock::before {
	content: "";
	width: 0.6em;
	height: 0.6em;
	border-radius: 50%;
	background: currentcolor;
}

.mh-stock--ok::before { color: var(--wp--preset--color--stock-ok); }
.mh-stock--low::before { color: var(--wp--preset--color--stock-low); }
.mh-stock--out::before { color: var(--wp--preset--color--stock-out); }

/* Category chips */
.mh-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 16px 0;
}

.mh-chip {
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--wp--preset--color--surface-dark);
	color: var(--wp--preset--color--foreground);
	font-size: 0.9rem;
	font-weight: 500;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.mh-chip:hover,
.mh-chip.is-active {
	background: var(--wp--preset--color--foreground);
	color: var(--wp--preset--color--surface);
	text-decoration: none;
}

/* Header search: wide enough for the full placeholder */
header .wp-block-search,
.wp-block-template-part .wp-block-search {
	flex: 1 1 100%;
	min-width: 0;
}

@media (min-width: 782px) {
	header .wp-block-search,
	.wp-block-template-part .wp-block-search {
		flex: 1 1 320px;
		min-width: 320px;
	}
}

/* Sort select */
.wc-block-catalog-sorting select {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 10px;
	padding: 8px 12px;
	font: inherit;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--foreground);
}

@media (prefers-reduced-motion: reduce) {
	.wc-block-product,
	.mh-chip {
		transition: none;
	}
}

/* Visible keyboard focus */
:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* Prices: monospace with aligned digits */
.price,
.wc-block-components-product-price,
.wp-block-woocommerce-product-price,
.woocommerce-Price-amount {
	font-family: var(--wp--preset--font-family--jetbrains-mono);
	font-variant-numeric: tabular-nums;
}

/* Single product */
.mh-gallery .woocommerce-product-gallery,
.mh-gallery .wp-block-woocommerce-product-image-gallery {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px;
	background: var(--wp--preset--color--surface);
	overflow: hidden;
}

.mh-summary .wp-block-woocommerce-product-price {
	font-size: clamp(1.75rem, 4vw, 2.25rem);
	font-weight: 700;
	line-height: 1.2;
}

.mh-summary .mh-stock {
	font-size: 1rem;
	margin: 0.5rem 0 1rem;
}

.mh-summary .single_add_to_cart_button,
.mh-summary .wc-block-components-product-button__button {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent-contrast);
	border-radius: 10px;
	padding: 0.85em 2em;
	font-weight: 600;
}

.mh-summary .quantity .qty {
	min-height: 44px;
}

/* Cart, checkout and account (classic shortcodes) */
.woocommerce-cart-form table.shop_table,
.woocommerce-checkout table.shop_table,
.cart_totals table {
	width: 100%;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px;
	border-collapse: separate;
	border-spacing: 0;
	background: var(--wp--preset--color--surface);
	overflow: hidden;
}

table.shop_table th,
table.shop_table td {
	padding: 12px 14px;
	border-bottom: 1px solid var(--wp--preset--color--border);
	text-align: left;
	vertical-align: middle;
}

table.shop_table thead th {
	background: var(--wp--preset--color--surface-dark);
	font-weight: 600;
}

table.shop_table tr:last-child > th,
table.shop_table tr:last-child > td {
	border-bottom: 0;
}

.woocommerce-cart-form .product-thumbnail img {
	width: 64px;
	height: auto;
	border-radius: 10px;
}

.woocommerce-cart-form .quantity .qty {
	width: 5rem;
}

.woocommerce-cart-form .coupon {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.woocommerce-cart-form .coupon .input-text {
	width: auto;
	min-width: 12rem;
}

.cart_totals,
#order_review,
#payment {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px;
	padding: 16px;
}

#payment {
	margin-top: 16px;
}

#payment ul.payment_methods {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
}

#payment div.payment_box {
	background: var(--wp--preset--color--surface-dark);
	border-radius: 10px;
	padding: 12px;
	margin-top: 8px;
}

.cart_totals .order-total .amount,
#order_review .order-total .amount {
	font-weight: 700;
	font-size: 1.2rem;
}

.checkout-button,
#place_order {
	display: block;
	width: 100%;
	text-align: center;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent-contrast);
	border: 0;
	border-radius: 10px;
	padding: 0.9em 1.5em;
	font-weight: 700;
	cursor: pointer;
}

#shipping_method {
	list-style: none;
	margin: 0;
	padding: 0;
}

#shipping_method li {
	margin: 4px 0;
}

/* Form fields */
.woocommerce form .form-row {
	margin-bottom: 14px;
}

.woocommerce form .form-row label {
	display: block;
	margin-bottom: 4px;
	font-weight: 500;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row select,
.woocommerce form .form-row textarea,
.woocommerce-cart-form .coupon .input-text,
.woocommerce .quantity .qty {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 10px;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--foreground);
	font: inherit;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row select:focus,
.woocommerce form .form-row textarea:focus {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* Turnstile widget: keep it fully visible and spaced */
.cf-turnstile {
	display: block;
	min-height: 65px;
	margin: 16px 0;
	overflow: visible;
}

/* Notices */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
	list-style: none;
	margin: 0 0 16px;
	padding: 12px 16px;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-left-width: 4px;
	border-radius: 10px;
	color: var(--wp--preset--color--foreground);
}

.woocommerce-message { border-left-color: var(--wp--preset--color--stock-ok); }
.woocommerce-info { border-left-color: var(--wp--preset--color--highlight); }
.woocommerce-error { border-left-color: var(--wp--preset--color--stock-out); }

/* My account: login and register */
.woocommerce-account form.woocommerce-form-login,
.woocommerce-account form.woocommerce-form-register {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px;
	padding: 20px;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
	list-style: none;
	padding: 0;
}

/* Checkout: two columns on desktop, one on mobile */
@media (min-width: 782px) {
	form.checkout {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
		gap: 24px;
		align-items: start;
	}

	form.checkout #customer_details {
		grid-column: 1;
		grid-row: 1 / span 2;
	}

	form.checkout #order_review_heading,
	form.checkout #order_review {
		grid-column: 2;
	}
}

/* Checkout: WooCommerce floats billing/shipping side by side; stack them inside our left column */
#customer_details .col-1,
#customer_details .col-2 {
	float: none;
	width: 100%;
}

/* Single product: the stock line is already shown by .mh-stock; compact quantity input */
.mh-summary .stock {
	display: none;
}

.mh-summary .quantity .qty {
	width: 5rem;
}

/* Mobile: logo and menu on the first row, search below; nothing hidden behind a hamburger */
header .wp-block-image {
	flex: 0 0 auto;
	margin: 0;
}

header .wp-block-image img {
	max-width: none;
}

@media (max-width: 781px) {
	header .wp-block-search {
		order: 3;
		flex: 1 1 100%;
	}

	header .wp-block-navigation {
		margin-left: auto;
	}

	header .wp-block-search__input {
		font-size: 0.9rem;
		min-width: 0;
	}

	.wp-block-group:has(> .wp-block-woocommerce-catalog-sorting) {
		flex-wrap: wrap;
		gap: 8px;
	}
}
