/**
 * List Collapse Component Styles
 *
 * Hide overflow items in dashboard card lists and provide
 * a "Show all" link that opens a modal with the full list.
 *
 * @package MphbGuestServices
 * @since 2.0.0
 */

/* Hide items beyond the collapse threshold */
[data-gs-collapse] > .gs-collapse-hidden {
	display: none !important;
}

/*
 * Initial collapse: hide items beyond default threshold (3) before JS runs.
 * This prevents the flash of all items appearing then collapsing.
 * JS will take over and manage visibility after initialization.
 */
[data-gs-collapse] > .gs-billing-line:not(.gs-billing-line--header):nth-child(n+5),
[data-gs-collapse] > .mphb-gs-meal-timeline__row:nth-child(n+4) {
	display: none !important;
}

/* Once JS has initialized, it adds the gs-collapse-hidden class and removes this rule's effect */
[data-gs-collapse].gs-collapse-initialized > .gs-billing-line:not(.gs-billing-line--header):nth-child(n+5),
[data-gs-collapse].gs-collapse-initialized > .mphb-gs-meal-timeline__row:nth-child(n+4) {
	display: revert;
}

/* "Show all" link appended after the last visible item */
.gs-collapse-trigger {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 16px;
	font-size: 13px;
	font-weight: 600;
	color: var(--gs-color-primary, #c49a3a);
	cursor: pointer;
	border-top: 1px solid var(--gs-color-border-light, #f3f4f6);
	background: transparent;
	transition: background 0.15s ease, color 0.15s ease;
	text-decoration: none;
	width: 100%;
	box-sizing: border-box;
}

.gs-collapse-trigger:hover {
	background: var(--gs-color-surface-hover, #faf8f4);
	color: var(--gs-color-primary-hover, #b8860b);
}

.gs-collapse-trigger svg {
	width: 16px;
	height: 16px;
}

/* List-collapse modal: wider for timeline rows */
#gs-list-collapse-modal .gs-modal {
	width: 560px !important;
}

/* Remove body padding so timeline rows go edge-to-edge */
#gs-list-collapse-modal .gs-modal__body {
	padding: 0 !important;
}

/* Lists inside modal: no inner scroll, let modal body handle it */
#gs-list-collapse-modal .mphb-gs-meal-timeline {
	overflow: visible;
}
