/**
 * Wallex Download Segment – Styling.
 * Compatible with Light and Dark modes using Wallex Token Style.
 */

.wallex-download-segment {
	display: block;
	width: 100%;
	direction: rtl;
	box-sizing: border-box;
}

.wallex-download-segment *,
.wallex-download-segment *::before,
.wallex-download-segment *::after {
	box-sizing: inherit;
}

.wallex-ds__container {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--spacingMNudge, 20px);
	width: 100%;
	max-width: 489px;
	margin: 0 auto;
}

/* ----------------------------- Segment Control ---------------------------- */
.wallex-ds__tabs-wrapper {
	display: flex;
	justify-content: center;
	width: 100%;
}

.wallex-ds__tabs {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background-color: var(--color-negativeGlassBg, rgba(0, 0, 0, 0.02));
	border: 1px solid var(--color-stroke-2, rgba(0, 0, 0, 0.05));
	border-radius: var(--cornerRadiusCircular, 1000px);
	padding: var(--spacingXXS, 4px);
	gap: var(--spacingNone, 0px);
	width: auto;
	min-width: 232px;
	max-width: 100%;
}

.wallex-ds__tab {
	flex: 1 0 0;
	min-width: 90px;
	height: 32px;
	border: none;
	background: transparent;
	cursor: pointer;
	outline: none;
	transition: all 0.2s ease-in-out;
	border-radius: var(--cornerRadiusCircular, 1000px);
	padding: 0 var(--spacingS, 12px);
	font-size: var(--body-size, 14px);
	font-weight: var(--body-medium-weight, 500);
	line-height: var(--body-line-height, 24px);
	color: var(--color-text-2, rgba(0, 0, 0, 0.6));
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	white-space: nowrap;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.wallex-ds__tab-state-layer {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
}

.wallex-ds__tab.is-active {
	background-color: var(--color-primaryBrandBg, #007aff);
	color: var(--color-onColorLightText, #ffffff);
	box-shadow: 0 2px 6px var(--color-glass-primary-20, rgba(0, 122, 255, 0.15));
}

.wallex-ds__tab:focus-visible {
	outline: 2px solid var(--color-primaryBrandBg, #007aff);
	outline-offset: 2px;
}

/* ----------------------------- Panels & Buttons --------------------------- */
.wallex-ds__panels {
	width: 100%;
}

.wallex-ds__panel {
	display: none;
	width: 100%;
}

.wallex-ds__panel.is-active {
	display: block;
}

.wallex-ds__buttons-row {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-evenly;
	gap: var(--spacingXS, 8px);
	width: 100%;
	flex-direction: row;
	min-width: 33%;
}

.wallex-ds__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--spacingXS, 8px);
	height: 40px;
	min-height: 40px;
	border: 1px solid var(--color-stroke-2, rgba(0, 0, 0, 0.05));
	border-radius: var(--cornerRadiusCircular, 1000px);
	padding: 0 var(--spacingS, 12px);
	background-color: var(--color-bg, #ffffff);
	color: var(--color-text-1, #252525);
	font-size: var(--body-size, 14px);
	font-weight: var(--body-medium-weight, 500);
	line-height: var(--body-line-height, 24px);
	text-decoration: none;
	transition: all 0.2s ease-in-out;
	white-space: nowrap;
	max-width: 100%;
}

.wallex-ds__btn:hover {
	border-color: var(--color-stroke-3, rgba(0, 0, 0, 0.15));
	background-color: var(--color-Hover, #f9f9f9);
	color: var(--color-text-1, #000000);
}

.wallex-ds__btn-label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.wallex-ds__btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	flex-shrink: 0;
	line-height: 1;
}

.wallex-ds__btn-icon img,
.wallex-ds__btn-icon svg {
	width: 24px;
	height: 24px;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
}

.wallex-ds__btn-icon i {
	font-size: 20px;
	line-height: 1;
}

/* -------------------- Responsive Mobile / Desktop Text ------------------- */
.wallex-ds__text--desktop {
	display: inline !important;
}

.wallex-ds__text--mobile {
	display: none !important;
}

@media (max-width: 767px) {
	.wallex-ds__text--desktop {
		display: none !important;
	}

	.wallex-ds__text--mobile {
		display: inline !important;
	}

	.wallex-ds__buttons-row {
		gap: 8px;
	}

	.wallex-ds__btn {
		padding: 0 var(--spacingS, 10px);
		font-size: 13px;
	}
}

/* ------------------------- Sticky Option for Mobile ------------------------ */
@media (max-width: 767px) {
	.wallex-download-segment--sticky {
		border-radius: var(--cornerRadiusXL, 16px) var(--cornerRadiusXL, 16px) var(--cornerRadiusNone, 0) var(--cornerRadiusNone, 0);
		position: fixed !important;
		bottom: 0 !important;
		left: 0 !important;
		right: 0 !important;
		width: 100% !important;
		z-index: 99990 !important;
		background: var(--color-bg, rgba(255, 255, 255, 0.96)) !important;
		backdrop-filter: blur(12px) !important;
		-webkit-backdrop-filter: blur(12px) !important;
		box-shadow: 0 -4px 20px var(--color-glass-black-10, rgba(0, 0, 0, 0.1)) !important;
		padding: var(--spacingS, 12px) var(--spacingM, 16px) !important;
		margin: 0 !important;
		border-top: 1px solid var(--color-stroke-2, rgba(0, 0, 0, 0.08)) !important;
	}

	.wallex-download-segment--sticky .wallex-ds__container {
		width: 100%;
		max-width: 500px;
		margin: 0 auto;
		gap: 16px;
	}
}

/* ------------------------- Sticky Option for Tablet ------------------------ */
@media (min-width: 768px) and (max-width: 1024px) {
	.wallex-download-segment--sticky-tablet {
		border-radius: var(--cornerRadiusXL, 16px) var(--cornerRadiusXL, 16px) var(--cornerRadiusNone, 0) var(--cornerRadiusNone, 0);
		position: fixed !important;
		bottom: 0 !important;
		left: 0 !important;
		right: 0 !important;
		width: 100% !important;
		z-index: 99990 !important;
		background: var(--color-bg, rgba(255, 255, 255, 0.96)) !important;
		backdrop-filter: blur(12px) !important;
		-webkit-backdrop-filter: blur(12px) !important;
		box-shadow: 0 -4px 20px var(--color-glass-black-10, rgba(0, 0, 0, 0.1)) !important;
		padding: 12px 12px 24px 12px !important;
		margin: 0 !important;
		border-top: 1px solid var(--color-stroke-2, rgba(0, 0, 0, 0.08)) !important;
	}

	.wallex-download-segment--sticky-tablet .wallex-ds__container {
		width: 100%;
		max-width: 500px;
		margin: 0 auto;
		gap: 16px;
	}
}