/*
 * Owen: WooCommerce pages (courses page, event page, cart, checkout, order received).
 * Loaded only where WooCommerce renders. Colours and fonts come from the theme presets.
 * brandID rules: solid colour blocks, no arches, no thin outlines (focus rings excepted).
 */

/* ---------- Courses page ---------- */

.owen-shop .owen-shop__title {
	max-width: 14ch;
	margin: 0 0 24px;
	font-size: clamp(2.75rem, 7vw, 6rem);
	line-height: 1;
}

.owen-shop .owen-shop__title::after {
	content: ".";
}

.owen-shop .owen-shop__intro {
	max-width: 620px;
	margin: 0 0 clamp(36px, 5vw, 64px);
	line-height: 1.75;
}

/* ---------- Event page ---------- */

.owen-event__layout {
	display: grid;
	grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
	gap: clamp(28px, 5vw, 88px);
	align-items: start;
}

.owen-event__media {
	position: sticky;
	top: 24px;
}

.owen-event__image,
.owen-event__image img {
	width: 100%;
	border-radius: 0;
}

.owen-event__image img {
	object-fit: cover;
}

.owen-event__type {
	margin: 0 0 18px;
	font-size: 0.8rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.owen-event__type a {
	color: inherit;
	text-decoration: none;
}

.owen-event .wp-block-post-title {
	margin: 0 0 20px;
	font-size: clamp(2.6rem, 5vw, 4.6rem);
	line-height: 1;
}

.owen-event .wp-block-post-title::after {
	content: ".";
}

.owen-event__lead {
	margin: 0 0 28px;
	font-family: var(--owen-serif);
	font-size: 1.3rem;
	font-style: italic;
	line-height: 1.45;
}

.owen-event__lead p {
	margin: 0;
}

.owen-event__buy {
	padding-top: 8px;
}

.owen-event__price {
	gap: 10px;
	align-items: baseline;
	margin-bottom: 18px;
}

.owen-event__price p {
	margin: 0;
}

.owen-event__price .wp-block-woocommerce-product-price,
.owen-event__price .wc-block-components-product-price {
	font-size: 2.2rem;
	font-weight: 700;
}

.owen-event__body {
	max-width: 760px;
	margin: clamp(48px, 7vw, 96px) auto 0;
	line-height: 1.8;
}

.owen-event__body p {
	margin: 0 0 1.2em;
}

.owen-event__more {
	margin-top: clamp(64px, 9vw, 130px);
	padding: clamp(28px, 4vw, 56px);
	background: var(--owen-butter);
}

.owen-event__more h2 {
	margin-bottom: 32px;
}

/* Add-to-cart form: seats + "Prenota" */

.wp-block-woocommerce-add-to-cart-form form.cart {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: stretch;
}

.wp-block-woocommerce-add-to-cart-form .quantity {
	display: inline-flex;
}

.wp-block-woocommerce-add-to-cart-form .quantity .input-text,
.wp-block-woocommerce-add-to-cart-form input.qty {
	width: 92px;
	min-height: 60px;
	padding: 0 14px;
	color: var(--owen-blue);
	background: var(--owen-butter);
	border: 0;
	border-radius: 0;
	font: inherit;
	font-size: 1.1rem;
	font-weight: 700;
	text-align: center;
}

/* Primary action: Energy Orange, large bold text (3.4:1) */
.wp-block-woocommerce-add-to-cart-form .single_add_to_cart_button,
.wp-block-woocommerce-add-to-cart-form .wp-element-button,
.wc-block-components-button:not(.is-link),
.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button,
.woocommerce .button,
.woocommerce button.button {
	display: inline-flex;
	gap: 18px;
	align-items: center;
	justify-content: center;
	min-height: 60px;
	padding: 0 30px;
	color: var(--owen-flour);
	background: var(--owen-orange);
	border: 0;
	border-radius: 0;
	font-family: inherit;
	font-size: 1.2rem;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.2;
	text-decoration: none;
	text-transform: none;
	cursor: pointer;
	transition: background 190ms ease;
}

.wp-block-woocommerce-add-to-cart-form .single_add_to_cart_button::after {
	content: "→";
}

.wp-block-woocommerce-add-to-cart-form .single_add_to_cart_button:hover,
.wp-block-woocommerce-add-to-cart-form .wp-element-button:hover,
.wc-block-components-button:not(.is-link):hover,
.woocommerce .button:hover {
	color: var(--owen-flour);
	background: var(--owen-blue);
}

/* ---------- Cart, checkout, order received ---------- */

.owen-checkout .wp-block-post-title {
	margin-bottom: 0.6em;
	text-transform: lowercase;
}

.owen-checkout .wp-block-post-title::after {
	content: ".";
}

.owen-checkout .wc-block-components-title,
.owen-checkout .wc-block-components-checkout-step__title,
.owen-checkout h2,
.owen-checkout h3 {
	font-family: var(--owen-serif);
	font-weight: 400;
	letter-spacing: 0;
}

.owen-checkout .wp-block-woocommerce-checkout,
.owen-checkout .wp-block-woocommerce-cart {
	max-width: 1180px;
	margin-inline: auto;
}

/* Fields: solid butter blocks instead of outlined boxes */
.owen-checkout .wc-block-components-form input[type="text"],
.owen-checkout .wc-block-components-form input[type="email"],
.owen-checkout .wc-block-components-form input[type="tel"],
.owen-checkout .wc-block-components-form input[type="number"],
.owen-checkout .wc-block-components-form input[type="password"],
.owen-checkout .wc-block-components-form .wc-block-components-text-input input,
.owen-checkout .wc-block-components-form .wc-block-components-text-input.is-active input,
.owen-checkout input[type="text"],
.owen-checkout input[type="email"],
.owen-checkout input[type="tel"],
.owen-checkout input[type="number"],
.owen-checkout input[type="password"],
.owen-checkout textarea,
.owen-checkout select,
.owen-checkout .wc-block-components-text-input input,
.owen-checkout .wc-blocks-components-select .wc-blocks-components-select__select {
	color: var(--owen-blue);
	background: var(--owen-butter);
	border: 0;
	border-radius: 0;
	box-shadow: none;
	font-family: inherit;
}

.owen-checkout .wc-block-components-text-input label,
.owen-checkout .wc-block-components-text-input.is-active label {
	color: var(--owen-blue);
}

.owen-checkout input:focus,
.owen-checkout select:focus,
.owen-checkout textarea:focus {
	outline: 3px solid var(--owen-orange);
	outline-offset: 2px;
	box-shadow: none;
}

.owen-checkout .wc-block-components-sidebar,
.owen-checkout .wp-block-woocommerce-checkout-totals-block,
.owen-checkout .wp-block-woocommerce-cart-totals-block {
	color: var(--owen-blue);
}

/* Cart / checkout totals: a butter block, no hairlines */
.owen-checkout .wp-block-woocommerce-cart-totals-block,
.owen-checkout .wp-block-woocommerce-checkout-totals-block {
	padding: 24px;
	background: var(--owen-butter);
}

.owen-checkout .wc-block-components-order-summary,
.owen-checkout .wc-block-components-totals-wrapper,
.owen-checkout .wc-block-components-panel,
.owen-checkout .wc-block-components-totals-item,
.owen-checkout .wc-block-cart-items,
.owen-checkout .wc-block-cart-items__row,
.owen-checkout .wc-block-cart-items th,
.owen-checkout .wc-block-cart-items td,
.owen-checkout .wc-block-components-order-summary-item,
.owen-checkout .wc-block-components-checkout-step,
.owen-checkout .wc-block-components-product-metadata {
	border-color: transparent;
}

/* No hairlines anywhere in cart/checkout (form controls excepted) */
.owen-checkout :is([class*="wc-block"], [class*="wp-block-woocommerce"]):not(.wc-block-components-checkbox__input):not(.wc-block-components-radio-control__input):not(:focus-visible) {
	border-color: transparent;
	border-radius: 0;
}

.owen-checkout .wc-block-components-product-metadata,
.owen-checkout .wc-block-components-product-details {
	margin-top: 6px;
	font-size: 0.86rem;
	line-height: 1.5;
}

.owen-checkout .wc-block-components-product-details__name {
	font-weight: 700;
}

.owen-checkout .wc-block-components-radio-control__option,
.owen-checkout .wc-block-components-radio-control-accordion-option {
	background: var(--owen-butter);
	border: 0;
	box-shadow: none;
}

.owen-checkout .wc-block-components-radio-control__input,
.owen-checkout .wc-block-components-checkbox__input {
	background: var(--owen-butter);
	border-color: var(--owen-blue);
}

.owen-checkout .wc-block-components-radio-control__input:checked,
.owen-checkout .wc-block-components-checkbox__input:checked {
	border-color: var(--owen-blue);
}

.owen-checkout a {
	color: var(--owen-blue);
	text-decoration: underline;
	text-decoration-color: var(--owen-orange);
	text-decoration-thickness: 3px;
	text-underline-offset: 0.2em;
}

.owen-checkout .wc-block-components-button.is-link,
.owen-checkout .wc-block-components-checkout-return-to-cart-button {
	color: var(--owen-blue);
	background: transparent;
	font-size: 1rem;
	text-transform: none;
}

.owen-checkout .wc-block-components-notice-banner {
	color: var(--owen-blue);
	background: var(--owen-butter);
	border: 0;
	border-radius: 0;
}

.owen-order .wc-block-order-confirmation-status {
	margin-bottom: 32px;
}

.owen-order .wc-block-order-confirmation-summary-list {
	padding: 22px 24px;
	background: var(--owen-butter);
	border-radius: 0;
}

/* ---------- Mobile ---------- */

@media (max-width: 900px) {
	.owen-event__layout {
		grid-template-columns: 1fr;
	}

	.owen-event__media {
		position: static;
	}
}

/* Event page: tidy add-to-cart form (seats are shown in the details box) */

.owen-event__buy .stock {
	display: none;
}

.owen-event__buy form.cart,
.owen-event__buy .quantity {
	margin: 0;
	padding: 0;
}

.owen-event__more .owen-course {
	min-height: auto;
}

.owen-order .wc-block-order-confirmation-summary {
	margin-bottom: 36px;
}

.owen-order h2,
.owen-order .wc-block-order-confirmation-totals__title,
.owen-order .wc-block-order-confirmation-billing-address__title {
	margin: 36px 0 16px;
	font-size: 1.8rem;
}

.owen-order .wc-bacs-bank-details-heading {
	margin-top: 40px;
	font-size: 1.8rem;
}

/* Empty cart: the character replaces the default sad-face icon */
.wc-block-cart__empty-cart__title.with-empty-cart-icon::before {
	width: 160px;
	height: 120px;
	margin: 0 auto 16px;
	content: "";
	background: url("../illustrations/cane-caffe.svg") center / contain no-repeat;
	-webkit-mask: none;
	mask: none;
}

/* Product cards of the empty cart: readable solid buttons */
.wp-block-woocommerce-empty-cart-block .wp-block-button__link,
.wp-block-woocommerce-empty-cart-block .wc-block-components-product-button__button {
	color: var(--wp--preset--color--flour);
	background: var(--wp--preset--color--blue);
	border-radius: 0;
}
