/**
 * Existing transfers reminder.
 *
 * Compact summary list shown at the top of the "Order your airport transfer"
 * panel when the guest already has one or more transfers booked. Rendered
 * inside a gs-banner--info / --compact wrapper, so this stylesheet only adds
 * the inner list layout (heading + one row per transfer).
 *
 * Tokens used here are the neutral --gs-* design tokens (NOT --lw-* — those
 * get remapped in light mode by the EVD standalone theme).
 */

/* Keeps the banner clear of the page heading above and the first section heading below. */
.gs-upcoming-orders {
	margin-block: var(--gs-space-xl, 20px);
}

.gs-existing-transfers {
	color: var(--gs-color-text, #0f172a);
	font-size: 14px;
	line-height: 1.45;
}

.gs-existing-transfers__heading {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--gs-color-text-soft, #475569);
	margin: 0;
	/* Measured heading → first row gap (CLAUDE.md: ≥ 16 px between adjacent blocks). */
	margin-block-end: var(--gs-space-lg, 16px);
}

/* One grid for the whole list:
   [qty auto] [main 1fr] [when auto] [price auto] [status auto] [action 28px].
   Rows subgrid onto it so the quantity, date, price, badge and ✖ columns line up
   across ALL rows, whatever the text width in each language. The quantity
   column is reserved even on rows without one, so titles share the same x. */
.gs-existing-transfers__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	/* [date] [qty] [title 1fr] [price] [status] [action]: the date column has a floor
	   wide enough for "22/10 09:00" so rows line up even without subgrid. */
	grid-template-columns: minmax(11ch, auto) auto minmax(0, 1fr) auto auto 28px;
}

.gs-existing-transfers__item {
	display: grid;
	grid-column: 1 / -1;
	grid-template-columns: subgrid;
	column-gap: var(--gs-space-md, 12px);
	align-items: center;
	/* Same padding above and below every row; one separator between rows, none above the first. */
	padding-block: var(--gs-space-sm, 8px);
	border-top: 1px solid var(--gs-color-border-light, #e5e7eb);
}

.gs-existing-transfers__item:first-child {
	border-top: 0;
}

/* Browsers without subgrid: each row repeats the list template, so the columns
   still align as long as the badge widths are close (they are: short status words). */
@supports not (grid-template-columns: subgrid) {
	.gs-existing-transfers__item {
		grid-template-columns: minmax(11ch, auto) auto minmax(0, 1fr) auto auto 28px;
	}
}

/* Every cell is pinned to its column so an optional cell (no price, no badge)
   never shifts the ones after it. */
.gs-existing-transfers__main {
	grid-column: 3;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: var(--gs-space-xs, 4px) var(--gs-space-sm, 8px);
	min-width: 0;
}

.gs-existing-transfers__dir {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
	color: var(--gs-color-text, #0f172a);
}

.gs-existing-transfers__icon {
	flex-shrink: 0;
	opacity: 0.75;
}

/* Quantity pill, second column, right-aligned against the title. Regular UI font
   (the monospace is reserved to flight codes). */
.gs-existing-transfers__qty {
	grid-column: 2;
	justify-self: end;
	display: inline-flex;
	align-items: center;
	padding: 1px var(--gs-space-sm, 8px);
	border-radius: var(--gs-radius-full, 9999px);
	background: var(--gs-color-surface-alt, #f9fafb);
	border: 1px solid var(--gs-color-border, #e5e7eb);
	font-size: 12px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	line-height: 1.4;
	color: var(--gs-color-text, #0f172a);
}

/* Placeholder keeping the column on rows with a single unit: no pill chrome. */
.gs-existing-transfers__qty--empty {
	padding: 0;
	border: 0;
	background: none;
}

.gs-existing-transfers__flight {
	font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--gs-color-text, #0f172a);
}

/* Date column, first: left-aligned at the same x on every row, digits of equal width. */
.gs-existing-transfers__when {
	grid-column: 1;
	justify-self: start;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	color: var(--gs-color-text-soft, #475569);
}

.gs-existing-transfers__price {
	grid-column: 4;
	justify-self: end;
	text-align: end;
	white-space: nowrap;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--gs-color-text, #0f172a);
}

.gs-existing-transfers__status {
	grid-column: 5;
	justify-self: start;
}

/* Action cell: always present (empty placeholder when the row cannot be cancelled). */
.gs-existing-transfers__action {
	grid-column: 6;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
}

/* The portal's generic `button:not(...)` reset (min-height 44 px, 12/16 px padding,
   surface background, 8 px radius) outranks .gs-cancel-btn--icon and stretched the ✖
   into a tall pill. Neutralised here, inside the banner only, with the same scoped
   !important pattern the portal already uses for its icon-only buttons. */
.mphb-gs-shell .gs-existing-transfers__action .gs-cancel-btn--icon {
	width: 28px !important;
	height: 28px !important;
	min-height: 0 !important;
	padding: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	border: 1px solid transparent !important;
	box-shadow: none !important;
	color: var(--gs-color-text-soft, #475569) !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	line-height: 1;
}

.mphb-gs-shell .gs-existing-transfers__action .gs-cancel-btn--icon:hover,
.mphb-gs-shell .gs-existing-transfers__action .gs-cancel-btn--icon:focus-visible {
	background: rgba(239, 68, 68, 0.12) !important;
	border-color: rgba(239, 68, 68, 0.25) !important;
	color: #ef4444 !important;
	transform: none !important;
}

/* Dark theme — lift contrast on navy surfaces. Literal hex per the standalone
   theme rules (--lw-* gets remapped in light mode). */
[data-pp-theme="dark"] .mphb-gs-shell .gs-existing-transfers {
	color: #f4ecdc;
}

[data-pp-theme="dark"] .mphb-gs-shell .gs-existing-transfers__heading {
	color: rgba(244, 236, 220, 0.78);
}

[data-pp-theme="dark"] .mphb-gs-shell .gs-existing-transfers__dir,
[data-pp-theme="dark"] .mphb-gs-shell .gs-existing-transfers__flight,
[data-pp-theme="dark"] .mphb-gs-shell .gs-existing-transfers__price {
	color: #f4ecdc;
}

[data-pp-theme="dark"] .mphb-gs-shell .gs-existing-transfers__when {
	color: rgba(244, 236, 220, 0.72);
}

[data-pp-theme="dark"] .mphb-gs-shell .gs-existing-transfers__action .gs-cancel-btn--icon {
	color: rgba(244, 236, 220, 0.72) !important;
}

[data-pp-theme="dark"] .mphb-gs-shell .gs-existing-transfers__action .gs-cancel-btn--icon:hover,
[data-pp-theme="dark"] .mphb-gs-shell .gs-existing-transfers__action .gs-cancel-btn--icon:focus-visible {
	color: #f87171 !important;
}

[data-pp-theme="dark"] .mphb-gs-shell .gs-existing-transfers__qty {
	color: #f4ecdc;
	background: rgba(244, 236, 220, 0.08);
	border-color: rgba(196, 165, 118, 0.35);
}

[data-pp-theme="dark"] .mphb-gs-shell .gs-existing-transfers__item:not(:first-child) {
	border-top-color: rgba(196, 165, 118, 0.22);
}

/* Mobile — same order, two lines: [date] [qty] [main] [action 28px], then
   [price] [status] under the title. The date keeps the first column. */
@media (max-width: 480px) {
	.gs-existing-transfers__list,
	.gs-existing-transfers__item {
		grid-template-columns: auto auto minmax(0, 1fr) auto;
	}

	.gs-existing-transfers__item {
		row-gap: var(--gs-space-xs, 4px);
		column-gap: var(--gs-space-sm, 8px);
	}

	.gs-existing-transfers__when {
		grid-column: 1;
		grid-row: 1;
	}

	.gs-existing-transfers__qty {
		grid-column: 2;
		grid-row: 1;
	}

	.gs-existing-transfers__main {
		grid-column: 3;
		grid-row: 1;
	}

	.gs-existing-transfers__action {
		grid-column: 4;
		grid-row: 1;
		align-self: start;
		justify-self: end;
	}

	.gs-existing-transfers__price {
		grid-column: 3;
		grid-row: 2;
		justify-self: start;
	}

	.gs-existing-transfers__status {
		grid-column: 4;
		grid-row: 2;
		justify-self: end;
	}
}

/* Cancel-window fallback hint — rendered by portal-transfer-card.php beneath
   any active transfer row whose online cancel window has closed. Discreet
   single line: warning glyph + soft text + tel/WhatsApp CTAs. Uses --gs-color-*
   tokens (no hardcoded colors). */
.mphb-gs-transfer-cancel-fallback {
	display: grid;
	grid-template-columns: 20px 1fr;
	align-items: center;
	gap: 10px;
	padding: 8px 0 10px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--gs-color-text-soft, #475569);
}

.mphb-gs-transfer-cancel-fallback__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--gs-color-warning, #b45309);
	flex-shrink: 0;
}

.mphb-gs-transfer-cancel-fallback__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.mphb-gs-transfer-cancel-fallback__text {
	line-height: 1.4;
}

.mphb-gs-transfer-cancel-fallback__ctas {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	line-height: 1.4;
}

.mphb-gs-transfer-cancel-fallback__cta {
	color: var(--gs-color-primary, #1e40af);
	text-decoration: underline;
	text-underline-offset: 2px;
	font-weight: 600;
	white-space: nowrap;
}

.mphb-gs-transfer-cancel-fallback__cta:hover,
.mphb-gs-transfer-cancel-fallback__cta:focus-visible {
	color: var(--gs-color-primary-hover, #1e3a8a);
	text-decoration: none;
}

/* Dark theme — same lift as the sibling reminder block. */
[data-pp-theme="dark"] .mphb-gs-shell .mphb-gs-transfer-cancel-fallback {
	color: rgba(244, 236, 220, 0.78);
}

[data-pp-theme="dark"] .mphb-gs-shell .mphb-gs-transfer-cancel-fallback__cta {
	color: #f4ecdc;
}

@media (max-width: 480px) {
	.mphb-gs-transfer-cancel-fallback {
		padding-inline-start: 0;
	}
}
