/* =========================================================
   PS3D2 Product Rotator - Frontend Styles
   ========================================================= */

.ps3d2-wrapper {
	--ps3d2-float-speed: 3.5s;
	width: 100%;
	direction: rtl;
}

.ps3d2-card {
	position: relative;
	display: flex;
	align-items: stretch;
	width: 100%;
	background: #fff;
	border-radius: 32px;
	overflow: visible;
	box-shadow: 0 30px 70px -25px rgba(0,0,0,.25);
}

/* ---------- Blob panel (left) ---------- */

.ps3d2-blob-panel {
	position: relative;
	flex: 1 1 55%;
	min-height: 480px;
	border-radius: 32px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
}

.ps3d2-blob-bg {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, var(--ps3d2-start, #8E54E9), var(--ps3d2-end, #4776E6));
	transition: opacity .5s ease;
}
.ps3d2-blob-bg-b {
	opacity: 0;
}

/* Organic blob corner shapes, only clipping the outer card (radius already applied by parent) */
.ps3d2-morph-low .ps3d2-blob-panel { border-radius: 40px 120px 40px 40px; }
.ps3d2-morph-medium .ps3d2-blob-panel { border-radius: 50px 160px 50px 50px; animation: ps3d2MorphMedium 9s ease-in-out infinite; }
.ps3d2-morph-high .ps3d2-blob-panel { border-radius: 60px 200px 60px 60px; animation: ps3d2MorphHigh 7s ease-in-out infinite; }

@keyframes ps3d2MorphMedium {
	0%, 100% { border-radius: 50px 160px 50px 50px; }
	50% { border-radius: 50px 90px 120px 50px; }
}
@keyframes ps3d2MorphHigh {
	0%, 100% { border-radius: 60px 200px 60px 60px; }
	33% { border-radius: 120px 60px 160px 60px; }
	66% { border-radius: 60px 120px 60px 160px; }
}

.ps3d2-blob-content {
	position: relative;
	z-index: 3;
	padding: 50px;
}

.ps3d2-product-title {
	margin: 0 0 8px;
	font-size: 36px;
	font-weight: 700;
	line-height: 1.25;
	color: #fff;
}

.ps3d2-product-subtitle {
	font-size: 14px;
	color: rgba(255,255,255,.75);
	font-weight: 500;
}

.ps3d2-image-wrap {
	position: relative;
	z-index: 2;
	flex: 1;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 0 20px 20px;
}

.ps3d2-product-image {
	max-width: 65%;
	max-height: 340px;
	object-fit: contain;
	filter: drop-shadow(0 30px 25px rgba(0,0,0,.3));
}

/* ---------- Switch animations ---------- */

.ps3d2-image-wrap.ps3d2-out-rotate-scale-fade .ps3d2-product-image,
.ps3d2-blob-content.ps3d2-out-rotate-scale-fade {
	animation: ps3d2OutRSF var(--ps3d2-anim-duration, .55s) ease forwards;
}
.ps3d2-image-wrap.ps3d2-in-rotate-scale-fade .ps3d2-product-image,
.ps3d2-blob-content.ps3d2-in-rotate-scale-fade {
	animation: ps3d2InRSF var(--ps3d2-anim-duration, .55s) cubic-bezier(.22,.9,.34,1) forwards;
}
@keyframes ps3d2OutRSF {
	to { transform: rotate(-50deg) scale(.25); opacity: 0; }
}
@keyframes ps3d2InRSF {
	from { transform: rotate(50deg) scale(.25); opacity: 0; }
	to { transform: rotate(0) scale(1); opacity: 1; }
}

.ps3d2-image-wrap.ps3d2-out-flip-3d .ps3d2-product-image,
.ps3d2-blob-content.ps3d2-out-flip-3d {
	animation: ps3d2OutFlip var(--ps3d2-anim-duration, .55s) ease forwards;
}
.ps3d2-image-wrap.ps3d2-in-flip-3d .ps3d2-product-image,
.ps3d2-blob-content.ps3d2-in-flip-3d {
	animation: ps3d2InFlip var(--ps3d2-anim-duration, .55s) ease forwards;
}
.ps3d2-image-wrap { perspective: 900px; }
.ps3d2-blob-content { transform-style: preserve-3d; }
@keyframes ps3d2OutFlip {
	to { transform: rotateY(180deg) scale(.6); opacity: 0; }
}
@keyframes ps3d2InFlip {
	from { transform: rotateY(-180deg) scale(.6); opacity: 0; }
	to { transform: rotateY(0) scale(1); opacity: 1; }
}

.ps3d2-image-wrap.ps3d2-out-slide-fade .ps3d2-product-image,
.ps3d2-blob-content.ps3d2-out-slide-fade {
	animation: ps3d2OutSlide var(--ps3d2-anim-duration, .55s) ease forwards;
}
.ps3d2-image-wrap.ps3d2-in-slide-fade .ps3d2-product-image,
.ps3d2-blob-content.ps3d2-in-slide-fade {
	animation: ps3d2InSlide var(--ps3d2-anim-duration, .55s) ease forwards;
}
@keyframes ps3d2OutSlide {
	to { transform: translateX(-60px); opacity: 0; }
}
@keyframes ps3d2InSlide {
	from { transform: translateX(60px); opacity: 0; }
	to { transform: translateX(0); opacity: 1; }
}

/* ---------- Floating decorative shapes ---------- */

.ps3d2-floating-shape {
	position: absolute;
	z-index: 1;
	pointer-events: none;
}
.ps3d2-shape-circle { border-radius: 50%; }
.ps3d2-shape-dot { border-radius: 50%; }
.ps3d2-shape-blob { border-radius: 60% 40% 55% 45% / 55% 45% 60% 40%; }
.ps3d2-shape-triangle {
	background: none !important;
	width: 0 !important;
	height: 0 !important;
	border-left: 20px solid transparent;
	border-right: 20px solid transparent;
	border-bottom: 34px solid currentColor;
}
.ps3d2-shape-triangle {
	color: inherit;
}

.ps3d2-float-anim {
	animation: ps3d2Float var(--ps3d2-float-speed, 3.5s) ease-in-out infinite;
}
.ps3d2-rotate-anim {
	animation: ps3d2Rotate calc(var(--ps3d2-float-speed, 3.5s) * 2) linear infinite;
}
.ps3d2-float-anim.ps3d2-rotate-anim {
	animation: ps3d2Float var(--ps3d2-float-speed, 3.5s) ease-in-out infinite,
	           ps3d2Rotate calc(var(--ps3d2-float-speed, 3.5s) * 2) linear infinite;
}

@keyframes ps3d2Float {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-16px); }
}
@keyframes ps3d2Rotate {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

/* ---------- Badge ---------- */

.ps3d2-badge {
	position: absolute;
	top: 20px;
	left: 20px;
	z-index: 4;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 25px -8px rgba(0,0,0,.3);
	overflow: hidden;
	text-decoration: none;
}
.ps3d2-badge img {
	width: 65%;
	height: 65%;
	object-fit: contain;
}

/* ---------- List panel (right) ---------- */

.ps3d2-list-panel {
	flex: 1 1 45%;
	padding: 44px 40px;
	display: flex;
	flex-direction: column;
	background: #fff;
	box-sizing: border-box;
}

.ps3d2-list-heading {
	margin: 0 0 22px;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.3;
	color: #1a1a1a;
}

.ps3d2-list-columns {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	letter-spacing: .05em;
	color: #b0b0b0;
	text-transform: uppercase;
	padding-bottom: 10px;
	border-bottom: 1px solid #f0f0f0;
	margin-bottom: 6px;
}

.ps3d2-row {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 10px;
	border-radius: 14px;
	cursor: pointer;
	transition: background-color .25s ease;
}
.ps3d2-row.active {
	background-color: rgba(142,84,233,.07);
}
.ps3d2-row-thumb {
	width: 44px;
	height: 44px;
	object-fit: contain;
	flex-shrink: 0;
}
.ps3d2-row-text {
	flex: 1 1 auto;
	min-width: 0;
}
.ps3d2-row-title {
	font-size: 14.5px;
	font-weight: 600;
	color: #1a1a1a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.ps3d2-row-dimension {
	font-size: 12px;
	color: #999;
	margin-top: 2px;
}
.ps3d2-row-add {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 1.5px solid #8E54E9;
	color: #8E54E9;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	font-size: 16px;
	line-height: 1;
	transition: background-color .2s ease, color .2s ease;
}
.ps3d2-row-add:hover {
	background-color: #8E54E9;
	color: #fff;
}

/* ---------- Toolbar ---------- */

.ps3d2-toolbar {
	position: absolute;
	left: 50%;
	bottom: -28px;
	transform: translateX(-50%);
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 14px;
	background: #fff;
	border-radius: 50px;
	padding: 10px 14px;
	box-shadow: 0 20px 45px -15px rgba(0,0,0,.3);
}

.ps3d2-toolbar-icon {
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #555;
	font-size: 15px;
	text-decoration: none;
	border-radius: 50%;
	transition: background-color .2s ease;
}
.ps3d2-toolbar-icon:hover {
	background-color: #f5f5f5;
}

.ps3d2-toolbar-sep {
	width: 1px;
	height: 22px;
	background: #eee;
}

.ps3d2-nav-btn {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: transform .2s ease, background-color .2s ease;
}
.ps3d2-nav-btn:active {
	transform: scale(.9);
}
.ps3d2-nav-prev {
	background: #f2f2f2;
	color: #1a1a1a;
}
.ps3d2-nav-next {
	background: #1a1a1a;
	color: #fff;
}

/* ---------- Corner floating button ---------- */

.ps3d2-corner-btn {
	position: absolute;
	right: -18px;
	bottom: 30px;
	z-index: 5;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #1a1a1a;
	font-size: 18px;
	text-decoration: none;
	box-shadow: 0 20px 45px -15px rgba(0,0,0,.35);
	transition: transform .25s ease;
}
.ps3d2-corner-btn:hover {
	transform: scale(1.08);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
	.ps3d2-card {
		flex-direction: column;
		border-radius: 28px;
	}
	.ps3d2-blob-panel {
		flex: none;
		min-height: 360px !important;
		border-radius: 28px 28px 0 0 !important;
	}
	.ps3d2-list-panel {
		flex: none;
		padding: 34px 26px 70px;
	}
	.ps3d2-blob-content {
		padding: 34px 30px;
	}
	.ps3d2-product-title {
		font-size: 28px;
	}
	.ps3d2-product-image {
		max-width: 55%;
		max-height: 220px;
	}
	.ps3d2-toolbar {
		bottom: 16px;
	}
	.ps3d2-corner-btn {
		right: 14px;
		bottom: auto;
		top: -18px;
	}
}

@media (max-width: 480px) {
	.ps3d2-toolbar {
		gap: 8px;
		padding: 8px 10px;
	}
	.ps3d2-toolbar-icon {
		width: 28px;
		height: 28px;
		font-size: 13px;
	}
	.ps3d2-nav-btn {
		width: 34px;
		height: 34px;
	}
	.ps3d2-product-title {
		font-size: 24px;
	}
}
