/**
 * ═══════════════════════════════════════════════
 *  REVOLUCIÓN URBANA — ANIMATIONS
 *  Scroll reveal, transitions, micro-interactions
 * ═══════════════════════════════════════════════
 */

/* ─── SCROLL REVEAL: Base hidden state ─── */
.ru-reveal {
	opacity: 0;
	transform: translateY(40px);
	transition:
		opacity var(--ru-duration-slower) var(--ru-ease-smooth),
		transform var(--ru-duration-slower) var(--ru-ease-smooth);
	will-change: opacity, transform;
}

.ru-reveal.ru-revealed {
	opacity: 1;
	transform: translateY(0);
}

/* Reveal from left */
.ru-reveal--left {
	transform: translateX(-50px);
}

.ru-reveal--left.ru-revealed {
	transform: translateX(0);
}

/* Reveal from right */
.ru-reveal--right {
	transform: translateX(50px);
}

.ru-reveal--right.ru-revealed {
	transform: translateX(0);
}

/* Scale up with subtle rotation */
.ru-reveal--scale {
	transform: scale(0.92) rotate(-1deg);
}

.ru-reveal--scale.ru-revealed {
	transform: scale(1) rotate(0);
}

/* Clip reveal (bottom to top) */
.ru-reveal--clip {
	opacity: 1;
	transform: none;
	clip-path: inset(100% 0 0 0);
	transition: clip-path var(--ru-duration-slower) var(--ru-ease-smooth);
}

.ru-reveal--clip.ru-revealed {
	clip-path: inset(0 0 0 0);
}

/* Blur reveal */
.ru-reveal--blur {
	filter: blur(12px);
	transition:
		opacity var(--ru-duration-slower) var(--ru-ease-smooth),
		transform var(--ru-duration-slower) var(--ru-ease-smooth),
		filter var(--ru-duration-slower) var(--ru-ease-smooth);
}

.ru-reveal--blur.ru-revealed {
	filter: blur(0);
}

/* ─── STAGGER: Grid items appear with delay ─── */
.ru-stagger > * {
	opacity: 0;
	transform: translateY(30px) scale(0.97);
	transition:
		opacity var(--ru-duration-slower) var(--ru-ease-smooth),
		transform var(--ru-duration-slower) var(--ru-ease-smooth);
}

.ru-stagger.ru-revealed > *:nth-child(1)  { transition-delay: 0ms; }
.ru-stagger.ru-revealed > *:nth-child(2)  { transition-delay: 80ms; }
.ru-stagger.ru-revealed > *:nth-child(3)  { transition-delay: 160ms; }
.ru-stagger.ru-revealed > *:nth-child(4)  { transition-delay: 240ms; }
.ru-stagger.ru-revealed > *:nth-child(5)  { transition-delay: 320ms; }
.ru-stagger.ru-revealed > *:nth-child(6)  { transition-delay: 400ms; }
.ru-stagger.ru-revealed > *:nth-child(7)  { transition-delay: 480ms; }
.ru-stagger.ru-revealed > *:nth-child(8)  { transition-delay: 560ms; }
.ru-stagger.ru-revealed > *:nth-child(9)  { transition-delay: 640ms; }
.ru-stagger.ru-revealed > *:nth-child(10) { transition-delay: 720ms; }
.ru-stagger.ru-revealed > *:nth-child(11) { transition-delay: 800ms; }
.ru-stagger.ru-revealed > *:nth-child(12) { transition-delay: 880ms; }

.ru-stagger.ru-revealed > * {
	opacity: 1;
	transform: translateY(0) scale(1);
}

/* ─── COUNTER ANIMATION ─── */
.ru-counter {
	font-variant-numeric: tabular-nums;
}

/* ─── PARALLAX BG ─── */
.ru-parallax {
	background-attachment: fixed;
	background-size: cover;
	background-position: center;
}

@supports (-webkit-touch-callout: none) {
	/* Disable parallax on iOS (not supported) */
	.ru-parallax {
		background-attachment: scroll;
	}
}

/* ─── IMAGE HOVER EFFECTS ─── */
.ru-img-zoom {
	overflow: hidden;
	position: relative;
}

.ru-img-zoom img {
	transition: transform var(--ru-duration-slower) var(--ru-ease-smooth);
}

.ru-img-zoom:hover img {
	transform: scale(1.1);
}

/* Image hover with overlay */
.ru-img-zoom--overlay::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(10,10,10,0.5) 0%, transparent 50%);
	opacity: 0;
	transition: opacity var(--ru-duration-base) var(--ru-ease);
}

.ru-img-zoom--overlay:hover::after {
	opacity: 1;
}

/* ─── CARD TILT ON HOVER ─── */
.ru-tilt {
	transition: transform var(--ru-duration-base) var(--ru-ease);
	will-change: transform;
}

.ru-tilt:hover {
	transform: perspective(800px) rotateY(-2deg) rotateX(2deg) translateY(-4px);
}

/* ─── SHINE SWEEP ON HOVER ─── */
.ru-shine {
	position: relative;
	overflow: hidden;
}

.ru-shine::after {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 50%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
	transition: left var(--ru-duration-slower) var(--ru-ease);
}

.ru-shine:hover::after {
	left: 150%;
}

/* ─── TEXT SPLIT ANIMATION ─── */
.ru-text-reveal {
	overflow: hidden;
	display: inline-block;
}

.ru-text-reveal > span {
	display: inline-block;
	transform: translateY(110%);
	transition: transform var(--ru-duration-slower) var(--ru-ease-smooth);
}

.ru-text-reveal.ru-revealed > span {
	transform: translateY(0);
}

/* ─── FLOATING ANIMATION ─── */
.ru-float {
	animation: ru-float 3s ease-in-out infinite;
}

@keyframes ru-float {
	0%, 100% { transform: translateY(0); }
	50%      { transform: translateY(-8px); }
}

/* ─── PULSE ANIMATION ─── */
.ru-pulse {
	animation: ru-pulse 2s ease-in-out infinite;
}

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

/* ─── BUTTON RIPPLE EFFECT ─── */
.ru-btn--ripple {
	position: relative;
	overflow: hidden;
}

.ru-btn--ripple::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.15);
	transform: translate(-50%, -50%);
	transition: width 0.6s ease, height 0.6s ease;
}

.ru-btn--ripple:active::before {
	width: 300px;
	height: 300px;
}

/* ─── LOADING SKELETON ─── */
.ru-skeleton {
	background: linear-gradient(
		90deg,
		var(--ru-gray-800) 25%,
		var(--ru-gray-700) 50%,
		var(--ru-gray-800) 75%
	);
	background-size: 200% 100%;
	animation: ru-shimmer 1.5s infinite;
	border-radius: 0;
}

@keyframes ru-shimmer {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* ─── FADE IN PAGE ─── */
.ru-theme #et-main-area {
	animation: ru-fade-in 0.6s var(--ru-ease-smooth) forwards;
}

@keyframes ru-fade-in {
	from {
		opacity: 0;
		transform: translateY(15px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ─── HERO TEXT ENTRANCE (staggered) ─── */
.ru-home .et_pb_section:first-child h1 {
	animation: ru-hero-text-in 0.8s var(--ru-ease-smooth) 0.2s both;
}

.ru-home .et_pb_section:first-child p {
	animation: ru-hero-text-in 0.8s var(--ru-ease-smooth) 0.5s both;
}

.ru-home .et_pb_section:first-child .et_pb_button_module_wrapper,
.ru-home .et_pb_section:first-child .et_pb_button {
	animation: ru-hero-text-in 0.8s var(--ru-ease-smooth) 0.7s both;
}

@keyframes ru-hero-text-in {
	from {
		opacity: 0;
		transform: translateY(40px);
		filter: blur(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
		filter: blur(0);
	}
}

/* ─── CART DRAWER TRANSITIONS ─── */
.ru-cart-drawer {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: var(--ru-z-drawer);
	pointer-events: none;
	visibility: hidden;
}

.ru-cart-drawer.ru-cart-drawer--open {
	pointer-events: all;
	visibility: visible;
}

.ru-cart-drawer__overlay {
	position: absolute;
	inset: 0;
	background-color: rgba(0, 0, 0, 0);
	transition: background-color var(--ru-duration-base) var(--ru-ease);
}

.ru-cart-drawer--open .ru-cart-drawer__overlay {
	background-color: rgba(0, 0, 0, 0.6);
}

.ru-cart-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 420px;
	max-width: 90vw;
	background-color: var(--ru-black);
	border-left: 1px solid var(--ru-gray-800);
	transform: translateX(100%);
	transition: transform var(--ru-duration-base) var(--ru-ease);
	display: flex;
	flex-direction: column;
}

.ru-cart-drawer--open .ru-cart-drawer__panel {
	transform: translateX(0);
}

.ru-cart-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--ru-space-3);
	border-bottom: 1px solid var(--ru-gray-800);
}

.ru-cart-drawer__header h3 {
	font-family: var(--ru-font-heading) !important;
	font-size: var(--ru-text-2xl);
	color: var(--ru-white);
	text-transform: uppercase;
	letter-spacing: var(--ru-tracking-wider);
	margin: 0;
}

.ru-cart-drawer__close {
	background: none;
	border: none;
	color: var(--ru-gray-400);
	cursor: pointer;
	padding: 4px;
	transition: color var(--ru-duration-fast) var(--ru-ease);
}

.ru-cart-drawer__close:hover {
	color: var(--ru-yellow);
}

.ru-cart-drawer__content {
	flex: 1;
	overflow-y: auto;
	padding: var(--ru-space-3);
}

.ru-cart-drawer__item {
	display: flex;
	gap: var(--ru-space-2);
	padding: var(--ru-space-2) 0;
	border-bottom: 1px solid var(--ru-gray-800);
}

.ru-cart-drawer__item-img {
	width: 80px;
	height: 100px;
	flex-shrink: 0;
	overflow: hidden;
}

.ru-cart-drawer__item-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ru-cart-drawer__item-name {
	font-family: var(--ru-font-heading);
	font-size: var(--ru-text-base);
	color: var(--ru-white);
	text-transform: uppercase;
	letter-spacing: var(--ru-tracking-wide);
	margin: 0 0 4px;
}

.ru-cart-drawer__item-price {
	font-family: var(--ru-font-heading);
	font-size: var(--ru-text-lg);
	color: var(--ru-yellow);
	margin: 0 0 4px;
}

.ru-cart-drawer__item-qty {
	font-family: var(--ru-font-body);
	font-size: var(--ru-text-sm);
	color: var(--ru-gray-400);
	margin: 0;
}

.ru-cart-drawer__empty {
	text-align: center;
	padding: var(--ru-space-8) 0;
	color: var(--ru-gray-400);
}

.ru-cart-drawer__empty p {
	font-family: var(--ru-font-body);
	font-size: var(--ru-text-base);
	margin-bottom: var(--ru-space-3);
}

.ru-cart-drawer__footer {
	padding: var(--ru-space-3);
	border-top: 1px solid var(--ru-gray-800);
	display: flex;
	flex-direction: column;
	gap: var(--ru-space-1);
}

.ru-cart-drawer__subtotal {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: var(--ru-space-2);
}

.ru-cart-drawer__subtotal span:first-child {
	font-family: var(--ru-font-heading);
	font-size: var(--ru-text-lg);
	color: var(--ru-gray-300);
	text-transform: uppercase;
	letter-spacing: var(--ru-tracking-wider);
}

.ru-cart-drawer__subtotal span:last-child {
	font-family: var(--ru-font-heading);
	font-size: var(--ru-text-2xl);
	color: var(--ru-yellow);
}

/* ─── PREFERS REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
	.ru-reveal,
	.ru-stagger > *,
	.ru-img-zoom img,
	.ru-cart-drawer__panel,
	.ru-cart-drawer__overlay,
	.ru-announcement-bar__track,
	.ru-home .et_pb_section:first-child h1,
	.ru-home .et_pb_section:first-child p,
	.ru-home .et_pb_section:first-child .et_pb_button {
		transition: none !important;
		animation: none !important;
	}

	.ru-reveal {
		opacity: 1;
		transform: none;
		clip-path: none;
		filter: none;
	}

	.ru-stagger > * {
		opacity: 1;
		transform: none;
	}

	.ru-reveal--clip {
		clip-path: none;
	}
}

/* ═══════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════ */
#ru-toast-container {
	position: fixed;
	top: 100px;
	right: 24px;
	z-index: var(--ru-z-toast, 600);
	display: flex;
	flex-direction: column;
	gap: 8px;
	pointer-events: none;
}

.ru-toast {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 24px;
	background: var(--ru-glass-bg);
	-webkit-backdrop-filter: var(--ru-glass-blur-lg);
	backdrop-filter: var(--ru-glass-blur-lg);
	border: 1px solid var(--ru-glass-border);
	box-shadow: var(--ru-shadow-float);
	color: var(--ru-white);
	font-family: var(--ru-font-body);
	font-size: var(--ru-text-sm);
	transform: translateX(120%);
	transition: transform var(--ru-duration-base) var(--ru-ease-spring);
	pointer-events: all;
	min-width: 240px;
}

.ru-toast--visible {
	transform: translateX(0);
}

.ru-toast__icon {
	width: 28px;
	height: 28px;
	border-radius: var(--ru-radius-full);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 700;
	flex-shrink: 0;
}

.ru-toast--success .ru-toast__icon {
	background: var(--ru-success);
	color: var(--ru-white);
}

.ru-toast--error .ru-toast__icon {
	background: var(--ru-error);
	color: var(--ru-white);
}

.ru-toast__message {
	font-weight: 500;
	letter-spacing: var(--ru-tracking-wide);
}

@media (max-width: 767px) {
	#ru-toast-container {
		top: auto;
		bottom: 80px;
		right: 12px;
		left: 12px;
	}

	.ru-toast {
		min-width: auto;
	}
}
