/* -------------------------------------------------------------------------
   Gumleaf · WooCommerce styling
   Keeps Woo's markup intact (so plugins like B2BKing keep working) and
   restyles it to the brand: cream base, warm-white cards, covers as hero.
   ---------------------------------------------------------------------- */

/* --- Shared ------------------------------------------------------------- */

.woocommerce,
.woocommerce-page {
	font-family: var(--wp--preset--font-family--body);
}

.woocommerce .woocommerce-breadcrumb {
	font-size: 0.8125rem;
	color: var(--wp--preset--color--ink-soft);
	margin-bottom: var(--wp--preset--spacing--40);
}

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

/* Buttons — inherit the theme.json button treatment. */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
	background-color: var(--wp--preset--color--ink);
	border: 2px solid var(--wp--preset--color--ink);
	border-radius: 10px;
	color: var(--wp--preset--color--warm-white);
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	padding: 0.9rem 1.6rem;
	min-height: 44px;
	transition: background-color 180ms ease, border-color 180ms ease;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover {
	background-color: var(--wp--preset--color--ink-deep);
	border-color: var(--wp--preset--color--ink-deep);
	color: var(--wp--preset--color--warm-white);
}

/* The single add-to-cart is the one place terracotta leads. Terracotta Deep
   keeps white text above 4.5:1 — see the note in style.css. */
.woocommerce div.product form.cart .button {
	background-color: var(--wp--preset--color--terracotta-deep);
	border-color: var(--wp--preset--color--terracotta-deep);
	color: #fff;
	font-size: 1rem;
	padding: 1rem 2rem;
}

.woocommerce div.product form.cart .button:hover {
	background-color: #83431C;
	border-color: #83431C;
}

/* --- Product listing (Books) -------------------------------------------- */

.woocommerce ul.products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: clamp(1.5rem, 3vw, 2.5rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
	display: none;
}

.woocommerce ul.products li.product {
	width: 100% !important;
	margin: 0 !important;
	float: none !important;
	clear: none !important;
	text-align: left;
	display: flex;
	flex-direction: column;
}

.woocommerce ul.products li.product a img {
	width: 100%;
	height: auto;
	margin-bottom: 1rem;
	border-radius: 4px;
	box-shadow: var(--wp--preset--shadow--cover);
	transition: transform 180ms ease, box-shadow 180ms ease;
}

.woocommerce ul.products li.product:hover a img {
	transform: translateY(-5px);
	box-shadow: var(--wp--preset--shadow--lifted);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.0625rem !important;
	font-weight: 600;
	line-height: 1.3;
	color: var(--wp--preset--color--ink);
	padding: 0.25rem 0 0.35rem !important;
}

.woocommerce ul.products li.product .price {
	color: var(--wp--preset--color--ink) !important;
	font-family: var(--wp--preset--font-family--body);
	font-size: 1rem;
	font-weight: 600;
	margin-bottom: 0.75rem;
}

.woocommerce ul.products li.product .price del {
	color: var(--wp--preset--color--ink-soft) !important;
	opacity: 1;
	font-weight: 400;
}

.woocommerce ul.products li.product .price ins {
	background: none;
	color: var(--wp--preset--color--terracotta-deep) !important;
	text-decoration: none;
}

.woocommerce ul.products li.product .gumleaf-tag {
	margin-bottom: 0.5rem;
}

/* Quick add sits at the bottom of every card, so the grid stays even. */
.woocommerce ul.products li.product .button {
	margin-top: auto;
	align-self: flex-start;
	background: transparent;
	color: var(--wp--preset--color--ink);
	border: 2px solid var(--wp--preset--color--ink);
	font-size: 0.875rem;
	padding: 0.65rem 1.15rem;
}

.woocommerce ul.products li.product .button:hover {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--warm-white);
}

.woocommerce span.onsale,
.woocommerce ul.products li.product .onsale {
	background: var(--wp--preset--color--wattle);
	color: var(--wp--preset--color--ink-deep);
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	border-radius: 999px;
	min-height: 0;
	min-width: 0;
	padding: 0.35rem 0.85rem;
	line-height: 1.2;
	top: 0.5rem;
	left: auto;
	right: 0.5rem;
	margin: 0;
}

.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering select {
	font-size: 0.875rem;
	color: var(--wp--preset--color--ink-soft);
}

.woocommerce .woocommerce-ordering select,
.woocommerce select,
.woocommerce input[type="text"],
.woocommerce input[type="email"],
.woocommerce input[type="tel"],
.woocommerce input[type="number"],
.woocommerce input[type="password"],
.woocommerce textarea {
	background: var(--wp--preset--color--warm-white);
	border: 2px solid var(--wp--preset--color--hairline);
	border-radius: 10px;
	color: var(--wp--preset--color--ink);
	font-family: inherit;
	font-size: 1rem;
	padding: 0.7rem 0.9rem;
	min-height: 44px;
}

.woocommerce input:focus,
.woocommerce select:focus,
.woocommerce textarea:focus {
	border-color: var(--wp--preset--color--terracotta);
	outline: none;
}

/* --- Filters (Woo filter blocks / widgets) ------------------------------ */

.gumleaf-filters {
	background: var(--wp--preset--color--warm-white);
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: var(--wp--custom--radius--card);
	padding: 1.5rem;
}

.gumleaf-filters .wp-block-heading {
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--leaf-deep);
	margin-bottom: 0.75rem;
}

/* --- Single product (book detail) --------------------------------------- */

.woocommerce div.product {
	display: block;
}

.woocommerce div.product div.images {
	margin-bottom: var(--wp--preset--spacing--40);
}

.woocommerce div.product div.images img {
	border-radius: 6px;
	box-shadow: var(--wp--preset--shadow--cover);
}

.woocommerce div.product .product_title {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(2rem, 4vw, 2.75rem);
	font-weight: 600;
	line-height: 1.12;
	margin-bottom: 0.5rem;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--body);
	font-size: 1.5rem;
	font-weight: 600;
}

.gumleaf-price-note {
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--wp--preset--color--ink-soft);
	letter-spacing: 0.02em;
}

.woocommerce div.product .woocommerce-product-details__short-description {
	font-size: 1.0625rem;
	line-height: 1.7;
	color: var(--wp--preset--color--ink-soft);
	max-width: 60ch;
}

.woocommerce div.product .stock.in-stock {
	color: var(--wp--preset--color--leaf-deep);
	font-weight: 600;
}

.woocommerce div.product .stock.out-of-stock {
	color: var(--wp--preset--color--terracotta-deep);
	font-weight: 600;
}

.woocommerce .quantity .qty {
	width: 5rem;
	text-align: center;
}

/* Teachers callout on the book page. */
.gumleaf-teacher-callout {
	margin: var(--wp--preset--spacing--40) 0;
	padding: 1.25rem 1.5rem;
	background: var(--wp--preset--color--warm-white);
	border: 1px solid var(--wp--preset--color--hairline);
	border-left: 4px solid var(--wp--preset--color--sage);
	border-radius: var(--wp--custom--radius--card);
}

.gumleaf-teacher-callout p {
	margin: 0.35rem 0 0;
	font-size: 0.9375rem;
}

/* Book meta table (ISBN, format, dimensions). */
.woocommerce div.product .woocommerce-tabs .panel table.shop_attributes,
.woocommerce table.shop_attributes {
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: var(--wp--custom--radius--card);
	overflow: hidden;
	font-size: 0.9375rem;
}

.woocommerce table.shop_attributes th,
.woocommerce table.shop_attributes td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--hairline);
	padding: 0.75rem 1rem;
	font-style: normal;
}

.woocommerce table.shop_attributes th {
	background: var(--wp--preset--color--warm-white);
	font-weight: 600;
	width: 40%;
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
	padding: 0;
	margin: 0 0 1.5rem;
	border-bottom: 1px solid var(--wp--preset--color--hairline);
}

.woocommerce div.product .woocommerce-tabs ul.tabs::before {
	border: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
	background: transparent;
	border: 0;
	border-radius: 0;
	margin: 0 1.5rem 0 0;
	padding: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after {
	display: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
	display: block;
	padding: 0.75rem 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-soft);
	border-bottom: 3px solid transparent;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a,
.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover {
	color: var(--wp--preset--color--ink);
	border-bottom-color: var(--wp--preset--color--terracotta);
}

.woocommerce .related > h2,
.woocommerce .upsells > h2,
.woocommerce div.product .woocommerce-tabs .panel > h2 {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.75rem;
	margin-bottom: 1.5rem;
}

/* --- Cart & checkout ---------------------------------------------------- */

.woocommerce table.shop_table {
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: var(--wp--custom--radius--card);
	border-collapse: separate;
	overflow: hidden;
	background: var(--wp--preset--color--warm-white);
}

.woocommerce table.shop_table th {
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-soft);
	padding: 1rem;
}

.woocommerce table.shop_table td {
	padding: 1rem;
	border-top: 1px solid var(--wp--preset--color--hairline);
}

.woocommerce-cart .cart-collaterals .cart_totals,
.woocommerce .woocommerce-checkout-review-order {
	background: var(--wp--preset--color--warm-white);
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: var(--wp--custom--radius--card);
	padding: 1.5rem;
}

.woocommerce-checkout #payment {
	background: var(--wp--preset--color--warm-white);
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: var(--wp--custom--radius--card);
}

.woocommerce-checkout #payment div.payment_box {
	background: var(--wp--preset--color--cream);
	border-radius: 10px;
	font-size: 0.9375rem;
}

.woocommerce-checkout #payment div.payment_box::before {
	border-bottom-color: var(--wp--preset--color--cream);
}

.woocommerce-checkout #payment ul.payment_methods li {
	padding: 1rem;
	border-bottom: 1px solid var(--wp--preset--color--hairline);
}

/* Cart/Checkout blocks (WooCommerce Blocks). */
.wc-block-components-button:not(.is-link) {
	background-color: var(--wp--preset--color--ink);
	border-radius: 10px;
	color: var(--wp--preset--color--warm-white);
	font-family: var(--wp--preset--font-family--body);
	font-weight: 600;
	min-height: 48px;
}

.wc-block-components-button:not(.is-link):hover {
	background-color: var(--wp--preset--color--ink-deep);
}

.wc-block-checkout__actions .wc-block-components-checkout-place-order-button {
	background-color: var(--wp--preset--color--terracotta-deep);
}

.wc-block-checkout__actions .wc-block-components-checkout-place-order-button:hover {
	background-color: #83431C;
}

.wc-block-components-panel,
.wc-block-components-totals-wrapper,
.wc-block-checkout__sidebar .wc-block-components-sidebar {
	border-color: var(--wp--preset--color--hairline);
}

.wc-block-components-title,
.wc-block-checkout__form .wc-block-components-checkout-step__title {
	font-family: var(--wp--preset--font-family--display) !important;
	color: var(--wp--preset--color--ink);
}

/* --- Notices ------------------------------------------------------------ */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.wc-block-components-notice-banner {
	border-top: 0;
	border-left: 4px solid var(--wp--preset--color--sage);
	border-radius: var(--wp--custom--radius--card);
	background: var(--wp--preset--color--warm-white);
	color: var(--wp--preset--color--ink);
	font-size: 0.9375rem;
}

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

.woocommerce-error {
	border-left-color: var(--wp--preset--color--terracotta);
}

.woocommerce-error::before {
	color: var(--wp--preset--color--terracotta-deep);
}

/* --- My account & school portal ----------------------------------------- */

.woocommerce-account .woocommerce-MyAccount-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	background: var(--wp--preset--color--warm-white);
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: var(--wp--custom--radius--card);
	overflow: hidden;
}

.woocommerce-account .woocommerce-MyAccount-navigation li {
	border-bottom: 1px solid var(--wp--preset--color--hairline);
}

.woocommerce-account .woocommerce-MyAccount-navigation li:last-child {
	border-bottom: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation li a {
	display: block;
	padding: 0.9rem 1.15rem;
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a,
.woocommerce-account .woocommerce-MyAccount-navigation li a:hover {
	background: var(--wp--preset--color--sand);
	color: var(--wp--preset--color--ink);
}

/* B2BKing / wholesale surfaces — kept generic so they survive plugin updates. */
.b2bking_wholesale_price,
.gumleaf-wholesale-price {
	color: var(--wp--preset--color--leaf-deep);
	font-weight: 700;
}

.b2bking_registration_form_container input,
.b2bking_registration_form_container select {
	border-radius: 10px !important;
	border: 2px solid var(--wp--preset--color--hairline) !important;
	min-height: 44px;
}

.gumleaf-po-note {
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--wp--preset--color--ink-soft);
}

/* --- Responsive --------------------------------------------------------- */

@media (min-width: 900px) {
	.woocommerce div.product div.images {
		width: 44%;
		float: left;
		margin-right: 6%;
	}

	.woocommerce div.product div.summary {
		width: 50%;
		float: right;
		margin-bottom: 0;
	}

	.woocommerce div.product .woocommerce-tabs,
	.woocommerce div.product .related,
	.woocommerce div.product .upsells {
		clear: both;
		padding-top: var(--wp--preset--spacing--60);
	}
}

@media (max-width: 599px) {
	.woocommerce ul.products {
		grid-template-columns: repeat(2, 1fr);
		gap: 1.25rem;
	}
}
