/* Toggle Switch — reusable component for skip delivery, notification prefs, etc. */

.dtec-toggle {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
}

/* Optional title label above the toggle */
.dtec-toggle__label {
	font-size: 16px;
	font-weight: 600;
	color: var(--dark-gray, #2E2826);
}

/* Clickable button wrapper */
.dtec-toggle__switch {
	display: flex;
	align-items: center;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	-webkit-tap-highlight-color: transparent;
}

/* Track — pill-shaped background with text inside */
.dtec-toggle__track {
	position: relative;
	display: flex;
	align-items: center;
	width: 83px;
	height: 42px;
	border-radius: 500px;
	background: rgba(46, 40, 38, 0.25);
	padding: 4px;
	transition: background 200ms ease;
}

/* Thumb — the sliding circle */
.dtec-toggle__thumb {
	position: absolute;
	display: block;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--white, #FFF);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
	transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
	transform: translateX(0);
	z-index: 1;
}

/* Text INSIDE the track */
.dtec-toggle__text {
	position: absolute;
	right: 14px;
	font-size: 16px;
	font-weight: 600;
	color: var(--white, #FFF);
	text-align: center;
	line-height: normal;
	transition: opacity 200ms ease, left 200ms ease, right 200ms ease;
	user-select: none;
	z-index: 0;
}

/* --- Active state --- */

.dtec-toggle--active .dtec-toggle__track {
	background: var(--aubergine-gleam-500, #8F385D);
}

.dtec-toggle--active .dtec-toggle__thumb {
	transform: translateX(41px);
}

.dtec-toggle--active .dtec-toggle__text {
	right: auto;
	left: 14px;
	color: var(--white, #FFF);
}

/* --- Disabled state --- */

.dtec-toggle--disabled .dtec-toggle__switch {
	cursor: not-allowed;
	opacity: 0.5;
}

/* --- Small variant --- */

.dtec-toggle--sm .dtec-toggle__label {
	font-size: 14px;
}

.dtec-toggle--sm .dtec-toggle__track {
	width: 56px;
	height: 28px;
	padding: 3px;
}

.dtec-toggle--sm .dtec-toggle__thumb {
	width: 22px;
	height: 22px;
}

.dtec-toggle--sm.dtec-toggle--active .dtec-toggle__thumb {
	transform: translateX(28px);
}

.dtec-toggle--sm .dtec-toggle__text {
	font-size: 12px;
	right: 10px;
}

.dtec-toggle--sm.dtec-toggle--active .dtec-toggle__text {
	right: auto;
	left: 10px;
}

/* --- Focus ring for keyboard accessibility --- */

.dtec-toggle__switch:focus-visible .dtec-toggle__track {
	outline: 2px solid var(--aubergine-gleam-500, #8F385D);
	outline-offset: 2px;
}
