/**
 * Event Merchandise Floating Tab
 * Elegant floating tab with carousel for merchandise display
 */

/* ========================================
   FLOATING TAB BASE
======================================== */
.mlet-floating-merch-tab {
	position: fixed;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	z-index: 999900;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tab Trigger Button */
.mlet-merch-tab-trigger {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border: none;
	border-radius: 12px 0 0 12px;
	padding: 16px 12px;
	cursor: pointer;
	box-shadow: -4px 0 20px rgba(102, 126, 234, 0.3);
	transition: all 0.3s ease;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	position: relative;
	overflow: visible;
}

.mlet-merch-tab-trigger:hover {
	background: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
	box-shadow: -6px 0 30px rgba(102, 126, 234, 0.5);
	transform: translateX(-4px);
}

.mlet-merch-tab-trigger:active {
	transform: translateX(-2px);
}

.mlet-tab-icon {
	position: relative;
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	backdrop-filter: blur(10px);
}

.mlet-products-badge {
	position: absolute;
	top: -8px;
	right: -8px;
	background: #ff4757;
	color: white;
	border-radius: 50%;
	width: 24px;
	height: 24px;
	font-size: 12px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid white;
	box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
	animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.1); }
}

.mlet-tab-text {
	color: white;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	white-space: nowrap;
	writing-mode: vertical-rl;
	text-orientation: mixed;
	line-height: 1.2;
}

/* Panel (Expandable) */
.mlet-merch-tab-panel {
	position: absolute;
	right: 70px;
	top: 50%;
	transform: translateY(-50%);
	width: 380px;
	max-height: 600px;
	background: white;
	border-radius: 16px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.mlet-floating-merch-tab.active .mlet-merch-tab-panel {
	opacity: 1;
	visibility: visible;
	pointer-events: all;
	transform: translateY(-50%) translateX(0);
}

.mlet-floating-merch-tab.active .mlet-merch-tab-trigger {
	box-shadow: -4px 0 20px rgba(102, 126, 234, 0.3);
}

/* Panel Header */
.mlet-merch-panel-header {
	padding: 20px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-radius: 16px 16px 0 0;
	flex-shrink: 0;
}

.mlet-panel-header-content {
	display: flex;
	align-items: center;
	gap: 12px;
}

.mlet-panel-icon {
	font-size: 32px;
	line-height: 1;
}

.mlet-panel-title h3 {
	margin: 0 0 4px 0;
	font-size: 18px;
	font-weight: 700;
	color: white;
}

.mlet-panel-title p {
	margin: 0;
	font-size: 13px;
	opacity: 0.9;
}

.mlet-panel-close {
	background: rgba(255, 255, 255, 0.2);
	border: none;
	color: white;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 24px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
	padding: 0;
}

.mlet-panel-close:hover {
	background: rgba(255, 255, 255, 0.3);
	transform: rotate(90deg);
}

/* Carousel Wrapper */
.mlet-merch-carousel-wrapper {
	position: relative;
	flex: 1;
	overflow: hidden;
	display: flex;
	align-items: center;
	min-height: 0;
}

.mlet-merch-carousel {
	width: 100%;
	overflow: hidden;
	flex: 1;
}

.mlet-carousel-track {
	display: flex;
	transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
	height: 100%;
}

.mlet-carousel-slide {
	min-width: 100%;
	flex-shrink: 0;
	display: none;
	padding: 20px;
	overflow-y: auto;
	overflow-x: hidden;
	max-height: 500px;
}

.mlet-carousel-slide.active {
	display: block;
}

/* Carousel Navigation */
.mlet-carousel-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: white;
	border: 2px solid #e0e0e0;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.3s ease;
	z-index: 10;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
	color: #667eea;
}

.mlet-carousel-nav:hover {
	background: #667eea;
	color: white;
	border-color: #667eea;
	transform: translateY(-50%) scale(1.1);
	box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.mlet-carousel-nav:active {
	transform: translateY(-50%) scale(0.95);
}

.mlet-carousel-prev {
	left: 10px;
}

.mlet-carousel-next {
	right: 10px;
}

.mlet-carousel-nav svg {
	width: 20px;
	height: 20px;
}

/* Slide Content */
.mlet-merch-slide-content {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* Image Wrapper */
.mlet-slide-image-wrapper {
	position: relative;
	width: 100%;
	aspect-ratio: 1;
	border-radius: 12px;
	overflow: hidden;
	background: #f5f7fa;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.mlet-slide-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.mlet-slide-image-wrapper:hover .mlet-slide-image {
	transform: scale(1.05);
}

.mlet-slide-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
}

.mlet-placeholder-icon {
	font-size: 64px;
	opacity: 0.5;
}

/* Badges */
.mlet-slide-badges {
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	z-index: 5;
}

.mlet-badge {
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(10px);
	padding: 6px 10px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 4px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.mlet-badge-sale {
	background: linear-gradient(135deg, #ff4757 0%, #ff6348 100%);
	color: white;
}

.mlet-badge-out {
	background: rgba(0, 0, 0, 0.7);
	color: white;
}

.mlet-badge-low {
	background: linear-gradient(135deg, #ffa726 0%, #fb8c00 100%);
	color: white;
}

.mlet-badge-featured {
	background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
	color: #333;
}

.mlet-badge-emoji {
	font-size: 12px;
	line-height: 1;
}

/* Slide Info */
.mlet-slide-info {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.mlet-slide-title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: #333;
	line-height: 1.3;
}

.mlet-slide-description {
	margin: 0;
	font-size: 14px;
	color: #666;
	line-height: 1.5;
}

/* Price */
.mlet-slide-price {
	margin: 8px 0;
}

.mlet-price-container {
	display: flex;
	align-items: baseline;
	gap: 8px;
	flex-wrap: wrap;
}

.mlet-price-sale {
	font-size: 24px;
	font-weight: 700;
	color: #667eea;
}

.mlet-price-original {
	font-size: 16px;
	color: #999;
	text-decoration: line-through;
}

.mlet-price-regular {
	font-size: 24px;
	font-weight: 700;
	color: #333;
}

.mlet-discount {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	padding: 4px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
}

/* Actions */
.mlet-slide-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.mlet-add-cart-btn,
.mlet-view-product-btn,
.mlet-out-stock-btn {
	flex: 1;
	min-width: 140px;
	padding: 14px 20px;
	border: none;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-decoration: none;
}

.mlet-add-cart-btn {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.mlet-add-cart-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.mlet-add-cart-btn:active {
	transform: translateY(0);
}

.mlet-add-cart-btn.loading {
	opacity: 0.7;
	cursor: wait;
	pointer-events: none;
}

.mlet-add-cart-btn.loading .mlet-btn-text::after {
	content: '...';
	animation: dots 1.5s infinite;
}

@keyframes dots {
	0%, 20% { content: '.'; }
	40% { content: '..'; }
	60%, 100% { content: '...'; }
}

.mlet-view-product-btn {
	background: white;
	color: #667eea;
	border: 2px solid #667eea;
}

.mlet-view-product-btn:hover {
	background: #667eea;
	color: white;
	transform: translateY(-2px);
}

.mlet-out-stock-btn {
	background: #e0e0e0;
	color: #999;
	cursor: not-allowed;
}

.mlet-btn-icon {
	font-size: 18px;
	line-height: 1;
}

.mlet-btn-text {
	font-size: 14px;
}

/* Carousel Indicators */
.mlet-carousel-indicators {
	display: flex;
	justify-content: center;
	gap: 8px;
	padding: 16px;
	flex-shrink: 0;
}

.mlet-indicator {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: none;
	background: #e0e0e0;
	cursor: pointer;
	transition: all 0.3s ease;
	padding: 0;
}

.mlet-indicator.active {
	background: #667eea;
	width: 24px;
	border-radius: 4px;
}

.mlet-indicator:hover:not(.active) {
	background: #b0b0b0;
}

/* Footer */
.mlet-merch-panel-footer {
	padding: 16px 20px;
	background: #f8f9fa;
	border-top: 1px solid #e0e0e0;
	flex-shrink: 0;
}

.mlet-view-cart-link {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 12px;
	background: white;
	border: 2px solid #667eea;
	border-radius: 10px;
	color: #667eea;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	transition: all 0.3s ease;
}

.mlet-view-cart-link:hover {
	background: #667eea;
	color: white;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.mlet-cart-count {
	background: #667eea;
	color: white;
	border-radius: 12px;
	padding: 2px 8px;
	font-size: 12px;
	font-weight: 700;
	min-width: 24px;
	text-align: center;
}

.mlet-view-cart-link:hover .mlet-cart-count {
	background: white;
	color: #667eea;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
	.mlet-floating-merch-tab {
		right: 0;
		bottom: 80px;
		top: auto;
		transform: none;
	}
	
	.mlet-merch-tab-trigger {
		border-radius: 12px 12px 0 0;
		padding: 12px 10px;
		flex-direction: row;
		gap: 8px;
	}
	
	.mlet-tab-text {
		writing-mode: horizontal-tb;
		text-orientation: initial;
		font-size: 14px;
	}
	
	.mlet-tab-icon {
		width: 40px;
		height: 40px;
		font-size: 24px;
	}
	
	.mlet-merch-tab-panel {
		right: 0;
		bottom: 100%;
		top: auto;
		transform: translateY(0);
		width: 100vw;
		max-width: 100vw;
		max-height: 70vh;
		border-radius: 16px 16px 0 0;
	}
	
	.mlet-floating-merch-tab.active .mlet-merch-tab-panel {
		transform: translateY(0) translateX(0);
	}
	
	.mlet-carousel-slide {
		padding: 16px;
		max-height: calc(70vh - 140px);
	}
	
	.mlet-carousel-nav {
		width: 36px;
		height: 36px;
	}
	
	.mlet-slide-title {
		font-size: 16px;
	}
	
	.mlet-slide-description {
		font-size: 13px;
	}
	
	.mlet-price-sale,
	.mlet-price-regular {
		font-size: 22px;
	}
	
	.mlet-add-cart-btn,
	.mlet-view-product-btn {
		min-width: auto;
		flex: 1;
	}
}

@media (max-width: 480px) {
	.mlet-floating-merch-tab {
		bottom: 70px;
	}
	
	.mlet-merch-tab-panel {
		max-height: 75vh;
	}
	
	.mlet-slide-image-wrapper {
		aspect-ratio: 4/3;
	}
}

/* ========================================
   DARK MODE
======================================== */
@media (prefers-color-scheme: dark) {
	.mlet-merch-tab-panel {
		background: #1e1e1e;
	}
	
	.mlet-carousel-slide {
		background: #1e1e1e;
	}
	
	.mlet-slide-title {
		color: #e5e5e5;
	}
	
	.mlet-slide-description {
		color: #b0b0b0;
	}
	
	.mlet-price-regular {
		color: #e5e5e5;
	}
	
	.mlet-price-original {
		color: #808080;
	}
	
	.mlet-carousel-nav {
		background: #2a2a2a;
		border-color: #3a3a3a;
		color: #667eea;
	}
	
	.mlet-carousel-nav:hover {
		background: #667eea;
		color: white;
	}
	
	.mlet-slide-image-wrapper {
		background: #2a2a2a;
	}
	
	.mlet-slide-placeholder {
		background: linear-gradient(135deg, #667eea30 0%, #764ba230 100%);
	}
	
	.mlet-view-product-btn {
		background: #2a2a2a;
		border-color: #667eea;
		color: #667eea;
	}
	
	.mlet-view-product-btn:hover {
		background: #667eea;
		color: white;
	}
	
	.mlet-merch-panel-footer {
		background: #2a2a2a;
		border-color: #3a3a3a;
	}
	
	.mlet-view-cart-link {
		background: #2a2a2a;
		border-color: #667eea;
		color: #667eea;
	}
	
	.mlet-view-cart-link:hover {
		background: #667eea;
		color: white;
	}
	
	.mlet-indicator {
		background: #3a3a3a;
	}
	
	.mlet-indicator.active {
		background: #667eea;
	}
	
	.mlet-indicator:hover:not(.active) {
		background: #5a5a5a;
	}
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes slideInRight {
	from {
		opacity: 0;
		transform: translateX(30px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

.mlet-floating-merch-tab.active .mlet-merch-tab-panel {
	animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Success Animation */
.mlet-add-cart-btn.success {
	background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
	animation: successPulse 0.6s ease;
}

@keyframes successPulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.05); }
}

/* Loading Spinner */
.mlet-add-cart-btn.loading::before {
	content: '';
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: white;
	border-radius: 50%;
	animation: spin 0.6s linear infinite;
	margin-right: 8px;
}

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

/* Messages */
.mlet-merch-message {
	position: absolute;
	top: 20px;
	left: 50%;
	transform: translateX(-50%);
	background: white;
	padding: 12px 20px;
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
	z-index: 1000;
	font-size: 14px;
	font-weight: 500;
	animation: slideDown 0.3s ease;
}

.mlet-merch-message.error {
	background: #ff4757;
	color: white;
}

.mlet-merch-message.success {
	background: #28a745;
	color: white;
}

@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateX(-50%) translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) translateY(0);
	}
}

