/* Variables CSS para colores personalizables */
:root {
    --primary-color: #e76f51;
    --secondary-color: #1F2937;
    --primary-hover: #99582a;
    --secondary-hover: #111827;
    --primary-light: #FFF8F5;
}

/* Clases para Tailwind con variables CSS */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.hover\:text-primary:hover {
    color: var(--primary-color) !important;
}

.hover\:bg-primary-hover:hover {
    background-color: var(--primary-hover) !important;
}

.hover\:text-primary-hover:hover {
    color: var(--primary-hover) !important;
}

.bg-primary-light {
    background-color: var(--primary-light) !important;
}

.text-primary-light {
    color: var(--primary-light) !important;
}

.focus\:ring-primary:focus {
    --tw-ring-color: var(--primary-color) !important;
}

.focus\:border-primary:focus {
    border-color: var(--primary-color) !important;
}

/* Clases para usar los colores personalizados */
.primary-button {
    background-color: var(--primary-color);
}

.primary-button:hover {
    background-color: var(--primary-hover);
}

.primary-text {
    color: var(--primary-color);
}

.secondary-button {
    background-color: var(--secondary-color);
}

.secondary-button:hover {
    background-color: var(--secondary-hover);
}

.secondary-text {
    color: var(--secondary-color);
}

.hero-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.primary-bg {
    background-color: var(--primary-color) !important;
}

.primary-light-bg {
    background-color: var(--primary-light);
}

.hover\:primary-bg:hover {
    background-color: var(--primary-color);
}

.hover\:border-primary:hover {
    border-color: var(--primary-color);
}

.focus\:ring-primary:focus {
    --tw-ring-color: var(--primary-color);
}

.focus\:border-primary:focus {
    border-color: var(--primary-color);
}

.hover\:text-primary-hover:hover {
    color: var(--primary-hover);
}

.input-focus:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-hover:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hover\:text-primary-hover:hover {
    color: var(--primary-hover);
}

/* Estilos específicos para el marketplace */
.marketplace-header {
    background-color: white;
    border-bottom: 1px solid #E5E7EB;
}

.marketplace-nav-link {
    color: var(--secondary-color);
    transition: color 0.2s ease;
}

.marketplace-nav-link:hover {
    color: var(--primary-color);
}

.marketplace-cart-button {
    background-color: var(--primary-color);
    color: white;
    transition: background-color 0.2s ease;
}

.marketplace-cart-button:hover {
    background-color: var(--primary-hover);
}

/* Estilos para productos */
.product-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    box-shadow: 0 12px 28px rgba(231, 111, 81, 0.15), 0 5px 12px rgba(0, 0, 0, 0.08);
}

/* Estilos para botones de acción */
.action-button {
    background-color: var(--primary-color);
    color: white;
    transition: all 0.2s ease;
}

.action-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Estilos para secciones informativas */
.info-section {
    background-color: var(--primary-light);
}

.info-icon {
    color: var(--primary-color);
}

/* Estilos para formularios */
.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-button {
    background-color: var(--primary-color);
    color: white;
}

.form-button:hover {
    background-color: var(--primary-hover);
}

/* Estilos para notificaciones */
.notification-success {
    background-color: #10B981;
    color: white;
}

.notification-error {
    background-color: #EF4444;
    color: white;
}

.notification-warning {
    background-color: #F59E0B;
    color: white;
}

/* Estilos para badges y etiquetas */
.badge-primary {
    background-color: var(--primary-color);
    color: white;
}

.badge-secondary {
    background-color: var(--secondary-color);
    color: white;
}

/* Estilos para links */
.link-primary {
    color: var(--primary-color);
    text-decoration: none;
}

.link-primary:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Estilos para iconos */
.icon-primary {
    color: var(--primary-color);
}

.icon-secondary {
    color: var(--secondary-color);
}

/* Estilos para gradientes */
.gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
}

.gradient-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-hover) 100%);
}

/* Estilos para sombras */
.shadow-primary {
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1), 0 2px 4px -1px rgba(59, 130, 246, 0.06);
}

.shadow-secondary {
    box-shadow: 0 4px 6px -1px rgba(31, 41, 55, 0.1), 0 2px 4px -1px rgba(31, 41, 55, 0.06);
}

/* Estilos para el toast personalizado del carrito - VERSIÓN PREMIUM */
.cart-toast {
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.cart-toast.slide-out {
    animation: slideOutRight 0.3s cubic-bezier(0.55, 0.055, 0.675, 0.19);
}

@keyframes slideInRight {
    0% {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translateX(10%) scale(1.05);
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    0% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }
}

/* Toast Premium con gradiente y efectos */
.cart-toast-premium {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

.cart-toast-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

.cart-toast-success {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 
        0 20px 25px -5px rgba(102, 126, 234, 0.3),
        0 10px 10px -5px rgba(102, 126, 234, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

.cart-toast-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    box-shadow: 
        0 20px 25px -5px rgba(239, 68, 68, 0.2),
        0 10px 10px -5px rgba(239, 68, 68, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

/* Icono animado del carrito con diseño verde premium */
.cart-icon-animated {
    animation: cartBounce 0.6s ease-out;
    display: inline-block;
    color: #10b981 !important;
    text-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.2));
    position: relative;
}

.cart-icon-animated::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.1;
    animation: iconGlow 2s ease-in-out infinite;
}

@keyframes cartBounce {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(0deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes iconGlow {
    0%, 100% {
        transform: scale(1);
        opacity: 0.1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.2;
    }
}

/* Efecto especial para el icono del carrito */
.cart-icon-animated.fa-shopping-cart {
    color: #10b981 !important;
    animation: cartBounce 0.6s ease-out, cartPulse 2s ease-in-out infinite 0.6s;
}

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

/* Efecto de brillo en el carrito */
.cart-icon-animated.fa-shopping-cart::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    animation: cartShine 3s ease-in-out infinite;
}

@keyframes cartShine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Icono simple y bonito del carrito */
.cart-icon-simple {
    color: #ffffff !important;
    animation: cartBounce 0.6s ease-out;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

/* Efecto de partículas */
.cart-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.cart-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: particleFloat 2s ease-out infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) scale(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-20px) scale(1);
        opacity: 0;
    }
}

/* Animación del botón al agregar al carrito */
.add-to-cart-success {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    transform: scale(1.05);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 10px 15px -3px rgba(102, 126, 234, 0.3);
    border: none;
}

.add-to-cart-success:hover {
    transform: scale(1.08);
    box-shadow: 0 15px 25px -5px rgba(102, 126, 234, 0.4);
}

/* Animación del contador del carrito */
.cart-count-pulse {
    animation: cartCountPulse 1s ease-in-out;
}

@keyframes cartCountPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
        color: #667eea;
    }
    100% {
        transform: scale(1);
    }
}

/* Efecto de brillo en el toast */
.cart-toast-shine {
    position: relative;
    overflow: hidden;
}
cart-toast-success cart-toast-shine cart-toast-hover p-5 max-w-sm
.cart-toast-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    animation: shine 2s ease-in-out infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Texto con gradiente y colores vibrantes */
.cart-text-gradient {
    color: #ffffff !important;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Texto principal con colores especiales */
.cart-text-primary {
    color: #ffffff !important;
    font-weight: 800;
    font-size: 1.1em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Texto secundario con color suave */
.cart-text-secondary {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Botón de cerrar mejorado */
.cart-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.cart-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Efecto de confeti para éxito */
.cart-confetti {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.cart-confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    background: linear-gradient(45deg, #667eea, #764ba2, #a855f7);
    border-radius: 2px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Efecto de ondas para el toast */
.cart-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Efecto de brillo en el texto */
.cart-text-shine {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    background-size: 200% 100%;
    animation: textShine 2s ease-in-out infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* Efecto de hover en el toast */
.cart-toast-hover {
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cart-toast-hover:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 25px 30px -5px rgba(0, 0, 0, 0.15),
        0 15px 15px -5px rgba(0, 0, 0, 0.08);
}

/* ===== ESTILOS PARA TOAST MODERNO ESTILO TEMU/MERCADOLIBRE ===== */

/* Toast moderno mejorado */
.cart-toast-modern {
    opacity: 0;
    transform: translate(-50%, 100px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cart-toast-modern.cart-toast-visible {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.cart-toast-modern.cart-toast-hiding {
    opacity: 0;
    transform: translate(-50%, 50px) scale(0.95);
}

/* Pelotita voladora naranja */
.cart-flying-ball {
    will-change: transform, opacity;
    pointer-events: none;
}

/* Animación del icono del carrito cuando recibe la pelotita */
.cart-icon-bounce {
    animation: cartIconBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes cartIconBounce {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2) rotate(-5deg);
    }
    50% {
        transform: scale(1.15) rotate(5deg);
    }
    75% {
        transform: scale(1.1) rotate(-3deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* Botón de éxito al agregar */
.add-to-cart-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
    transform: scale(1.05);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
    border: none !important;
}

.add-to-cart-success:hover {
    transform: scale(1.08);
    box-shadow: 0 15px 25px -5px rgba(16, 185, 129, 0.4);
}

/* Responsive para mobile */
@media (max-width: 640px) {
    .cart-toast-modern {
        max-width: calc(100vw - 1rem) !important;
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, 100px) scale(0.9);
    }
    
    .cart-toast-modern.cart-toast-visible {
        transform: translate(-50%, 0) scale(1);
    }
    
    .cart-toast-modern .flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .cart-toast-modern a {
        flex: 1;
        min-width: 120px;
    }
}
