/* Plugin hook-class presentation.
 *
 * The companion plugin emits `.offbeat-loop`, `.offbeat-empty-cart`, and
 * `.offbeat-seat-cta` as stable wrapper classes. All visual values pull from
 * Elementor Site Settings (`--e-global-color-*`) so a customer editing
 * Global Colors / Fonts in Site Settings affects plugin output too. theme.json
 * presets (`--wp--preset--color--*`) are downstream fallbacks for the rare
 * block-editor-only render path; literal hex is a final defensive default.
 */

.offbeat-loop {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	margin-block: 2rem;
}

.offbeat-loop > * + * {
	margin-top: 0;
}

.offbeat-empty-cart {
	max-width: 540px;
	margin-inline: auto;
	padding: clamp(1.5rem, 4vw, 2.5rem);
	border: 1px dashed var(--obt-border);
	border-radius: 8px;
	background: var(--obt-surface);
	text-align: center;
	color: var(--obt-text);
}

.offbeat-empty-cart h3 {
	margin-top: 0;
}

.offbeat-empty-cart .button,
.offbeat-seat-cta {
	display: inline-block;
	background: var(--obt-primary);
	color: var(--obt-contrast);
	border-radius: 6px;
	padding: 0.7rem 1.4rem;
	text-decoration: none;
	font-weight: 600;
	transition: filter 0.15s ease;
}

.offbeat-empty-cart .button:hover,
.offbeat-empty-cart .button:focus,
.offbeat-seat-cta:hover,
.offbeat-seat-cta:focus {
	filter: brightness(0.9);
	color: var(--obt-contrast);
}

/* Loop thumbnails from `[offbeat_loop_item_thumbnail]`. The shortcode emits
 * raw markup that Elementor cannot resize from the editor, so the wrapper /
 * img only get the rules needed to **respect** whatever size the surrounding
 * Elementor container sets (Min Height on the thumb container in the loop
 * item template, or the Size control on the parent column). */
.offbeat-loop-item-thumbnail {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.offbeat-loop-item-thumbnail__link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.offbeat-loop-item-thumbnail__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	object-position: center;
}

/* Default-image variant: fall back to natural sizing so the bundled PNG is
 * not stretched when the surrounding container is much larger than the art. */
.offbeat-loop-item-thumbnail__img--default {
	width: auto;
	height: auto;
}

/* Checkout: Tickera / bridge attendee blocks.
 *
 * Tickera prints these blocks server-side (Elementor cannot reach them),
 * so the theme owns their presentation. Rules are kept narrow on purpose:
 *
 *   - Container spacing + a divider rule from `var(--obt-border)`.
 *   - Input + label baseline styling that pulls every typographic value
 *     from the kit (`var(--obt-font)`, `var(--obt-text)`, kit border + accent).
 *   - Section headings (h2/h5) are NOT restyled — they inherit from the
 *     kit's per-heading typography (`Site Settings → Global Fonts → h2/h5`)
 *     so a customer changing those globals affects Tickera output too.
 *
 * `:not(:empty)` because Tickera renders an empty `.tickera_buyer_info` div
 * when there is no buyer-meta config — without the guard, the rule paints
 * an empty bordered slab between the WooCommerce billing block and the
 * attendee info. */
body.woocommerce-checkout .tickera_buyer_info:not(:empty),
body.woocommerce-checkout .tickera_owner_info {
	margin-top: 1.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--obt-border);
}

body.woocommerce-checkout .tickera_owner_info .tc-form-ticket-fields-wrap > h2,
body.woocommerce-checkout .tickera_owner_info .owner-info-wrap > h5 {
	margin: 1rem 0 0.5rem;
}

body.woocommerce-checkout .tickera_owner_info .fields-wrap {
	margin-bottom: 0.75rem;
}

body.woocommerce-checkout .tickera_owner_info .fields-wrap label {
	display: block;
	margin-bottom: 0.35rem;
}

body.woocommerce-checkout .tickera_owner_info .fields-wrap label .required {
	color: var(--obt-accent);
	text-decoration: none;
}

body.woocommerce-checkout .tickera_owner_info .tickera-input-field.tc-owner-field,
body.woocommerce-checkout .tickera_buyer_info .tickera-input-field {
	width: 100%;
	box-sizing: border-box;
	padding: 0.55rem 0.75rem;
	border: 1px solid var(--obt-border);
	border-radius: 4px;
	background: #fff;
	color: var(--obt-text);
	font-family: var(--obt-font);
	line-height: 1.4;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.woocommerce-checkout .tickera_owner_info .tickera-input-field.tc-owner-field:focus,
body.woocommerce-checkout .tickera_buyer_info .tickera-input-field:focus {
	border-color: var(--obt-primary);
	outline: none;
	box-shadow: 0 0 0 1px var(--obt-primary);
}

/* Quantity steppers — companion plugin emits `.offbeat-qty--enhanced` and
 * `.offbeat-qty__btn` wrappers around WooCommerce / Elementor Pro / Tickera
 * `<input type="number" class="qty">` fields. Presentation lives here so
 * Site Settings → Global Colors / Fonts cascade through. */
form.cart .quantity.offbeat-qty--enhanced {
	display: inline-flex;
	align-items: stretch;
	flex-wrap: nowrap;
	gap: 2px;
	vertical-align: middle;
}

form.cart .quantity.offbeat-qty--enhanced .offbeat-qty__btn {
	box-sizing: border-box;
	min-width: 2.25rem;
	padding: 0 0.35rem;
	margin: 0;
	border: 1px solid var(--obt-border);
	background: var(--obt-surface);
	color: var(--obt-text);
	font-family: var(--obt-font);
	font-size: 1.1rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	border-radius: 4px;
	transition: background 0.15s ease, color 0.15s ease;
}

form.cart .quantity.offbeat-qty--enhanced .offbeat-qty__btn:hover,
form.cart .quantity.offbeat-qty--enhanced .offbeat-qty__btn:focus-visible {
	background: var(--obt-primary);
	color: var(--obt-contrast);
	outline: none;
}

form.cart .quantity.offbeat-qty--enhanced input.qty {
	width: 3.25rem;
	min-height: 2.5rem;
	margin: 0;
	text-align: center;
	border-radius: 4px;
	border: 1px solid var(--obt-border);
	-moz-appearance: textfield;
}

form.cart .quantity.offbeat-qty--enhanced input.qty::-webkit-outer-spin-button,
form.cart .quantity.offbeat-qty--enhanced input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
