.gift4u-palette {
	--gift4u-gap: clamp(18px, 2vw, 32px);
	display: grid;
	direction: ltr;
	grid-template-columns: 424px minmax(0, 896px);
	grid-template-areas: "controls preview";
	gap: var(--gift4u-gap);
	align-items: center;
	width: 100%;
	max-width: 1352px;
	margin-inline: auto;
}

.gift4u-palette__controls {
	grid-area: controls;
	display: flex;
	flex-direction: column;
	align-self: center;
	justify-self: start;
	gap: 10px;
	width: 424px;
	max-width: 100%;
}

.gift4u-palette .gift4u-palette__size {
	margin: 0 0 6px;
	color: #fff;
	font-family: Arial, Helvetica, sans-serif;
	font-size: clamp(32px, 4vw, 48px);
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	direction: rtl;
	unicode-bidi: isolate;
	overflow-wrap: anywhere;
}

.gift4u-palette__models {
	display: grid;
	direction: rtl;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px 10px;
	width: 100%;
}

.gift4u-palette .gift4u-palette__model {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 32px;
	margin: 0;
	padding: 5px 10px;
	border: 2px solid transparent;
	border-radius: 11px;
	background: #ff641a;
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
	text-transform: none;
	overflow-wrap: anywhere;
	box-shadow: none;
	cursor: pointer;
	transition: background .2s ease;
}

.gift4u-palette .gift4u-palette__model:hover {
	background: #d94a08;
}

.gift4u-palette .gift4u-palette__model.is-selected {
	border-color: #fff;
	background: #d94a08;
}

.gift4u-palette .gift4u-palette__model:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.gift4u-palette[data-model-loading] .gift4u-palette__swatch {
	cursor: wait;
}

.gift4u-palette__specs {
	display: grid;
	direction: rtl;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	width: 100%;
	padding: 12px;
	background: #000;
	border: 1px solid #000;
	border-radius: 10px;
	box-sizing: border-box;
}

.gift4u-palette__spec {
	display: flex;
	align-items: center;
	min-width: 0;
	gap: 9px;
	padding-inline: 4px;
}

.gift4u-palette__spec-icon {
	display: grid;
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	place-items: center;
	color: #fff;
	background: rgba(255, 255, 255, .12);
	border-radius: 50%;
}

.gift4u-palette__spec-icon svg {
	display: block;
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.gift4u-palette__spec-text {
	display: flex;
	min-width: 0;
	flex-direction: column;
	line-height: 1.4;
}

.gift4u-palette__spec-label {
	color: rgba(255, 255, 255, .72);
	font-size: 11px;
}

.gift4u-palette__spec-value {
	color: #fff;
	font-size: 13px;
	font-weight: 700;
}

.gift4u-palette__swatches {
	grid-area: swatches;
	display: grid;
	direction: rtl;
	grid-template-columns: repeat(5, minmax(0, 100px));
	gap: 8px;
	justify-content: start;
}

.gift4u-palette__swatch {
	position: relative;
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	padding: 0;
	border: 2px solid #f58220;
	border-radius: 0;
	background: #eee;
	overflow: hidden;
	cursor: pointer;
	box-shadow: none;
	transition: transform .2s ease, filter .2s ease;
}

.gift4u-palette__swatch:hover,
.gift4u-palette__swatch:focus-visible {
	transform: translateY(-2px);
	filter: brightness(.82);
	outline: none;
}

.gift4u-palette__swatch.is-selected {
	filter: brightness(.82);
}

.gift4u-palette__swatch img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
	-webkit-user-drag: none;
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
}

.gift4u-palette__swatch::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	background: rgba(255, 255, 255, .001);
}

.gift4u-palette__swatch span {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.35;
	text-align: center;
	background: rgba(0, 0, 0, .58);
	opacity: 0;
	transform: scale(.92);
	transition: opacity .2s ease, transform .2s ease;
}

.gift4u-palette__swatch:hover span,
.gift4u-palette__swatch:focus-visible span,
.gift4u-palette__swatch.is-selected span {
	opacity: 1;
	transform: scale(1);
}

.gift4u-palette__preview {
	grid-area: preview;
	position: sticky;
	direction: rtl;
	top: 20px;
	width: 100%;
	max-width: 896px;
	justify-self: end;
	background: #000;
	border-radius: 10px;
	overflow: hidden;
}

.gift4u-palette__image-wrap {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 100%;
	max-height: calc(100vh - 40px);
	margin-inline: auto;
	padding: 30px 30px 0;
	border-radius: 10px;
	background: #000;
	box-sizing: border-box;
	overflow: hidden;
}

.gift4u-palette__image-wrap::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	background: rgba(255, 255, 255, .001);
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
}

.gift4u-palette__image {
	display: block;
	width: 90%;
	height: auto;
	max-width: 90%;
	max-height: calc(100vh - 70px);
	margin: 0 auto;
	object-fit: contain;
	transform-origin: center center;
	pointer-events: none;
	-webkit-user-drag: none;
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
}

.gift4u-palette__image.is-entering {
	animation: gift4u-slide-in-right .55s cubic-bezier(.22, 1, .36, 1) both;
}

.gift4u-palette__preview.is-loading .gift4u-palette__image {
	visibility: hidden;
}

.gift4u-palette__loader {
	position: absolute;
	z-index: 3;
	top: 50%;
	left: 50%;
	display: none;
	width: 42px;
	height: 42px;
	margin: -21px 0 0 -21px;
	border: 4px solid rgba(255, 255, 255, .28);
	border-top-color: #fff;
	border-radius: 50%;
	animation: gift4u-spin .75s linear infinite;
}

.gift4u-palette__preview.is-loading .gift4u-palette__loader {
	display: block;
}

.gift4u-palette__selected {
	min-height: 28px;
	margin: 10px 0 0;
	color: #fff;
	font-weight: 700;
	text-align: center;
}

.gift4u-palette__selected.is-error {
	color: #b42318;
}

.gift4u-palette__description {
	grid-area: description;
	position: relative;
	min-width: 0;
	margin: 0;
	padding: clamp(20px, 2.4vw, 32px) clamp(20px, 2.8vw, 38px);
	direction: rtl;
	text-align: right;
	color: #fff;
	font: inherit;
	font-size: clamp(13px, .95vw, 16px);
	line-height: 1.55;
	overflow-wrap: anywhere;
	background: linear-gradient(135deg, rgba(255, 255, 255, .095), rgba(255, 255, 255, .025));
	border: 1px solid rgba(255, 255, 255, .18);
	border-right: 4px solid #ff641a;
	border-radius: 18px;
	box-shadow: 0 16px 34px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .1);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.gift4u-palette__description::before {
	content: '“';
	position: absolute;
	top: 8px;
	left: 18px;
	color: rgba(255, 100, 26, .55);
	font-family: Georgia, serif;
	font-size: 58px;
	font-weight: 700;
	line-height: 1;
	pointer-events: none;
}

.gift4u-palette .gift4u-palette__description-text {
	position: relative;
	z-index: 1;
	max-height: calc(1.55em * 20);
	overflow: hidden;
	margin: 0;
	color: inherit;
	font: inherit;
	line-height: inherit;
	text-align: justify;
	text-align-last: right;
	white-space: pre-wrap;
}

.gift4u-palette .gift4u-palette__description-text::first-line {
	color: #ff641a;
	font-weight: 800;
}

.gift4u-palette__description.is-overflow::after {
	content: 'ادامه ...';
	display: block;
	position: absolute;
	right: clamp(20px, 2.8vw, 38px);
	bottom: clamp(14px, 1.6vw, 22px);
	z-index: 2;
	padding-inline: 8px;
	background: linear-gradient(90deg, transparent, rgba(22, 22, 22, .96) 28%);
	color: #ff641a;
	font-weight: 800;
	line-height: 1.6;
}

.gift4u-palette__description.is-typing .gift4u-palette__description-text::after {
	content: "";
	display: inline-block;
	width: 2px;
	height: 1em;
	margin-inline-start: 3px;
	background: currentColor;
	vertical-align: -.1em;
}

@media (min-width: 900px) {
	.gift4u-palette {
		display: flex;
		gap: 0;
	}

	.gift4u-palette__controls {
		flex: 0 1 424px;
		min-width: 0;
	}

	.gift4u-palette__preview {
		flex: 0 1 auto;
		min-width: 0;
		width: auto;
	}

	.gift4u-palette__image-wrap {
		margin-inline: 0;
	}

	.gift4u-palette__description {
		flex: 1 1 240px;
		padding-inline: clamp(16px, 2vw, 28px);
	}
}

@keyframes gift4u-spin {
	to { transform: rotate(360deg); }
}

@keyframes gift4u-slide-in-right {
	from {
		opacity: 0;
		transform: translateX(70px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}


@media (max-width: 899px) {
	.gift4u-palette {
		grid-template-columns: 1fr;
		grid-template-areas: "preview" "description" "controls";
	}

	.gift4u-palette__controls {
		justify-self: center;
	}

	.gift4u-palette__description {
		width: 100%;
		max-width: 720px;
		justify-self: center;
		padding: 20px 22px;
	}

	.gift4u-palette__description:has(.gift4u-palette__description-text:empty) {
		display: none;
	}

	.gift4u-palette__specs {
		padding: 10px;
	}

	.gift4u-palette__preview {
		position: static;
		max-width: 720px;
		justify-self: center;
	}

	.gift4u-palette__swatches {
		grid-template-columns: repeat(5, minmax(0, 100px));
		justify-content: center;
	}
}

@media (max-width: 767px) {
	.gift4u-palette__swatches {
		grid-template-columns: repeat(5, minmax(0, 100px));
	}

	.gift4u-palette__swatch span {
		font-size: 12px;
	}
}

@media (max-width: 479px) {
	.gift4u-palette__swatches {
		grid-template-columns: repeat(4, minmax(0, 100px));
	}
}

@media (max-width: 339px) {
	.gift4u-palette__swatches {
		grid-template-columns: repeat(3, minmax(0, 100px));
	}
}

@media (prefers-reduced-motion: reduce) {
	.gift4u-palette *,
	.gift4u-palette *::before,
	.gift4u-palette *::after {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}
}
