/**
 * WooCommerce checkout, cart, and order confirmation styles.
 * Matches the TMF design language used for the ticket flow in events.css.
 */

/* ------------------------------------------------------------------ */
/* Attendee registration modal: hide "Save and View Cart" so buyers    */
/* go straight to checkout (covers both ET and ET+ modal templates).   */
/* ------------------------------------------------------------------ */

.tribe-tickets__attendee-tickets-footer-cart-button,
.tribe-tickets__attendee-tickets-footer-divider,
.tribe-tickets__attendee__fields__footer_cart-button,
.tribe-block__tickets__item__attendee__fields__footer__divider {
	display: none !important;
}

/* ------------------------------------------------------------------ */
/* Checkout header (distraction-free, theme part checkout-header)      */
/* ------------------------------------------------------------------ */

.tmf-checkout-header {
	background: #fff;
	border-bottom: 1px solid var(--tmf-border, #DEE9EC);
}

.tmf-checkout-header-inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0.875rem 1.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tmf-checkout-header .tmf-logo {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	text-decoration: none;
}

.tmf-checkout-header .tmf-logo-img {
	width: 56px;
	height: 56px;
	object-fit: contain;
}

.tmf-checkout-header .tmf-logo-text {
	font-family: 'Funnel Sans', sans-serif;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: var(--tmf-primary, #16232A);
}

/* ------------------------------------------------------------------ */
/* Shared: checkout + cart + order confirmation containers             */
/* ------------------------------------------------------------------ */

.wp-block-woocommerce-checkout,
.wp-block-woocommerce-cart,
.woocommerce-order-confirmation-wrapper,
.wc-block-order-confirmation-status,
.wc-block-order-confirmation-summary,
.wc-block-order-confirmation-totals-wrapper,
.wc-block-order-confirmation-address-wrapper,
.wc-block-order-confirmation-additional-fields-wrapper,
.wc-block-order-confirmation-additional-information {
	font-family: 'Funnel Sans', sans-serif;
	color: var(--tmf-primary, #16232A);
}

.wp-block-woocommerce-checkout {
	padding: 2.5rem 1.5rem 4rem;
}

/* ------------------------------------------------------------------ */
/* Checkout steps as cards                                             */
/* ------------------------------------------------------------------ */

.wc-block-components-checkout-step {
	background: var(--tmf-light-bg, #F5F7F8);
	border: 1px solid var(--tmf-border, #DEE9EC);
	border-radius: var(--tmf-radius-xl, 0.75rem);
	padding: 1.5rem 1.75rem !important;
	margin-bottom: 1.25rem;
}

.wc-block-components-checkout-step__heading {
	margin: 0 0 0.5rem !important;
}

.wc-block-components-checkout-step .wc-block-components-title,
.wc-block-components-checkout-step__title {
	font-family: inherit !important;
	font-size: 1.0625rem !important;
	font-weight: 700 !important;
	color: var(--tmf-primary, #16232A) !important;
}

.wc-block-components-checkout-step__description {
	font-size: 0.8125rem;
	color: var(--tmf-text-secondary, #49555D);
	margin-bottom: 1rem;
}

/* Step content spacing */
.wc-block-components-checkout-step__content > * + * {
	margin-top: 0.75rem;
}

/* ------------------------------------------------------------------ */
/* Inputs and selects                                                  */
/* ------------------------------------------------------------------ */

.wc-block-components-text-input input[type='text'],
.wc-block-components-text-input input[type='email'],
.wc-block-components-text-input input[type='tel'],
.wc-block-components-text-input input[type='number'],
.wc-block-components-text-input input[type='url'],
.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input,
.wc-block-components-select .components-custom-select-control__button,
.wc-block-components-form .wc-block-components-select select,
.wc-block-components-textarea {
	background: #fff !important;
	border: 1px solid #D5DDE0 !important;
	border-radius: var(--tmf-radius-lg, 0.5rem) !important;
	color: var(--tmf-primary, #16232A) !important;
	font-family: inherit !important;
	box-shadow: none;
}

.wc-block-components-text-input input:focus,
.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus,
.wc-block-components-form .wc-block-components-select select:focus,
.wc-block-components-textarea:focus {
	border-color: var(--tmf-teal, #006F8B) !important;
	box-shadow: 0 0 0 2px rgba(0, 111, 139, 0.15) !important;
	outline: none;
}

.wc-block-components-text-input label,
.wc-block-components-combobox label,
.wc-block-components-select label {
	font-family: inherit !important;
	color: var(--tmf-text-secondary, #49555D) !important;
}

/* Validation errors */
.wc-block-components-validation-error p {
	font-family: inherit;
	color: #B3261E;
}

/* Checkboxes and radios */
.wc-block-components-checkbox .wc-block-components-checkbox__input[type='checkbox'] {
	border: 1px solid #D5DDE0;
	border-radius: 4px;
}

.wc-block-components-checkbox .wc-block-components-checkbox__input[type='checkbox']:checked {
	background: var(--tmf-teal, #006F8B);
	border-color: var(--tmf-teal, #006F8B);
}

/* ------------------------------------------------------------------ */
/* Payment methods                                                     */
/* ------------------------------------------------------------------ */

.wc-block-components-radio-control-accordion-option,
.wc-block-components-radio-control__option {
	font-family: inherit;
}

.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option {
	background: #fff;
	border-color: var(--tmf-border, #DEE9EC);
}

.wc-block-checkout__payment-method .wc-block-components-radio-control__input:checked {
	border-color: var(--tmf-teal, #006F8B);
	background: radial-gradient(circle, var(--tmf-teal, #006F8B) 40%, transparent 45%);
}

/* ------------------------------------------------------------------ */
/* Actions row: place order + return to cart                           */
/* ------------------------------------------------------------------ */

.wc-block-checkout__actions_row {
	align-items: center;
}

.wc-block-components-checkout-place-order-button {
	background: var(--tmf-accent, #FF5B04) !important;
	color: #fff !important;
	border: none !important;
	border-radius: var(--tmf-radius-lg, 0.5rem) !important;
	font-family: inherit !important;
	font-size: 1rem !important;
	font-weight: 600 !important;
	padding: 0.875rem 2rem !important;
	transition: background 0.2s;
}

.wc-block-components-checkout-place-order-button:hover,
.wc-block-components-checkout-place-order-button:focus {
	background: #E14F00 !important;
}

.wc-block-components-checkout-return-to-cart-button {
	color: var(--tmf-teal, #006F8B) !important;
	font-family: inherit !important;
	font-weight: 500;
}

.wc-block-components-checkout-return-to-cart-button:hover {
	text-decoration: underline;
}

/* ------------------------------------------------------------------ */
/* Order summary sidebar                                               */
/* ------------------------------------------------------------------ */

.wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block {
	background: var(--tmf-light-bg, #F5F7F8);
	border: 1px solid var(--tmf-border, #DEE9EC);
	border-radius: var(--tmf-radius-xl, 0.75rem);
	padding: 1.5rem 1.75rem;
}

.wc-block-checkout__sidebar .wc-block-components-checkout-order-summary__title,
.wc-block-checkout__sidebar .wc-block-components-title {
	font-family: inherit !important;
	font-size: 1.0625rem !important;
	font-weight: 700 !important;
	color: var(--tmf-primary, #16232A) !important;
}

.wc-block-components-order-summary-item__description,
.wc-block-components-order-summary-item__total-price,
.wc-block-components-totals-item {
	font-family: inherit !important;
	color: var(--tmf-primary, #16232A);
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
	font-weight: 700 !important;
}

/* Hide product placeholder image box in the summary if no image */
.wc-block-components-order-summary-item__image img[src=''] {
	display: none;
}

/* ------------------------------------------------------------------ */
/* Cart page                                                           */
/* ------------------------------------------------------------------ */

.wp-block-woocommerce-cart {
	padding: 0.5rem 0 3rem;
}

/* Hide the product image column: ticket products have no images */
.wc-block-cart-item__image,
.wc-block-cart-items__header-image {
	display: none !important;
}

/* Items table */
.wc-block-cart-items__header th {
	font-family: inherit;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	color: var(--tmf-text-secondary, #49555D);
	border-bottom: 2px solid var(--tmf-border, #DEE9EC);
	padding-bottom: 0.625rem;
}

.wc-block-cart-items td {
	border-bottom: 1px solid var(--tmf-border, #DEE9EC);
	padding: 1.25rem 0;
}

.wc-block-cart-item__product .wc-block-components-product-name {
	font-family: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--tmf-primary, #16232A);
	text-decoration: none;
}

.wc-block-cart-item__prices,
.wc-block-cart-item__total {
	font-family: inherit;
	color: var(--tmf-primary, #16232A);
}

/* Quantity selector */
.wc-block-components-quantity-selector {
	background: #fff;
	border: 1px solid #D5DDE0 !important;
	border-radius: var(--tmf-radius-lg, 0.5rem);
	overflow: hidden;
}

.wc-block-components-quantity-selector__button {
	color: var(--tmf-teal, #006F8B);
	font-weight: 600;
}

.wc-block-components-quantity-selector__input {
	font-family: inherit;
	font-weight: 600;
	color: var(--tmf-primary, #16232A);
}

/* Remove item */
.wc-block-cart-item__remove-link {
	color: var(--tmf-text-secondary, #49555D);
}

.wc-block-cart-item__remove-link:hover {
	color: #B3261E;
}

/* Totals sidebar as a card */
.wc-block-cart__sidebar .wp-block-woocommerce-cart-order-summary-block {
	background: var(--tmf-light-bg, #F5F7F8);
	border: 1px solid var(--tmf-border, #DEE9EC);
	border-radius: var(--tmf-radius-xl, 0.75rem);
	padding: 1.5rem 1.75rem;
}

.wc-block-cart__totals-title {
	font-family: inherit !important;
	font-size: 1.0625rem !important;
	font-weight: 700 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	color: var(--tmf-primary, #16232A) !important;
	border-bottom: 1px solid var(--tmf-border, #DEE9EC);
	padding-bottom: 0.75rem;
}

/* Proceed to checkout button, same treatment as Place Order */
.wc-block-cart__submit-button {
	background: var(--tmf-accent, #FF5B04) !important;
	color: #fff !important;
	border: none !important;
	border-radius: var(--tmf-radius-lg, 0.5rem) !important;
	font-family: inherit !important;
	font-size: 1rem !important;
	font-weight: 600 !important;
	transition: background 0.2s;
}

.wc-block-cart__submit-button:hover,
.wc-block-cart__submit-button:focus {
	background: #E14F00 !important;
}

/* ------------------------------------------------------------------ */
/* Order confirmation (thank-you page)                                 */
/* ------------------------------------------------------------------ */

/* Page container: breathing room between site header and dark footer */
.tmf-order-confirmation {
	padding: 3.5rem 1.5rem 5rem !important;
}

/* Success hero with checkmark badge */
.wc-block-order-confirmation-status {
	margin: 0 0 2.25rem;
}

.wc-block-order-confirmation-status h1 {
	font-family: inherit;
	font-size: 2.25rem !important;
	font-weight: 700;
	color: var(--tmf-primary, #16232A);
	margin: 0 0 0.5rem;
}

.wc-block-order-confirmation-status h1::before {
	content: '';
	display: block;
	width: 56px;
	height: 56px;
	margin-bottom: 1.25rem;
	border-radius: 50%;
	background-color: var(--tmf-accent, #FF5B04);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 28px;
}

.wc-block-order-confirmation-status p,
.wc-block-order-confirmation-status-description p {
	font-family: inherit;
	font-size: 1.0625rem;
	line-height: 1.6;
	color: var(--tmf-text-secondary, #49555D);
	max-width: 46rem;
}

.wc-block-order-confirmation-status a,
.wc-block-order-confirmation-status-description a {
	color: var(--tmf-teal, #006F8B);
	font-weight: 600;
}

/* Status action buttons (e.g. My account) */
.wc-block-order-confirmation-status__actions .button {
	background: var(--tmf-accent, #FF5B04);
	color: #fff;
	border: none;
	border-radius: var(--tmf-radius-lg, 0.5rem);
	font-family: inherit;
	font-weight: 600;
	padding: 0.75rem 1.5rem;
}

/* ------------------------------------------------------------------ */
/* Email verification gate (stale confirmation links)                  */
/* ------------------------------------------------------------------ */

.woocommerce-form.woocommerce-verify-email {
	background: var(--tmf-light-bg, #F5F7F8);
	border: 1px solid var(--tmf-border, #DEE9EC);
	border-radius: var(--tmf-radius-xl, 0.75rem);
	padding: 2rem;
	max-width: 34rem;
	margin: 2rem 0;
}

.woocommerce-verify-email .form-row {
	margin: 0 0 1.25rem;
	padding: 0;
	display: block;
}

.woocommerce-verify-email .form-row.login-submit {
	margin-bottom: 0;
}

.woocommerce-verify-email label {
	display: block;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--tmf-primary, #16232A);
	margin-bottom: 0.5rem;
}

.woocommerce-verify-email .input-text {
	width: 100%;
	background: #fff;
	border: 1px solid #D5DDE0;
	border-radius: var(--tmf-radius-lg, 0.5rem);
	padding: 0.875rem 1rem;
	font-family: inherit;
	font-size: 1rem;
	color: var(--tmf-primary, #16232A);
	box-sizing: border-box;
}

.woocommerce-verify-email .input-text:focus {
	border-color: var(--tmf-teal, #006F8B);
	box-shadow: 0 0 0 2px rgba(0, 111, 139, 0.15);
	outline: none;
}

.woocommerce-verify-email .button,
.woocommerce-verify-email .button.button-primary {
	width: 100%;
	background: var(--tmf-accent, #FF5B04);
	color: #fff;
	border: none;
	border-radius: var(--tmf-radius-lg, 0.5rem);
	padding: 0.875rem 1.5rem;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
}

.woocommerce-verify-email .button:hover,
.woocommerce-verify-email .button:focus {
	background: #E14F00;
}

/* Summary strip (order number, date, total, email, payment) */
.wc-block-order-confirmation-summary ul {
	background: var(--tmf-light-bg, #F5F7F8);
	border: 1px solid var(--tmf-border, #DEE9EC);
	border-radius: var(--tmf-radius-xl, 0.75rem);
	padding: 1.25rem 1.5rem;
	gap: 2rem;
}

.wc-block-order-confirmation-summary-list-item__key {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--tmf-text-secondary, #49555D);
}

.wc-block-order-confirmation-summary-list-item__value {
	font-weight: 600;
	color: var(--tmf-primary, #16232A);
}

/* Section headings (Upplýsingar um pöntun, addresses) */
.wc-block-order-confirmation-totals-wrapper h3,
.wc-block-order-confirmation-address-wrapper h3,
.wc-block-order-confirmation-downloads-wrapper h3,
.wc-block-order-confirmation-additional-fields-wrapper h3 {
	font-family: inherit;
	font-size: 1.0625rem;
	font-weight: 700;
	color: var(--tmf-primary, #16232A);
	margin: 2rem 0 0.75rem;
}

/* Order items table */
.wc-block-order-confirmation-totals table {
	border: 1px solid var(--tmf-border, #DEE9EC);
	border-radius: var(--tmf-radius-lg, 0.5rem);
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
}

.wc-block-order-confirmation-totals table th,
.wc-block-order-confirmation-totals table td {
	font-family: inherit;
	border-color: var(--tmf-border, #DEE9EC);
	padding: 0.875rem 1.25rem;
	vertical-align: top;
}

.wc-block-order-confirmation-totals table thead th {
	background: var(--tmf-light-bg, #F5F7F8);
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--tmf-primary, #16232A);
	border-bottom: 1px solid var(--tmf-border, #DEE9EC);
}

/* Attendee details nested table (from Event Tickets Plus) */
.wc-block-order-confirmation-totals table table {
	margin: 0.75rem 0 0.25rem;
	font-size: 0.8125rem;
	border-radius: var(--tmf-radius-lg, 0.5rem);
	background: #fff;
}

.wc-block-order-confirmation-totals table table th,
.wc-block-order-confirmation-totals table table td {
	padding: 0.5rem 0.875rem;
}

.wc-block-order-confirmation-totals table table thead th {
	font-size: 0.75rem;
}

/* Item meta list variant (wc core item meta markup) */
.wc-block-order-confirmation-totals .wc-item-meta {
	margin: 0.5rem 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.8125rem;
	color: var(--tmf-text-secondary, #49555D);
}

.wc-block-order-confirmation-totals .wc-item-meta li {
	margin: 0.125rem 0;
}

/* White background for the items table so it pops against the page */
.wc-block-order-confirmation-totals table {
	background: #fff;
}

/* Event details under ticket names (added by Event Tickets) */
.wc-block-order-confirmation-totals table td {
	font-size: 0.9375rem;
	line-height: 1.55;
}

/* Address blocks as cards */
.wc-block-order-confirmation-address-wrapper address {
	background: #fff;
	border: 1px solid var(--tmf-border, #DEE9EC);
	border-radius: var(--tmf-radius-lg, 0.5rem);
	padding: 1.25rem 1.5rem;
	font-style: normal;
	font-family: inherit;
	line-height: 1.6;
	color: var(--tmf-primary, #16232A);
}

/* Hide the empty shipping column for virtual ticket orders */
.wc-block-order-confirmation-shipping-wrapper:has(address:empty) {
	display: none;
}

/* Additional information / customer note */
.wc-block-order-confirmation-additional-information {
	margin-top: 2rem;
	font-family: inherit;
	color: var(--tmf-text-secondary, #49555D);
}

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

@media (max-width: 700px) {
	.wp-block-woocommerce-checkout {
		padding: 1.5rem 1rem 3rem;
	}

	.wc-block-components-checkout-step {
		padding: 1.25rem 1rem !important;
	}

	.wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block {
		padding: 1.25rem 1rem;
	}

	.tmf-order-confirmation {
		padding: 2rem 1rem 3.5rem !important;
	}

	.wc-block-order-confirmation-status h1 {
		font-size: 1.75rem !important;
	}

	.wc-block-order-confirmation-status h1::before {
		width: 48px;
		height: 48px;
		background-size: 24px;
	}

	.wc-block-order-confirmation-summary ul {
		padding: 1rem 1.25rem;
		gap: 1rem;
	}

	.woocommerce-form.woocommerce-verify-email {
		padding: 1.5rem 1.25rem;
	}

	.wc-block-order-confirmation-totals table th,
	.wc-block-order-confirmation-totals table td {
		padding: 0.625rem 0.75rem;
	}
}
