/* Oro18K Quibdó - Efectos y Animaciones Personalizadas */

/* Utilidades para flip cards 3D */
.perspective-1000 {
  perspective: 1000px;
}

.transform-style-preserve-3d {
  transform-style: preserve-3d;
}

.backface-hidden {
  backface-visibility: hidden;
}

.rotate-y-180 {
  transform: rotateY(180deg);
}

/* Sticky Header Transitions */
.header-transition {
  transition: all 0.3s ease-in-out;
}

/* Hero Video Background */
.video-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(0,0,0,0.5), rgba(0,0,0,0.3));
  z-index: 1;
}

/* Animaciones de entrada */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

@keyframes sink {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(3px);
  }
}

/* Aplicar animaciones */
.animate-fadeInUp {
  animation: fadeInUp 0.8s ease-out;
}

.animate-fadeInDown {
  animation: fadeInDown 0.8s ease-out;
}

.animate-fadeIn {
  animation: fadeIn 0.6s ease-out;
}

.animate-pulse-slow {
  animation: pulse 2s ease-in-out infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* Delays para animaciones escalonadas */
.delay-200 {
  animation-delay: 200ms;
}

.delay-400 {
  animation-delay: 400ms;
}

.delay-800 {
  animation-delay: 800ms;
}

/* Efectos de hover para botones */
.hover-sink:hover {
  animation: sink 0.2s ease-out forwards;
}

.hover-float:hover {
  animation: float 0.5s ease-in-out infinite;
}

/* Flip Cards 3D específicas */
.flip-card {
  perspective: 1000px;
  width: 100%;
  height: 300px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.7s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 16px;
  overflow: hidden;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* Grid de categorías con efectos hover */
.category-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

.category-card:hover .category-image {
  transform: scale(1.1);
}

.category-card:hover .category-overlay {
  background: rgba(0, 0, 0, 0.7);
}

.category-card:hover .category-button {
  opacity: 1;
  transform: translateY(0);
}

.category-image {
  transition: transform 0.3s ease-in-out;
}

.category-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease-in-out;
}

.category-button {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease-in-out;
}

/* Image Accordion */
.accordion-panel {
  flex: 1;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.accordion-panel.active,
.accordion-panel:hover {
  flex: 2;
}

.accordion-panel.active .accordion-image,
.accordion-panel:hover .accordion-image {
  transform: scale(1.1);
}

.accordion-image {
  transition: transform 0.5s ease-out;
}

/* Formulario multi-step */
.step-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transition: all 0.3s ease-in-out;
}

.step-indicator.active {
  background: #eab308;
  transform: scale(1.2);
}

.step-indicator.inactive {
  background: rgba(255, 255, 255, 0.3);
}

.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #eab308, #f59e0b);
  border-radius: 4px;
  transition: width 0.3s ease-in-out;
}

/* Texto animado con morphing */
.morphing-text {
  display: inline-block;
  transition: all 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  opacity: 1;
  transform: translateY(0);
}

.morphing-text.changing {
  opacity: 0;
  transform: translateY(-20px);
}

/* Side Cart */
.side-cart {
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
}

.side-cart.open {
  transform: translateX(0);
}

/* Chaty Widget */
.chaty-widget {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 40;
}

.chaty-channel {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease-in-out;
  cursor: pointer;
}

.chaty-channel:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Tooltip para chaty */
.chaty-tooltip {
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
}

.chaty-channel:hover .chaty-tooltip {
  opacity: 1;
}

/* Back to top button */
.back-to-top {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease-in-out;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-2px);
}

/* Modales */
.modal-overlay {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  animation: fadeInUp 0.3s ease-out;
}

/* Responsive para flip cards */
@media (max-width: 768px) {
  .flip-card {
    height: 250px;
  }

  .accordion-panel {
    flex-direction: column;
  }

  .accordion-panel.active,
  .accordion-panel:hover {
    flex: 1.5;
  }
}

/* Efectos de glassmorphism */
.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Gradientes personalizados para Oro18K */
.gradient-oro {
  background: linear-gradient(135deg, #eab308, #f59e0b, #d97706);
}

.gradient-dark {
  background: linear-gradient(135deg, #1f2937, #111827, #000000);
}

/* Neon glow effect para elementos dorados */
.neon-glow {
  text-shadow: 0 0 10px rgba(234, 179, 8, 0.5),
               0 0 20px rgba(234, 179, 8, 0.3),
               0 0 30px rgba(234, 179, 8, 0.2);
}

/* Partículas flotantes de fondo */
.particles::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(234, 179, 8, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(234, 179, 8, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 60%, rgba(234, 179, 8, 0.05) 0%, transparent 50%);
  animation: float 10s ease-in-out infinite;
  pointer-events: none;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #eab308, #f59e0b);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #f59e0b, #d97706);
}

/* Loading estados */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

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

/* Responsive adjustments */
@media (max-width: 640px) {
  .chaty-widget {
    left: 16px;
    bottom: 16px;
  }

  .chaty-channel {
    width: 44px;
    height: 44px;
    margin-bottom: 8px;
  }
}

/* Focus states para accesibilidad */
.focus-ring:focus {
  outline: 2px solid #eab308;
  outline-offset: 2px;
}

/* Transiciones suaves para cambios de tema */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Mejoras de rendimiento */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* Prevenir layout shift */
.aspect-ratio-16-9 {
  aspect-ratio: 16 / 9;
}

.aspect-ratio-1-1 {
  aspect-ratio: 1 / 1;
}

/* Estados de hover mejorados */
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(234, 179, 8, 0.4);
}

/* Animaciones de carga para imágenes */
.image-loading {
  background: linear-gradient(90deg, #f0f0f0, #e0e0e0, #f0f0f0);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

/* Mejoras para videos de fondo */
.video-background {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translateX(-50%) translateY(-50%);
  z-index: -1;
}

/* Optimizaciones para mobile */
@media (max-width: 768px) {
  .video-background {
    /* En mobile, usar imagen de fondo para mejor rendimiento */
    display: none;
  }
}

/* Estados de error y éxito */
.error-state {
  border-color: #ef4444;
  background-color: #fef2f2;
}

.success-state {
  border-color: #10b981;
  background-color: #f0fdf4;
}

/* Indicadores de carga */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #eab308;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}