/* ==========================================================================
   CAP Mallorca — Servicios adicionales (YITH Booking)
   v7 — el checkbox va DENTRO del label

   Estructura real de YITH:
     .yith-wcbk-form-section-service
       └ label            → contiene el checkbox + el texto del servicio
       └ input[number]    → cantidad

   Por eso el label no puede ser display:block (deja el checkbox arriba del
   texto). Acá el label es la fila flexible que alinea checkbox y texto, y la
   cantidad se empuja al extremo derecho.
   ========================================================================== */

.yith-wcbk-form-section-services {
	--cap-ink: #1c1c1a;
	--cap-muted: #6f6f68;
	--cap-accent: #6e9a8c;
	--cap-accent-soft: #f4f8f7;
	--cap-surface: #ffffff;
	--cap-well: #f2f2ef;

	margin: 0 0 26px;
}

/* --------------------------------------------------------------------------
   Título
   -------------------------------------------------------------------------- */

.yith-wcbk-form-section-services > .yith-wcbk-form-section__label {
	display: block;
	margin: 0 0 12px;
	padding: 0;
	border: 0;
	font-size: 0.68rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	text-align: left;
	color: var(--cap-muted);
}

/* --------------------------------------------------------------------------
   Lista
   -------------------------------------------------------------------------- */

.yith-wcbk-form-section-services .yith-wcbk-form-section__content {
	display: flex;
	flex-direction: column;
	gap: 7px;
	margin: 0;
	padding: 0;
}

/* --------------------------------------------------------------------------
   Neutralizador + aplanado de wrappers
   -------------------------------------------------------------------------- */

.yith-wcbk-form-section-service *,
.yith-wcbk-form-section-service *::before,
.yith-wcbk-form-section-service *::after {
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
	outline: none;
	min-height: 0 !important;
	min-width: 0 !important;
	box-sizing: border-box;
}

/* Los wrappers intermedios dejan de existir como cajas */
.yith-wcbk-form-section-service div,
.yith-wcbk-form-section-service p {
	display: contents !important;
}

.yith-wcbk-form-section-service input:not([type="checkbox"]):not([type="number"]) {
	display: none !important;
}

/* --------------------------------------------------------------------------
   Fila
   -------------------------------------------------------------------------- */

.yith-wcbk-form-section-service {
	display: flex !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	gap: 14px;
	margin: 0;
	padding: 12px 18px;
	border: 0;
	border-radius: 10px;
	background: var(--cap-surface);
	box-shadow:
		0 1px 2px rgba(28, 28, 26, 0.05),
		0 2px 10px rgba(28, 28, 26, 0.035);
	cursor: pointer;
	transition:
		box-shadow 0.2s ease,
		background-color 0.2s ease;
}

.yith-wcbk-form-section-service:hover {
	box-shadow:
		0 2px 4px rgba(28, 28, 26, 0.07),
		0 5px 16px rgba(28, 28, 26, 0.06);
}

.yith-wcbk-form-section-service.cap-selected,
.yith-wcbk-form-section-service:has(input[type="checkbox"]:checked) {
	background: var(--cap-accent-soft);
	box-shadow:
		inset 0 0 0 1.5px var(--cap-accent),
		0 2px 6px rgba(110, 154, 140, 0.14);
}

/* --------------------------------------------------------------------------
   Label: fila que contiene el checkbox y el texto
   -------------------------------------------------------------------------- */

.yith-wcbk-form-section-service label {
	display: flex !important;
	flex: 1 1 auto !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	gap: 13px;
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
	font-size: 0.73rem;
	font-weight: 500;
	line-height: 1.35;
	letter-spacing: 0.045em;
	text-transform: uppercase;
	text-align: left !important;
	color: var(--cap-muted);
	cursor: pointer;
	transition: color 0.2s ease;
}

.yith-wcbk-form-section-service.cap-selected label,
.yith-wcbk-form-section-service:has(input[type="checkbox"]:checked) label {
	font-weight: 600;
	color: var(--cap-ink);
}

/* Si el texto está envuelto en un span, que no se estire ni se corte */
.yith-wcbk-form-section-service label span {
	display: inline !important;
	flex: 0 1 auto;
	min-width: 0;
}

/* --------------------------------------------------------------------------
   Checkbox
   -------------------------------------------------------------------------- */

.yith-wcbk-form-section-service input[type="checkbox"] {
	flex: 0 0 auto !important;
	align-self: center !important;
	width: 19px !important;
	height: 19px !important;
	min-width: 19px !important;
	max-width: 19px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 1.5px solid #cdcdc6 !important;
	border-radius: 5px;
	background: #fff !important;
	appearance: none;
	-webkit-appearance: none;
	display: inline-grid !important;
	place-content: center;
	vertical-align: middle;
	cursor: pointer;
	transition:
		background-color 0.18s ease,
		border-color 0.18s ease;
}

.yith-wcbk-form-section-service input[type="checkbox"]::after {
	content: "";
	width: 9px;
	height: 4.5px;
	margin-top: -2px;
	border-left: 2px solid #fff !important;
	border-bottom: 2px solid #fff !important;
	transform: rotate(-45deg) scale(0);
	transition: transform 0.18s cubic-bezier(0.2, 1.4, 0.5, 1);
}

.yith-wcbk-form-section-service input[type="checkbox"]:checked {
	border-color: var(--cap-accent) !important;
	background: var(--cap-accent) !important;
}

.yith-wcbk-form-section-service input[type="checkbox"]:checked::after {
	transform: rotate(-45deg) scale(1);
}

.yith-wcbk-form-section-service input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--cap-accent);
	outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Cantidad
   -------------------------------------------------------------------------- */

.yith-wcbk-form-section-service input[type="number"] {
	flex: 0 0 auto !important;
	align-self: center !important;
	order: 99;
	width: 46px !important;
	min-width: 46px !important;
	max-width: 46px !important;
	height: 31px !important;
	margin: 0 0 0 auto !important;
	padding: 0 2px !important;
	border: 0 !important;
	border-radius: 7px;
	background: var(--cap-well) !important;
	font-size: 0.78rem;
	font-weight: 600;
	text-align: center !important;
	color: var(--cap-ink);
	font-variant-numeric: tabular-nums;
	opacity: 0.3;
	pointer-events: none;
	transition: opacity 0.2s ease, background-color 0.2s ease;
}

.yith-wcbk-form-section-service.cap-selected input[type="number"],
.yith-wcbk-form-section-service:has(input[type="checkbox"]:checked) input[type="number"] {
	background: #ffffff !important;
	box-shadow: inset 0 0 0 1px rgba(110, 154, 140, 0.4) !important;
	opacity: 1;
	pointer-events: auto;
}

/* --------------------------------------------------------------------------
   Pantallas chicas
   -------------------------------------------------------------------------- */

@media (max-width: 420px) {
	.yith-wcbk-form-section-service {
		gap: 10px;
		padding: 11px 14px;
	}

	.yith-wcbk-form-section-service label {
		gap: 11px;
		font-size: 0.68rem;
		letter-spacing: 0.03em;
	}
}

@media (prefers-reduced-motion: reduce) {
	.yith-wcbk-form-section-service,
	.yith-wcbk-form-section-service * {
		transition: none !important;
	}
}
