/* LatePoint Recipe Extras — front-end booking flow */

/* ============================================================
 *  Group section
 * ============================================================ */

.os-service-extras .lp-extra-group {
	--lp-group-color: #957FEF;
	margin: 0 0 14px 0;
}

/* ----- Header (clickable card) ----- */

.os-service-extras .lp-extra-group-header {
	display: flex;
	align-items: center;
	gap: 0;
	width: 100%;
	padding: 8px;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 15px;
	text-align: left;
	font: inherit;
	color: inherit;
	-webkit-appearance: none;
	outline: none;
	transition: background .15s, border-color .15s, box-shadow .15s;
}
.os-service-extras .lp-extra-group-header:hover {
	background: rgba(0, 0, 0, 0.015);
	border-color: rgba(0, 0, 0, 0.14);
}
.os-service-extras .lp-extra-group-header:focus-visible {
	border-color: var(--lp-group-color);
	box-shadow: 0 0 0 3px rgba(149, 127, 239, 0.18);
}

/* Icon — image when set, hidden otherwise. v1.3.7: matches the user's
 * exact spec — 45×45 icon, 15px right margin, image radius 8px,
 * group name at 17px. */
.os-service-extras .lp-extra-group-icon {
	width: 45px;
	height: 45px;
	flex: 0 0 45px;
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.05);
	color: var(--lp-group-color);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	overflow: hidden;
	margin-right: 15px;
}

.os-service-extras .lp-extra-group-icon.has-image {
	background: transparent;
	padding: 0;
}

.os-service-extras .lp-extra-group-icon.is-empty {
	display: none;
}

.os-service-extras .lp-extra-group-icon img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 8px;
}

.os-service-extras .lp-extra-group-name {
	font-weight: 600;
	font-size: 18px;
	color: #1f2937;
	flex: 1;
	letter-spacing: 0;
	line-height: 1.3;
}

.os-service-extras .lp-extra-group-count {
	font-size: 13px;
	color: #6b7280;
	margin-right: 6px;
	white-space: nowrap;
}

.os-service-extras .lp-extra-group-chevron {
	width: 16px;
	height: 16px;
	position: relative;
	flex: 0 0 16px;
	transition: transform .2s ease;
	opacity: .55;
	color: #6b7280;
}
.os-service-extras .lp-extra-group-chevron::before {
	content: '';
	position: absolute;
	top: 3px;
	left: 4px;
	width: 7px;
	height: 7px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
}
.os-service-extras .lp-extra-group.is-open .lp-extra-group-chevron {
	transform: rotate(180deg);
}

/* ----- Items wrapper (collapse/expand container) -----
 * Single continuous tree line drawn on the wrapper. JS sets
 * --lp-tree-bottom-offset so the line ends exactly at the last
 * item's vertical center. No segment seams, no color shifts.
 */

.os-service-extras .lp-extra-group-items {
	position: relative;
	max-height: 0;
	opacity: 0;
	overflow: hidden;
	padding: 0 0 0 40px;
	/* v1.3.11 — smoother feel. Close = quick + tight, open = soft
	 * eased entry with delayed fade-in so items don't pop in.
	 * cubic-bezier here is "ease-out-expo" — long tail, snappy start. */
	transition:
		max-height .28s cubic-bezier(0.16, 1, 0.3, 1),
		padding .22s cubic-bezier(0.16, 1, 0.3, 1),
		opacity .18s ease-out;
}
.os-service-extras .lp-extra-group.is-open .lp-extra-group-items {
	max-height: 4000px;
	opacity: 1;
	padding: 18px 0 8px 40px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	transition:
		max-height .42s cubic-bezier(0.16, 1, 0.3, 1),
		padding .32s cubic-bezier(0.16, 1, 0.3, 1),
		opacity .28s ease-in .08s;
}

/* Continuous vertical trunk. JS sets --lp-tree-bottom-offset so the
 * trunk ends at the last item's center; otherwise default 50% stops
 * halfway and leaves no dangling line below the last branch. */
.os-service-extras .lp-extra-group-items::before {
	content: '';
	position: absolute;
	left: 24px;
	top: 0;
	bottom: var(--lp-tree-bottom-offset, 50%);
	border-left: 2px solid rgba(0, 0, 0, 0.06);
	pointer-events: none;
}

/* ----- Plate boxes ----- */

.os-service-extras .os-item,
.os-service-extras .os-item.selected,
.os-service-extras .os-item:hover,
.os-service-extras .os-item.has-quantity {
	border-radius: 16px !important;
}

/* Inner qty-selector area shouldn't carry its own border/shadow that
 * conflicts with the plate's rounded edge. NB: we can't use
 * overflow:hidden on .os-item to clip this — it would also clip the
 * ::before pseudo for the rounded tree connector. So we neutralize the
 * inner element's chrome directly. */
.os-service-extras .os-item .item-quantity-selector-w {
	background: transparent !important;
	box-shadow: none !important;
	border: none !important;
}

.os-service-extras .lp-extra-group-items .os-item {
	position: relative;
	margin: 0 !important;
}

/* Names wrap naturally to a second line when long — no truncation. */
.os-service-extras .lp-extra-group-items .os-item .os-item-name {
	white-space: normal;
	word-break: break-word;
	overflow-wrap: anywhere;
	line-height: 1.3;
}
.os-service-extras .lp-extra-group-items .os-item .os-item-name-w {
	min-width: 0;
	flex: 1 1 auto;
}

/* Rounded-L branch per item.
 *
 * The L's left border is TRANSPARENT — only the bottom border and the
 * rounded corner are visible. This avoids the L's vertical edge sitting
 * on top of the trunk and doubling the alpha into a darker line at the
 * intersection. The trunk continues uninterrupted, and the L's curve
 * appears to "branch off" from it. */
.os-service-extras .lp-extra-group-items .os-item::before {
	content: '';
	position: absolute;
	left: -16px;
	top: calc(50% - 14px);
	width: 14px;
	height: 14px;
	border-left: 2px solid transparent;
	border-bottom: 2px solid rgba(0, 0, 0, 0.06);
	border-bottom-left-radius: 12px;
	pointer-events: none;
}

/* ============================================================
 *  Dark-theme adjustments
 * ============================================================ */

.latepoint-bg-dark .os-service-extras .lp-extra-group-header,
.latepoint-style-dark .os-service-extras .lp-extra-group-header {
	background: rgba(255, 255, 255, 0.04);
	border-color: rgba(255, 255, 255, 0.10);
}
.latepoint-bg-dark .os-service-extras .lp-extra-group-name,
.latepoint-style-dark .os-service-extras .lp-extra-group-name {
	color: #f3f4f6;
}
.latepoint-bg-dark .os-service-extras .lp-extra-group-count,
.latepoint-style-dark .os-service-extras .lp-extra-group-count {
	color: rgba(255, 255, 255, 0.55);
}
.latepoint-bg-dark .os-service-extras .lp-extra-group-icon,
.latepoint-style-dark .os-service-extras .lp-extra-group-icon {
	background: rgba(255, 255, 255, 0.08);
}
.latepoint-bg-dark .os-service-extras .lp-extra-group-items::before,
.latepoint-bg-dark .os-service-extras .lp-extra-group-items .os-item::before,
.latepoint-style-dark .os-service-extras .lp-extra-group-items::before,
.latepoint-style-dark .os-service-extras .lp-extra-group-items .os-item::before {
	border-color: rgba(255, 255, 255, 0.08);
}


/* ===================================================================
 * v1.3.27 — Group header count: total + separator + selected.
 *
 * The count area in each group header now shows two pieces of info:
 *   "12 platos | (3 seleccionados)"
 *      ↑          ↑
 *      total      live selected count, updates on every +/- click
 *
 * Styled to echo LP's own main-service header (e.g. "MENÚ DEL CHEF #1
 * | 300000PYG") with a thin vertical divider between the two parts.
 * Total is the prominent value; selected is the lighter accent.
 * ===================================================================*/

.os-service-extras .lp-extra-group-count {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-left: auto;
	margin-right: 12px;
	white-space: nowrap;
}

.os-service-extras .lp-extra-group-count-total {
	color: rgba(0, 0, 0, 0.85);
	font-weight: 600;
	font-size: 14px;
}

.os-service-extras .lp-extra-group-count-sep {
	display: inline-block;
	width: 1px;
	height: 14px;
	background: rgba(0, 0, 0, 0.18);
	flex: 0 0 1px;
}

.os-service-extras .lp-extra-group-count-selected {
	color: rgba(0, 0, 0, 0.5);
	font-weight: 400;
	font-size: 13px;
	transition: color .15s ease;
}

/* When nothing's selected, dim it further so it reads as a hint
 * rather than a value. */
.os-service-extras .lp-extra-group-count-selected[data-zero="1"] {
	color: rgba(0, 0, 0, 0.35);
}

/* Dark themes — invert the contrasts. */
.latepoint-bg-dark .os-service-extras .lp-extra-group-count-total,
.latepoint-style-dark .os-service-extras .lp-extra-group-count-total {
	color: rgba(255, 255, 255, 0.92);
}
.latepoint-bg-dark .os-service-extras .lp-extra-group-count-sep,
.latepoint-style-dark .os-service-extras .lp-extra-group-count-sep {
	background: rgba(255, 255, 255, 0.22);
}
.latepoint-bg-dark .os-service-extras .lp-extra-group-count-selected,
.latepoint-style-dark .os-service-extras .lp-extra-group-count-selected {
	color: rgba(255, 255, 255, 0.6);
}
.latepoint-bg-dark .os-service-extras .lp-extra-group-count-selected[data-zero="1"],
.latepoint-style-dark .os-service-extras .lp-extra-group-count-selected[data-zero="1"] {
	color: rgba(255, 255, 255, 0.4);
}
