/**
 * Agend Apps Shop — Cart View widget styles.
 *
 * Shares the visual language of the Agend Elementor catalogue widgets
 * (events/courses/directory): navy headings, coral accent/CTA, rounded cards,
 * subtle borders and shadow. Colour and font tokens default below and are
 * overridden at runtime from the connected account's site config by
 * agend-apps-shop-cart-view.js (matching how the catalogue widgets inherit the
 * site theme), so the cart page tracks the same palette and typography.
 */

.agend-apps-shop-cart-view {
	--agend-shop-heading: #1e2a4a;
	--agend-shop-body: #26304d;
	--agend-shop-accent: #ff6b55;
	--agend-shop-button: #ff6b55;
	--agend-shop-button-text: #ffffff;
	--agend-shop-radius: 10px;
	--agend-shop-border: #eceef4;
	--agend-shop-border-strong: #d7dbe6;
	--agend-shop-muted: #f8f9fc;

	max-width: 900px;
	margin: 0 auto;
	color: var( --agend-shop-body );
	font-family: var( --agend-shop-font-body, inherit );
}

.agend-apps-shop-cart-view h2,
.agend-apps-shop-cart-view h3 {
	font-family: var( --agend-shop-font-heading, inherit );
	color: var( --agend-shop-heading );
}

/* -- States: loading / empty ---------------------------------------------- */

.agend-apps-shop-cart-view .agend-shop-cart-loading {
	padding: 2.5rem 1rem;
	text-align: center;
	opacity: 0.75;
}

.agend-apps-shop-cart-view .agend-shop-cart-empty {
	padding: 2.5rem 1.25rem;
	text-align: center;
	border: 1px dashed var( --agend-shop-border-strong );
	border-radius: var( --agend-shop-radius );
	background: var( --agend-shop-muted );
}

.agend-apps-shop-cart-view .agend-shop-cart-empty p {
	margin: 0;
	opacity: 0.8;
}

/* -- Locked notice -------------------------------------------------------- */

.agend-apps-shop-cart-view .agend-shop-cart-locked-notice {
	padding: 0.85rem 1rem;
	margin-bottom: 1rem;
	background: #fff8e6;
	border: 1px solid #ffe2a8;
	border-radius: var( --agend-shop-radius );
	color: #8a6d1a;
}

.agend-apps-shop-cart-view .agend-shop-cart-locked-notice p {
	margin: 0;
}

/* -- Cart table (card) ---------------------------------------------------- */

.agend-apps-shop-cart-view .agend-shop-cart-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid var( --agend-shop-border );
	border-radius: var( --agend-shop-radius );
	overflow: hidden;
	background: #fff;
	box-shadow: 0 1px 3px rgba( 30, 42, 74, 0.08 );
	margin-bottom: 1.5rem;
}

.agend-apps-shop-cart-view .agend-shop-cart-table th,
.agend-apps-shop-cart-view .agend-shop-cart-table td {
	padding: 0.85rem 1rem;
	text-align: left;
	vertical-align: middle;
	border-bottom: 1px solid var( --agend-shop-border );
}

.agend-apps-shop-cart-view .agend-shop-cart-table thead th {
	font-family: var( --agend-shop-font-heading, inherit );
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var( --agend-shop-heading );
	background: var( --agend-shop-muted );
}

.agend-apps-shop-cart-view .agend-shop-cart-items td:first-child {
	font-weight: 600;
	color: var( --agend-shop-heading );
}

/* -- Total row ------------------------------------------------------------ */

.agend-apps-shop-cart-view .agend-shop-cart-table tfoot td {
	border-bottom: none;
	background: var( --agend-shop-muted );
}

.agend-apps-shop-cart-view .agend-shop-cart-total-label {
	text-align: right;
	font-weight: 700;
	color: var( --agend-shop-heading );
}

.agend-apps-shop-cart-view .agend-shop-cart-total-amount {
	font-weight: 800;
	font-size: 1.1rem;
	color: var( --agend-shop-heading );
}

/* -- Quantity stepper ----------------------------------------------------- */

.agend-apps-shop-cart-view .agend-shop-atc-quantity {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.agend-apps-shop-cart-view .agend-shop-atc-qty-btn {
	width: 2rem;
	height: 2rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var( --agend-shop-border-strong );
	background: #fff;
	border-radius: 8px;
	font-size: 1.1rem;
	line-height: 1;
	color: var( --agend-shop-heading );
	cursor: pointer;
}

.agend-apps-shop-cart-view .agend-shop-atc-qty-btn:hover {
	border-color: var( --agend-shop-accent );
	color: var( --agend-shop-accent );
}

.agend-apps-shop-cart-view .agend-shop-qty-input {
	width: 3rem;
	text-align: center;
	padding: 0.4rem;
	border: 1px solid var( --agend-shop-border-strong );
	border-radius: 8px;
	color: var( --agend-shop-body );
	-moz-appearance: textfield;
}

.agend-apps-shop-cart-view .agend-shop-qty-input:focus {
	outline: 2px solid var( --agend-shop-accent );
	outline-offset: 1px;
}

.agend-apps-shop-cart-view .agend-shop-qty-input::-webkit-inner-spin-button,
.agend-apps-shop-cart-view .agend-shop-qty-input::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* -- Remove link ---------------------------------------------------------- */

.agend-apps-shop-cart-view .agend-shop-btn-remove-item {
	background: none;
	border: none;
	padding: 0.25rem 0.4rem;
	font-size: 0.85rem;
	font-weight: 600;
	color: var( --agend-shop-accent );
	cursor: pointer;
}

.agend-apps-shop-cart-view .agend-shop-btn-remove-item:hover {
	text-decoration: underline;
}

/* -- Actions row ---------------------------------------------------------- */

.agend-apps-shop-cart-view .agend-shop-cart-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.5rem;
	flex-wrap: wrap;
}

.agend-apps-shop-cart-view .agend-shop-cart-primary-actions {
	display: flex;
	gap: 0.5rem;
}

.agend-apps-shop-cart-view .agend-shop-btn-clear-cart {
	background: #fff;
	border: 1px solid var( --agend-shop-border-strong );
	color: var( --agend-shop-body );
	padding: 0.7rem 1.1rem;
	border-radius: 8px;
	font-weight: 600;
	cursor: pointer;
}

.agend-apps-shop-cart-view .agend-shop-btn-clear-cart:hover {
	border-color: var( --agend-shop-accent );
	color: var( --agend-shop-accent );
}

/* CTA — overrides the default Elementor button chrome. */
.agend-apps-shop-cart-view .agend-shop-btn-proceed-checkout,
.agend-apps-shop-cart-view .agend-shop-btn-proceed-checkout.elementor-button {
	background: var( --agend-shop-button );
	color: var( --agend-shop-button-text );
	border: none;
	border-radius: 8px;
	padding: 0.75rem 1.4rem;
	font-weight: 700;
	cursor: pointer;
}

.agend-apps-shop-cart-view .agend-shop-btn-proceed-checkout:hover {
	filter: brightness( 0.95 );
}

.agend-apps-shop-cart-view .agend-shop-btn-proceed-checkout:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* -- Message -------------------------------------------------------------- */

.agend-apps-shop-cart-view .agend-shop-cart-message {
	display: none;
	margin-top: 1rem;
	padding: 0.75rem 1rem;
	border-radius: 8px;
	font-size: 0.9rem;
}

.agend-apps-shop-cart-view .agend-shop-cart-message.is-success {
	display: block;
	color: #1c7a44;
	background: #e9f7ef;
	border: 1px solid #bfe6cf;
}

.agend-apps-shop-cart-view .agend-shop-cart-message.is-error {
	display: block;
	color: #a11a1a;
	background: #fdecec;
	border: 1px solid #f5c6cb;
}

/* -- Testing actions (visually distinct) ---------------------------------- */

.agend-apps-shop-cart-view .agend-shop-cart-test-actions {
	margin-top: 2rem;
	padding: 1rem 1.25rem;
	border: 1px dashed var( --agend-shop-border-strong );
	border-radius: var( --agend-shop-radius );
	background: var( --agend-shop-muted );
	color: var( --agend-shop-body );
	opacity: 0.85;
}

.agend-apps-shop-cart-view .agend-shop-cart-test-actions p {
	margin: 0 0 0.6rem;
}

.agend-apps-shop-cart-view .agend-shop-cart-test-actions button {
	margin-right: 0.5rem;
	background: #fff;
	border: 1px solid var( --agend-shop-border-strong );
	color: var( --agend-shop-body );
	padding: 0.5rem 0.9rem;
	border-radius: 8px;
	cursor: pointer;
}

/* -- Confirmation modal --------------------------------------------------- */

.agend-apps-shop-cart-view .agend-shop-confirm-modal {
	position: fixed;
	inset: 0;
	background: rgba( 30, 42, 74, 0.5 );
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
}

.agend-apps-shop-cart-view .agend-shop-confirm-modal[hidden] {
	display: none;
}

.agend-apps-shop-cart-view .agend-shop-confirm-modal-inner {
	background: #fff;
	padding: 1.75rem;
	border-radius: var( --agend-shop-radius );
	max-width: 420px;
	width: 90%;
	text-align: center;
	box-shadow: 0 12px 32px rgba( 30, 42, 74, 0.22 );
}

.agend-apps-shop-cart-view .agend-shop-confirm-modal-inner p {
	margin: 0 0 1.5rem;
	font-weight: 600;
	color: var( --agend-shop-heading );
}

.agend-apps-shop-cart-view .agend-shop-btn-confirm-yes {
	margin: 0 0.4rem;
	background: var( --agend-shop-button );
	color: var( --agend-shop-button-text );
	border: none;
	border-radius: 8px;
	padding: 0.6rem 1.2rem;
	font-weight: 700;
	cursor: pointer;
}

.agend-apps-shop-cart-view .agend-shop-btn-confirm-no {
	margin: 0 0.4rem;
	background: #fff;
	border: 1px solid var( --agend-shop-border-strong );
	color: var( --agend-shop-body );
	border-radius: 8px;
	padding: 0.6rem 1.2rem;
	font-weight: 600;
	cursor: pointer;
}

/* -- Row loading state ---------------------------------------------------- */

.agend-apps-shop-cart-view tr.agend-cart-row-loading {
	opacity: 0.55;
	animation: agend-shop-cart-pulse 1.8s ease-in-out infinite;
}

@keyframes agend-shop-cart-pulse {
	0%, 100% { background-color: transparent; }
	50% { background-color: var( --agend-shop-muted ); }
}

/* -- Responsive: stack the table into labelled rows on narrow screens ----- */

@media ( max-width: 640px ) {
	.agend-apps-shop-cart-view .agend-shop-cart-table,
	.agend-apps-shop-cart-view .agend-shop-cart-table tbody,
	.agend-apps-shop-cart-view .agend-shop-cart-table tfoot,
	.agend-apps-shop-cart-view .agend-shop-cart-table tr,
	.agend-apps-shop-cart-view .agend-shop-cart-table td {
		display: block;
	}

	.agend-apps-shop-cart-view .agend-shop-cart-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect( 0 0 0 0 );
		white-space: nowrap;
	}

	.agend-apps-shop-cart-view .agend-shop-cart-items tr {
		padding: 0.35rem 0;
		border-bottom: 1px solid var( --agend-shop-border );
	}

	.agend-apps-shop-cart-view .agend-shop-cart-table tbody td {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 1rem;
		border-bottom: none;
		padding: 0.4rem 1rem;
	}

	.agend-apps-shop-cart-view .agend-shop-cart-table tbody td::before {
		content: attr( data-label );
		font-size: 0.72rem;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.03em;
		color: var( --agend-shop-heading );
	}

	.agend-apps-shop-cart-view .agend-shop-cart-table tfoot tr {
		display: flex;
		justify-content: space-between;
		padding: 0.7rem 1rem;
		background: var( --agend-shop-muted );
	}

	.agend-apps-shop-cart-view .agend-shop-cart-table tfoot td {
		padding: 0;
	}

	.agend-apps-shop-cart-view .agend-shop-cart-table tfoot td:empty {
		display: none;
	}

	.agend-apps-shop-cart-view .agend-shop-cart-total-label {
		text-align: left;
	}

	.agend-apps-shop-cart-view .agend-shop-cart-actions {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	.agend-apps-shop-cart-view .agend-shop-cart-primary-actions,
	.agend-apps-shop-cart-view .agend-shop-btn-proceed-checkout {
		width: 100%;
	}
}

/* ---------------------------------------------------------------------------
 * Per-seat attendee editor (SPEC-CORE-20260721 US-5.3)
 * ------------------------------------------------------------------------- */

.agend-apps-shop-cart-view .agend-shop-btn-attendees {
	margin-right: 0.5rem;
	padding: 0.35rem 0.75rem;
	border: 1px solid var(--agend-shop-border-strong, #cbd5e1);
	border-radius: 0.375rem;
	background: transparent;
	color: var(--agend-shop-body, #1f2937);
	font-family: var(--agend-shop-font-body, inherit);
	font-size: 0.85rem;
	cursor: pointer;
}

.agend-apps-shop-cart-view .agend-shop-btn-attendees:hover {
	border-color: var(--agend-shop-accent, #2563eb);
	color: var(--agend-shop-accent, #2563eb);
}

.agend-apps-shop-cart-view .agend-shop-attendee-panel__body {
	padding: 1rem 1.25rem 1.25rem;
	background: rgba(0, 0, 0, 0.02);
	border-top: 1px solid var(--agend-shop-border, #e5e7eb);
}

.agend-apps-shop-cart-view .agend-shop-attendee-panel__intro {
	margin: 0 0 0.75rem;
	color: var(--agend-shop-muted, #6b7280);
	font-size: 0.85rem;
}

.agend-apps-shop-cart-view .agend-shop-attendee-seat {
	margin: 0 0 0.75rem;
	padding: 0.75rem 1rem 1rem;
	border: 1px solid var(--agend-shop-border, #e5e7eb);
	border-radius: 0.5rem;
	background: #fff;
}

.agend-apps-shop-cart-view .agend-shop-attendee-seat legend {
	padding: 0 0.4rem;
	color: var(--agend-shop-heading, #111827);
	font-family: var(--agend-shop-font-heading, inherit);
	font-size: 0.9rem;
	font-weight: 600;
}

.agend-apps-shop-cart-view .agend-shop-attendee-field {
	display: block;
	margin-top: 0.6rem;
}

.agend-apps-shop-cart-view .agend-shop-attendee-field__label {
	display: block;
	margin-bottom: 0.25rem;
	color: var(--agend-shop-body, #1f2937);
	font-size: 0.8rem;
	font-weight: 500;
}

.agend-apps-shop-cart-view .agend-shop-attendee-field input[type='text'],
.agend-apps-shop-cart-view .agend-shop-attendee-field input[type='email'],
.agend-apps-shop-cart-view .agend-shop-attendee-field input[type='number'],
.agend-apps-shop-cart-view .agend-shop-attendee-field input[type='date'],
.agend-apps-shop-cart-view .agend-shop-attendee-field select,
.agend-apps-shop-cart-view .agend-shop-attendee-field textarea {
	width: 100%;
	padding: 0.45rem 0.6rem;
	border: 1px solid var(--agend-shop-border-strong, #cbd5e1);
	border-radius: 0.375rem;
	font-family: var(--agend-shop-font-body, inherit);
	font-size: 0.9rem;
	box-sizing: border-box;
}

.agend-apps-shop-cart-view .agend-shop-attendee-panel__actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 0.5rem;
}

.agend-apps-shop-cart-view .agend-shop-btn-attendees-save {
	padding: 0.5rem 1.1rem;
	border: none;
	border-radius: 0.375rem;
	background: var(--agend-shop-button, #2563eb);
	color: var(--agend-shop-button-text, #fff);
	font-family: var(--agend-shop-font-body, inherit);
	font-size: 0.9rem;
	cursor: pointer;
}

.agend-apps-shop-cart-view .agend-shop-btn-attendees-save:disabled {
	opacity: 0.6;
	cursor: default;
}

.agend-apps-shop-cart-view .agend-shop-attendee-panel__status {
	font-size: 0.85rem;
	color: var(--agend-shop-muted, #6b7280);
}

.agend-apps-shop-cart-view .agend-shop-attendee-panel__status.is-error {
	color: #dc2626;
}

.agend-apps-shop-cart-view .agend-shop-attendee-panel__status.is-success {
	color: #16a34a;
}

.agend-apps-shop-cart-view .agend-shop-attendee-panel__removal-hint {
	margin: 0 0 0.75rem;
	padding: 0.5rem 0.75rem;
	border-radius: 0.375rem;
	background: rgba(220, 38, 38, 0.08);
	color: #b91c1c;
	font-size: 0.85rem;
}

.agend-apps-shop-cart-view .agend-shop-attendee-seat__header {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	flex-wrap: wrap;
}

.agend-apps-shop-cart-view .agend-shop-attendee-seat__header legend {
	float: none;
	width: auto;
	padding: 0;
	margin: 0;
}

.agend-apps-shop-cart-view .agend-shop-attendee-seat__badge {
	padding: 0.1rem 0.5rem;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.agend-apps-shop-cart-view .agend-shop-attendee-seat__badge.is-saved {
	background: rgba(22, 163, 74, 0.12);
	color: #15803d;
}

.agend-apps-shop-cart-view .agend-shop-attendee-seat__badge.is-unset {
	background: rgba(107, 114, 128, 0.14);
	color: #4b5563;
}

.agend-apps-shop-cart-view .agend-shop-btn-remove-seat {
	margin-left: auto;
	padding: 0.25rem 0.6rem;
	border: 1px solid rgba(220, 38, 38, 0.4);
	border-radius: 0.375rem;
	background: transparent;
	color: #dc2626;
	font-family: var(--agend-shop-font-body, inherit);
	font-size: 0.78rem;
	cursor: pointer;
}

.agend-apps-shop-cart-view .agend-shop-btn-remove-seat:hover {
	background: rgba(220, 38, 38, 0.08);
}

/* Shared cart attendee and recovery controls. */
.agend-apps-shop-cart-view .agend-shop-attendee-summary {
  margin-top: .35em;
  color: var(--agend-shop-body, #334155);
  font-size: .875em;
  font-weight: 400;
}
.agend-apps-shop-cart-view .agend-shop-keep-browsing,
.agend-apps-shop-cart-view .agend-shop-use-for-buyer {
  color: var(--agend-shop-heading, #0b2540);
  text-decoration: underline;
  text-underline-offset: .15em;
}
.agend-apps-shop-cart-view .agend-shop-use-for-buyer {
  display: inline-block;
  justify-self: start;
  min-block-size: 44px;
  border: 0;
  padding: .5em 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}
.agend-apps-shop-cart-view .agend-shop-attendee-field[hidden],
.agend-apps-shop-cart-view .agend-shop-attendee-panel[hidden] { display: none !important; }
.agend-apps-shop-cart-view .agend-shop-cart-actions { gap: 1rem; flex-wrap: wrap; }
.agend-apps-shop-cart-view :is(.agend-shop-keep-browsing, .agend-shop-use-for-buyer, .agend-shop-attendee-beneficiary):focus-visible {
  outline: 3px solid var(--agend-shop-heading, #0b2540);
  outline-offset: 2px;
}

/* -- Sign-in prompt, payment choice and invoice confirmation --------------- */

.agend-apps-shop-cart-view .agend-shop-cart-signin,
.agend-apps-shop-cart-view .agend-shop-cart-payment {
	margin: 0 0 1.5rem;
	padding: 1rem 1.25rem;
	border: 1px solid var( --agend-shop-border );
	border-radius: var( --agend-shop-radius );
	background: var( --agend-shop-muted );
}
.agend-apps-shop-cart-view .agend-shop-cart-payment[hidden],
.agend-apps-shop-cart-view .agend-shop-invoice-details[hidden],
.agend-apps-shop-cart-view .agend-shop-invoice-confirmation[hidden] { display: none !important; }
.agend-apps-shop-cart-view .agend-shop-cart-signin p { margin: 0 0 0.75rem; }
.agend-apps-shop-cart-view .agend-shop-cart-signin-link,
.agend-apps-shop-cart-view .agend-shop-cart-signin-link.elementor-button {
	display: inline-block;
	background: var( --agend-shop-button );
	color: var( --agend-shop-button-text );
	border-radius: 8px;
	padding: 0.75rem 1.4rem;
	font-weight: 700;
	text-decoration: none;
}
.agend-apps-shop-cart-view .agend-shop-payment-choice {
	margin: 0;
	padding: 0;
	border: 0;
}
.agend-apps-shop-cart-view .agend-shop-payment-choice legend {
	margin-bottom: 0.5rem;
	font-weight: 700;
	color: var( --agend-shop-heading );
}
.agend-apps-shop-cart-view .agend-shop-payment-choice label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-block-size: 44px;
	cursor: pointer;
}
.agend-apps-shop-cart-view .agend-shop-invoice-details { margin-top: 0.75rem; }
.agend-apps-shop-cart-view .agend-shop-invoice-field {
	display: grid;
	gap: 0.35rem;
	margin-bottom: 0.75rem;
	font-weight: 600;
}
.agend-apps-shop-cart-view .agend-shop-invoice-field :is(input, select) {
	max-width: 24rem;
	padding: 0.55rem 0.7rem;
	border: 1px solid var( --agend-shop-border-strong );
	border-radius: 8px;
	font: inherit;
	font-weight: 400;
}
.agend-apps-shop-cart-view .agend-shop-invoice-instructions { white-space: pre-line; }
.agend-apps-shop-cart-view .agend-shop-invoice-confirmation {
	padding: 1.25rem 1.5rem;
	border: 1px solid var( --agend-shop-border );
	border-radius: var( --agend-shop-radius );
}
.agend-apps-shop-cart-view .agend-shop-invoice-summary {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.35rem 1.25rem;
	margin: 1rem 0;
}
.agend-apps-shop-cart-view .agend-shop-invoice-summary dt { font-weight: 600; }
.agend-apps-shop-cart-view .agend-shop-invoice-summary dd { margin: 0; }
.agend-apps-shop-cart-view .agend-shop-invoice-confirmation__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}
.agend-apps-shop-cart-view .agend-shop-invoice-link {
	color: var( --agend-shop-heading );
	font-weight: 600;
}
