/* Estilos personalizados para asegurar que las imágenes carguen correctamente */
img {
    background-color: #f0f0f0;
    /* Color de fondo mientras carga */
    min-height: 100px;
    /* Altura mínima mientras carga */
}

/* Estilos elegantes para el logo en el header */
.logo-container {
    display: inline-block;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(91, 31, 31, 0.02) 0%, rgba(255, 153, 0, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.logo-container:hover::before {
    opacity: 1;
}

.logo-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px -4px rgba(91, 31, 31, 0.12);
}

.logo-container img {
    background-color: transparent !important;
    min-height: auto !important;
    filter: drop-shadow(0 2px 8px rgba(91, 31, 31, 0.12))
            drop-shadow(0 1px 3px rgba(91, 31, 31, 0.08));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.logo-container:hover img {
    filter: drop-shadow(0 4px 12px rgba(91, 31, 31, 0.18))
            drop-shadow(0 2px 6px rgba(91, 31, 31, 0.12));
    transform: scale(1.03);
}

/* Responsivo para el logo */
@media (max-width: 768px) {
    .logo-container {
        padding: 0.5rem 0.75rem;
    }

    .logo-container:hover {
        transform: translateY(-2px);
    }
}

/* Forzar transparencia en logos del footer y login */
footer img,
.guest-layout img[alt*="Detalles"],
.guest-layout img[alt*="Logo"] {
    background-color: transparent !important;
    min-height: auto !important;
}

.lazy-load {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-load.loaded {
    opacity: 1;
}

/* Variables de colores personalizados basados en la paleta */
:root {
    --fondo-principal: #fff6f7;
    --texto-principal: #6e6d76;
    --enlaces-titulos: #5b1f1f;
    --fondo-footer: #ffffff;
    --naranja: #ff9900;
    --azul-claro: #1ea0c3;
    --rojo-intenso: #cc4545;
    --azul-primario: #007cba;
    --borde-input: #cccccc;
    --borde-activo: #007cba;
    --fondo-input: #ffffff;
    --texto-input: #6e6d76;
    --precio-original: #999999;
    --precio-actual: #000000;
    --etiqueta-oferta: #cc4545;
    --fondo-categorias: #ffffff;
    --borde-categorias: #dddddd;
    --texto-categorias: #5b1f1f;
    --sombra-ligera: rgba(0, 0, 0, 0.1) 0px 0px 20px 0px;
    --sombra-media: rgba(0, 0, 0, 0.2) 0px 4px 10px -2px;
    --sombra-fuerte: rgba(0, 0, 0, 0.2) 0px 8px 16px -8px;
}

/* =============================================
   ESTILOS MODERNOS PARA HERO SECTION 2024
   ============================================= */

/* Animaciones fundamentales */
@keyframes float-organic {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(5deg); }
    50% { transform: translateY(-15px) rotate(-3deg); }
    75% { transform: translateY(-25px) rotate(2deg); }
}

@keyframes float-gentle {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-15px) scale(1.05); }
}

@keyframes morph-shapes {
    0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; transform: rotate(0deg); }
    25% { border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%; transform: rotate(90deg); }
    50% { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; transform: rotate(180deg); }
    75% { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; transform: rotate(270deg); }
}

@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

@keyframes fade-in-up {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 153, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 153, 0, 0.6);
    }
}

/* Clases de animación */
.animate-fade-in-up {
    animation: fade-in-up 0.8s ease-out forwards;
}

.animation-delay-300 {
    animation-delay: 0.3s;
    opacity: 0;
}

/* Estilos específicos del Hero */
.hero-modern {
    background: linear-gradient(135deg, var(--fondo-principal) 0%, #f8f9ff 50%, var(--fondo-principal) 100%);
    background-size: 400% 400%;
    animation: gradient-flow 8s ease-in-out infinite;
}

.hero-background {
    position: relative;
    overflow: hidden;
}

.hero-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 25% 25%, rgba(255, 153, 0, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 75% 75%, rgba(30, 160, 195, 0.1) 0%, transparent 50%);
    animation: gradient-flow 10s ease-in-out infinite reverse;
}

/* Partículas flotantes */
.particles-container {
    z-index: 1;
}

.particle {
    will-change: transform;
}

/* Formas geométricas */
.geometric-shapes {
    z-index: 1;
}

.shape-1, .shape-2, .shape-3 {
    will-change: transform, border-radius;
}

/* Grid del hero */
.hero-grid {
    position: relative;
    z-index: 10;
}

/* Título con gradiente animado */
.hero-gradient-text {
    background-size: 200% 100%;
    animation: gradient-flow 4s ease-in-out infinite;
    font-weight: 800;
    line-height: 1.1;
}

/* Badge interactivo */
.hero-badge .badge-pulse {
    position: relative;
}

.hero-badge .badge-pulse::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: inherit;
    animation: pulse 2s infinite;
}

/* Subtítulo dinámico */
.subtitle-rotating {
    min-height: 3em;
    transition: all 0.5s ease-in-out;
}

/* Tarjeta de contacto */
.contact-card {
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 153, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

.contact-card:hover::before {
    left: 100%;
}

/* Avatar mejorado */
.avatar-container {
    position: relative;
}

.avatar-container::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--naranja), var(--azul-claro), var(--naranja));
    z-index: -1;
    animation: rotate-gradient 3s linear infinite;
    opacity: 0;
    transition: opacity 0.3s;
}

.avatar-container:hover::after {
    opacity: 1;
}

/* CTAs optimizados */
.hero-ctas .cta-primary {
    position: relative;
    overflow: hidden;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.hero-ctas .cta-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.hero-ctas .cta-primary:hover::before {
    opacity: 1;
}

.hero-ctas .cta-secondary {
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-ctas .cta-secondary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 153, 0, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.hero-ctas .cta-secondary:hover::before {
    opacity: 1;
}

/* Redes sociales modernas */
.social-media .social-link {
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    will-change: transform;
}

.social-media .social-link::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.social-media .social-link:hover::before {
    opacity: 1;
}

/* Contenedor de imagen hero */
.hero-visual .image-container {
    perspective: 1000px;
}

.hero-visual .image-container::before {
    content: '';
    position: absolute;
    inset: -20px;
    border-radius: 2rem;
    background: conic-gradient(from 0deg, var(--naranja), var(--azul-claro), var(--azul-primario), var(--naranja));
    z-index: -1;
    opacity: 0.1;
    animation: rotate-gradient 8s linear infinite;
    filter: blur(10px);
}

/* Efectos de hover para la imagen */
.hero-image {
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    filter: contrast(1.1) saturation(1.1);
}

.image-container:hover .hero-image {
    filter: contrast(1.2) saturation(1.2) brightness(1.05);
}

/* Elementos flotantes */
.floating-elements {
    z-index: 2;
}

/* Ola decorativa */
.wave-decoration {
    z-index: 5;
}

.wave-svg {
    animation: float-gentle 8s ease-in-out infinite;
}

/* Efectos de parallax reducido para accesibilidad */
@media (prefers-reduced-motion: no-preference) {
    .hero-modern {
        background-attachment: fixed;
    }
    
    .particles-container .particle {
        animation-play-state: running;
    }
    
    .geometric-shapes > div {
        animation-play-state: running;
    }
}

/* Modo reducido de movimiento */
@media (prefers-reduced-motion: reduce) {
    .hero-modern,
    .particles-container .particle,
    .geometric-shapes > div,
    .hero-gradient-text,
    .floating-elements > div {
        animation: none;
    }
    
    .animate-fade-in-up {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* Optimizaciones para dispositivos móviles */
@media (max-width: 768px) {
    .hero-modern {
        min-height: 100vh;
    }
    
    .hero-grid {
        gap: 2rem;
        padding: 1rem 0;
    }
    
    .hero-gradient-text {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .particles-container .particle {
        display: none; /* Ocultar partículas en móvil para mejor rendimiento */
    }
    
    .geometric-shapes > div {
        opacity: 0.1; /* Reducir opacidad en móvil */
    }
    
    .contact-card {
        margin: 1rem 0;
    }
    
    .hero-ctas {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-ctas .cta-primary,
    .hero-ctas .cta-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .social-media .social-link {
        width: 3rem;
        height: 3rem;
    }
}

/* Optimizaciones para tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-gradient-text {
        font-size: 3.5rem;
    }
    
    .hero-grid {
        gap: 3rem;
    }
}

/* Optimizaciones para pantallas grandes */
@media (min-width: 1920px) {
    .hero-container {
        max-width: 1400px;
    }
    
    .hero-gradient-text {
        font-size: 5rem;
    }
}

/* Utilidades adicionales */
.blur-xs {
    filter: blur(2px);
}

.shadow-3xl {
    box-shadow: 0 35px 60px -12px rgba(0, 0, 0, 0.25);
}

/* Mejoras de accesibilidad */
.hero-modern {
    scroll-behavior: smooth;
}

.hero-modern * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Focus states mejorados */
.cta-primary:focus,
.cta-secondary:focus,
.social-link:focus,
.contact-phone:focus {
    outline: 3px solid var(--naranja);
    outline-offset: 2px;
}

/* Estados de hover optimizados para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    .hero-ctas .cta-primary:hover,
    .hero-ctas .cta-secondary:hover,
    .social-media .social-link:hover,
    .contact-card:hover {
        transform: none;
    }
}