/**
 * Inline mini-cart sidebar laid out inside the theme's "Comprar tiquetes"
 * card, to the right of the variations form (zone selector + add-to-cart
 * button). The wrap is opened/closed server-side via the
 * `woocommerce_before_add_to_cart_form` / `woocommerce_after_add_to_cart_form`
 * actions, so the theme's section title and surrounding markup remain
 * untouched.
 */

.venue-maps-add-to-cart-wrap {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
	gap: 24px;
	align-items: start;
}
.venue-maps-add-to-cart-wrap__form,
.venue-maps-add-to-cart-wrap__sidebar {
	min-width: 0;
}

/* Hide only the qty stepper + the bare "Añadir al carrito" button — the
 * customer drives the purchase from the FooEvents Seating chart instead.
 * Crucially, we DO NOT hide `.woocommerce-variation-add-to-cart` itself
 * because `#fooevents_seating_dialog` is its sibling and the chart needs
 * to stay visible. */
.venue-maps-add-to-cart-wrap__form .woocommerce-variation-add-to-cart .quantity,
.venue-maps-add-to-cart-wrap__form .woocommerce-variation-add-to-cart button.single_add_to_cart_button {
	display: none !important;
}

/* The FooEvents "Choose seats" trigger is machine-driven on venue products:
 * the map JS clicks it programmatically after each zone pick (a hidden link
 * still receives .click()), and a manual customer click races that retry
 * loop and can leave an empty dialog (ticketera-theme#198). The JS also
 * hides it per zone change; this rule covers the initial render, before any
 * zone is picked (e.g. a variation preselected via URL). */
.venue-maps-add-to-cart-wrap__form a.fooevents_seating_chart {
	display: none !important;
}

/* General-admission (non-numbered) zone: there is no seating chart, so the
 * customer buys by quantity. When the map JS marks the form as a general zone,
 * bring back the native quantity stepper + add-to-cart button (the "Zona"
 * table stays hidden — the map is still the zone selector). */
.venue-maps-add-to-cart-wrap__form.is-general-zone .woocommerce-variation-add-to-cart .quantity {
	display: inline-flex !important;
}
.venue-maps-add-to-cart-wrap__form.is-general-zone .woocommerce-variation-add-to-cart button.single_add_to_cart_button {
	display: inline-block !important;
}

/* Hide the theme's "Comprar tiquetes" card heading on venue product pages.
 * Scoped to the add-to-cart card and only shipped on venue products (this
 * stylesheet is enqueued solely there), so other events keep their title. */
.event-add-to-cart__card > .section-title {
	display: none !important;
}

/* Hide the "Zona" variation dropdown: the SVG map is the zone selector, so
 * the native <select> is redundant. We only hide it visually (display:none) —
 * the element stays in the DOM so a zone click on the map still sets its value
 * and fires WooCommerce's `change`, which loads the variation + opens the chart. */
.venue-maps-add-to-cart-wrap__form table.variations {
	display: none !important;
}

/* Sidebar card — minimalist look matching the reference design. */
.venue-maps-floating-cart {
	padding: 24px 22px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	font-family: inherit;
	color: #0f172a;
}

.venue-maps-floating-cart__title {
	margin: 0 0 14px;
	font-size: 1.4rem;
	font-weight: 500;
	color: #0f172a;
	line-height: 1.2;
}

.venue-maps-floating-cart__divider {
	border: 0;
	border-top: 1px solid #e2e8f0;
	margin: 0 0 16px;
}

.venue-maps-floating-cart__empty {
	margin: 0 0 20px;
	color: #94a3b8;
	font-size: 0.9rem;
	font-style: italic;
	text-align: center;
	line-height: 1.5;
}

.venue-maps-floating-cart__items {
	margin: 0 0 8px;
	padding: 0;
	list-style: none;
}
.venue-maps-floating-cart__item {
	display: grid;
	grid-template-columns: 1fr auto auto;
	align-items: baseline;
	gap: 10px;
	padding: 10px 0;
	border-bottom: 1px solid #f1f5f9;
	font-size: 0.92rem;
}
.venue-maps-floating-cart__item:last-child {
	border-bottom: 0;
}
.venue-maps-floating-cart__item-name {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.venue-maps-floating-cart__item-qty {
	margin-left: 6px;
	color: #94a3b8;
	font-size: 0.82rem;
}
.venue-maps-floating-cart__item-seat {
	color: #64748b;
	font-size: 0.8rem;
	font-weight: 600;
}
.venue-maps-floating-cart__item-subtotal {
	font-weight: 600;
	white-space: nowrap;
}
.venue-maps-floating-cart__remove {
	color: #cbd5e1;
	text-decoration: none;
	font-size: 1.05rem;
	line-height: 1;
	padding: 0 4px;
	/* Reset for the <button> variant (per-seat remove) so it matches the <a>. */
	background: none;
	border: 0;
	cursor: pointer;
	font-family: inherit;
}
.venue-maps-floating-cart__remove:hover {
	color: #b91c1c;
}
.venue-maps-floating-cart__remove[aria-busy="true"] {
	opacity: 0.5;
	pointer-events: none;
}

.venue-maps-floating-cart__total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}
.venue-maps-floating-cart__total-label {
	font-size: 1.05rem;
	color: #0f172a;
	font-weight: 600;
}
.venue-maps-floating-cart__total-amount {
	font-size: 1.3rem;
	font-weight: 700;
	color: #0d9488;
}
.venue-maps-floating-cart__total-amount .woocommerce-Price-amount {
	color: inherit;
}

/* "Finalizar compra" CTA — only rendered when the cart has items. Matches
 * the teal accent used for the total so the summary reads as one unit. */
.venue-maps-floating-cart__checkout {
	display: block;
	margin-top: 18px;
	padding: 12px 16px;
	background: #0d9488;
	color: #fff;
	text-align: center;
	text-decoration: none;
	font-size: 1rem;
	font-weight: 600;
	border-radius: 8px;
	transition: background-color 0.15s ease-in-out;
}
.venue-maps-floating-cart__checkout:hover,
.venue-maps-floating-cart__checkout:focus {
	background: #0f766e;
	color: #fff;
}

/* While venue-map.js rebuilds the seating chart (close→reopen loop until
 * FooEvents finishes rendering seats), keep the jQuery-UI dialog hidden so the
 * customer never sees it flash open as a body-centered modal and snap into the
 * card on each cycle. `visibility` (not `display`) so the relocate + `isDone()`
 * offsetParent checks still work; revealed by removing the body class once the
 * seats have rendered (or when the loop gives up). */
body.venue-maps-seating-loading .ui-dialog {
	visibility: hidden !important;
}

/* While the chart rebuilds behind the veil above, show a placeholder in the
 * spot the relocated dialog will occupy (first child of the form column, see
 * floating-cart.js relocate()). Sized close to a rendered chart so the layout
 * doesn't jump again when the seats replace it (ticketera-theme#197). Hidden
 * whenever the veil is down — including general zones, which never load a
 * chart. */
.venue-maps-seating-loading-indicator {
	display: none;
}
body.venue-maps-seating-loading .venue-maps-seating-loading-indicator {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	min-height: 360px;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	color: #555;
	font-size: 15px;
}
.venue-maps-seating-loading-indicator__spinner {
	width: 34px;
	height: 34px;
	border: 3px solid #ddd;
	border-top-color: #555;
	border-radius: 50%;
	animation: venue-maps-seating-spin 0.8s linear infinite;
}
@keyframes venue-maps-seating-spin {
	to {
		transform: rotate(360deg);
	}
}
@media (prefers-reduced-motion: reduce) {
	.venue-maps-seating-loading-indicator__spinner {
		animation: none;
	}
}

/* Inline FooEvents Seating chart: the floating-cart.js relocator moves
 * the jQuery-UI dialog into `.event-add-to-cart__card`. We strip the
 * modal chrome so it reads as a card section below the form + sidebar. */
.event-add-to-cart__card .ui-dialog.venue-maps-inline-seating {
	position: static !important;
	top: auto !important;
	left: auto !important;
	width: 100% !important;
	max-width: 100%;
	margin: 0 0 20px;
	padding: 0;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	box-shadow: none;
	z-index: auto;
}
.event-add-to-cart__card .ui-dialog.venue-maps-inline-seating .ui-dialog-titlebar {
	background: transparent;
	border: 0;
	border-bottom: 1px solid #e2e8f0;
	border-radius: 10px 10px 0 0;
	padding: 14px 18px;
}
.event-add-to-cart__card .ui-dialog.venue-maps-inline-seating .ui-dialog-title {
	font-size: 1.05rem;
	font-weight: 600;
	color: #0f172a;
}
.event-add-to-cart__card .ui-dialog.venue-maps-inline-seating .ui-dialog-titlebar-close {
	background: transparent;
	border: 0;
}
.event-add-to-cart__card .ui-dialog.venue-maps-inline-seating .ui-dialog-content {
	max-height: none;
	padding: 18px;
	overflow: visible;
}
/* Drop the global jQuery UI overlay — there's no longer a modal to back. */
.ui-widget-overlay {
	display: none !important;
}

/* Lay each seating row as "area name on the left, its seats inline to the
 * right" instead of the FooEvents default (name stacked on its own line above
 * the seats). More compact and reads as one unit. Scoped to the inline chart
 * so FooEvents' own modal (used elsewhere) is untouched. */
.venue-maps-inline-seating .row_container {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	/* No transparent gap between the label and the seats: the spacing is the
	 * label's own (white) padding-right, so a seat scrolling under the sticky
	 * label can never peek through a gap. */
	column-gap: 0;
	/* Extend to the full row width so the per-zone `.seat_container` is what
	 * scrolls (one scrollbar for every fila of the zone), not each row. */
	width: max-content;
}
.venue-maps-inline-seating .row_container .fooevents_seating_chart_view_row_name {
	flex: 0 0 auto;
	/* Equal label column so the seats line up by column across the zone's
	 * filas (uniform fila names share the same width). Sticky to the left so
	 * the fila name stays pinned while the seats scroll underneath it. */
	min-width: 120px;
	margin: 0;
	white-space: nowrap;
	position: sticky;
	left: 0;
	z-index: 3;
	/* Solid, fully opaque panel: it must stretch to the FULL row height (the
	 * seats are taller than the text) and include the right-hand spacing, so a
	 * seat scrolling underneath is completely masked — never visible above,
	 * below or beside the label. */
	align-self: stretch;
	display: flex;
	align-items: center;
	padding-right: 16px;
	background: #fff;
}
.venue-maps-inline-seating .row_container .fooevents_seating_chart_view_row {
	flex: 0 0 auto;
}

/* Tablet/mobile: stack the columns so the cart sits below the selector. */
@media (max-width: 900px) {
	.venue-maps-add-to-cart-wrap {
		grid-template-columns: 1fr;
	}
}
