/**
 * Meals Card Display Component Styles
 *
 * Chronological timeline layout for today's meals.
 *
 * @package MphbGuestServices
 * @since 2.0.0
 */

.mphb-gs-meal-card {
	border: 1px solid var(--gs-color-border, #e5e7eb);
	border-radius: 14px;
	background: var(--gs-color-surface, #fff);
	box-shadow: var(--gs-shadow-md, 0 12px 30px rgba(15, 23, 42, 0.08));
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.mphb-gs-meal-card__hero {
	background-size: cover;
	background-position: center;
	height: 100px;
}

.mphb-gs-meal-card__body {
	padding: 0;
}

/* ── Timeline table ── */
.mphb-gs-meal-timeline {
	display: flex;
	flex-direction: column;
}

.mphb-gs-meal-timeline__row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--gs-color-border-light, #f3f4f6);
	transition: background 0.15s ease;
}

/* Secondary line under a timeline row (cancel window, hint, etc.).
   `flex-basis: 100%` force le retour à la ligne dans le flex parent
   pour éviter que le label "Annulable jusqu'au …" ne se retrouve
   tassé entre le prix et le bouton ✕. */
.mphb-gs-meal-timeline__row > .gs-cancel-window {
	flex: 1 0 100%;
	margin-left: 36px;
	font-size: 11px;
	color: var(--gs-color-text-soft);
	font-style: italic;
}

/* Cancel ✕ as a uniform icon button — remplace la duplication
   (× + bouton "Annuler" + window) qui produisait l'affichage
   tassé sur 3 lignes. */
.gs-cancel-btn--icon {
	width: 28px;
	height: 28px;
	padding: 0;
	border-radius: 50%;
	font-size: 18px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--gs-color-text-soft);
	background: transparent;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.gs-cancel-btn--icon:hover {
	background: rgba(239, 68, 68, .12);
	color: #ef4444;
	border-color: rgba(239, 68, 68, .25);
}

.mphb-gs-meal-timeline__row:last-child {
	border-bottom: none;
}

.mphb-gs-meal-timeline__row:hover {
	background: var(--gs-color-surface-alt);
}

/* Column: Time */
.mphb-gs-meal-timeline__col-time {
	flex: 0 0 76px;
	font-size: 13px;
	font-weight: 600;
	color: var(--gs-color-text, #0f172a);
	font-variant-numeric: tabular-nums;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

/* Inline date label (used on the "À venir" timeline so the guest sees
   when each item is scheduled). Wraps above the time, slightly muted
   so the time stays the dominant token. */
.mphb-gs-meal-timeline__date {
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--gs-color-text-soft, #6b7280);
	text-transform: capitalize;
}

/* "À choisir" inline CTA — affichée à la place de la description quand
   un slot DP/PC est souscrit mais les plats pas encore choisis. Style
   discret (italique + couleur soft) pour ne pas crier, mais cliquable
   pour ouvrir directement le panneau Régime de pension. */
.mphb-gs-meal-timeline__meal-cta {
	font-style: italic;
	color: var(--gs-color-text-soft, #6b7280);
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}
.mphb-gs-meal-timeline__meal-cta:hover,
.mphb-gs-meal-timeline__meal-cta:focus,
.mphb-gs-meal-timeline__meal-cta:focus-visible {
	color: var(--gs-color-text, #0f172a);
	text-decoration: underline;
	outline: none;
}

/* Column: Date (only on past-meals timeline) — filled on the first row of
   each day, blank on subsequent rows. A top divider on the day-start row
   replaces the standalone date-header row that used to waste a line. */
.mphb-gs-meal-timeline__col-date {
	flex: 0 0 48px;
	font-size: 12px;
	font-weight: 700;
	color: var(--gs-color-text, #0f172a);
	font-variant-numeric: tabular-nums;
}
.mphb-gs-meal-timeline--with-date .mphb-gs-meal-timeline__row--day-start {
	border-top: 1px solid var(--gs-color-border, #e5e7eb);
}
.mphb-gs-meal-timeline--with-date .mphb-gs-meal-timeline__row--day-start:first-child {
	border-top: none;
}

/* Column: Meal (inline label + desc) */
.mphb-gs-meal-timeline__col-meal {
	flex: 1;
	width: 0;
	min-width: 0;
	overflow: hidden;
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0;
}

.mphb-gs-meal-timeline__meal-label {
	flex: 0 0 auto;
	font-size: 13px;
	font-weight: 600;
	color: var(--gs-color-text, #0f172a);
	line-height: 1.4;
	white-space: nowrap;
}

.mphb-gs-meal-timeline__meal-sep {
	margin: 0 5px;
	color: var(--gs-color-text-soft);
	flex-shrink: 0;
}

.mphb-gs-meal-timeline__meal-desc {
	font-size: 12px;
	color: var(--gs-color-text-soft);
	line-height: 1.4;
}

/* Column: Price */
.mphb-gs-meal-timeline__col-price {
	flex: 0 0 72px;
	text-align: right;
	font-size: 12px;
	font-weight: 600;
	color: var(--gs-color-text, #0f172a);
	white-space: nowrap;
}

/* Column: Action (cancel/lock/status icons) */
.mphb-gs-meal-timeline__col-action {
	flex: 0 0 32px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Column: Item thumbnail */
.mphb-gs-meal-timeline__col-thumb {
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	border-radius: 6px;
	overflow: hidden;
	background: var(--gs-color-surface-hover);
	align-self: center;
}

.mphb-gs-meal-timeline__col-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Column: Icon (SVG icons replacing time column) */
.mphb-gs-meal-timeline__col-icon {
	flex: 0 0 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--gs-color-primary, #d4a574);
}

.mphb-gs-meal-timeline__col-icon svg {
	width: 18px;
	height: 18px;
}

.mphb-gs-meal-timeline__col-icon.gs-icon-delivery {
	color: var(--gs-color-info);
}

.mphb-gs-meal-timeline__col-icon.gs-icon-return {
	color: var(--gs-color-warning-text);
}

/* ── Responsive ── */
@media (max-width: 768px) {
	.mphb-gs-meal-timeline__col-time {
		flex: 0 0 48px;
		font-size: 12px;
	}

	.mphb-gs-meal-timeline__col-price {
		flex: 0 0 64px;
		font-size: 11px;
	}

	.mphb-gs-meal-timeline__meal-label {
		font-size: 12px;
	}

	.mphb-gs-meal-timeline__meal-desc {
		font-size: 11px;
	}
}

@media (max-width: 480px) {
	.mphb-gs-meal-timeline__col-meal {
		flex: 1 1 0;
		min-width: 120px;
	}

	.mphb-gs-meal-timeline__meal-label {
		flex: 1 1 0;
		min-width: 120px;
		max-width: 100%;
		white-space: normal;
	}

	.mphb-gs-meal-timeline__col-price {
		flex: 0 0 auto;
	}
}
