/* Safari compatibility - Define custom colors */
:root {
    --vet-orange: #ff9500;
    --vet-orange-light: #ffb347;
    --vet-brown: #8B4513;
    --vet-gray: #f8f9fa;
}

/* Safari fallback classes */
.text-vet-orange { color: #ff9500 !important; }
.text-vet-brown { color: #8B4513 !important; }
.bg-vet-orange { background-color: #ff9500 !important; }
.bg-vet-brown { background-color: #8B4513 !important; }
.border-vet-orange { border-color: #ff9500 !important; }
.border-vet-brown { border-color: #8B4513 !important; }
.hover\:bg-vet-orange:hover { background-color: #ff9500 !important; }
.hover\:bg-vet-brown:hover { background-color: #8B4513 !important; }
.hover\:text-vet-orange:hover { color: #ff9500 !important; }
.hover\:text-vet-brown:hover { color: #8B4513 !important; }
.focus\:ring-vet-orange:focus { --tw-ring-color: #ff9500 !important; }
.focus\:border-vet-orange:focus { border-color: #ff9500 !important; }

/* Reset y configuración base - Mantenemos solo lo esencial */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
}


/* Custom Tailwind Animations */
@keyframes float {
    0%, 100% { 
        transform: translate3d(0, 0, 0) rotate(0deg);
    }
    50% { 
        transform: translate3d(0, -20px, 0) rotate(180deg);
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translate3d(0, 30px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
    will-change: transform;
}

.animate-fade-in-up {
    animation: fade-in-up 0.7s ease-out forwards;
    will-change: transform, opacity;
}

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

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

::-webkit-scrollbar-thumb {
    background: #ff9500;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #e6850e;
}

/* Responsive helpers que Tailwind no cubre completamente */
@media (max-width: 768px) {
    .hero-content h2 {
        font-size: 2.5rem !important;
    }
}

/* Mejoras para waves responsive */
@media (max-width: 480px) {
    /* Para pantallas muy pequeñas, reducir más la altura de las waves */
    .wave-container {
        height: 3rem !important;
    }
}

@media (min-width: 1920px) {
    /* Para pantallas 4K, incrementar altura de waves */
    .wave-container {
        height: 10rem !important;
    }
}

/* Optimización de rendimiento para SVG waves */
.wave-svg {
    shape-rendering: geometricPrecision;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {
    .animate-float,
    .animate-fade-in-up,
    .animate-pulse,
    .animate-bounce {
        animation: none;
    }
    
    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* GPU acceleration for smooth animations */
.animate-float,
.animate-fade-in-up,
.hover\:scale-105,
.hover\:shadow-2xl {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Optimize hover effects */
.hover\:shadow-2xl {
    transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover\:scale-105 {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Optimize frequently used transitions */
.transition-all {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.transition-transform {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Improve text rendering */
body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Critical CSS for above-the-fold content */
.hero-content {
    contain: layout style paint;
}

/* Hero background image optimization */
#inicio img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    object-fit: cover;
    object-position: center;
    will-change: opacity;
}

/* Ensure smooth fade transition on load */
#inicio img.loaded {
    transition: opacity 0.5s ease-in-out;
}

/* Optimize images loading */
img {
    height: auto;
    max-width: 100%;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Booking System Styles */
.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
    background-color: white;
    color: #9ca3af;
}

@media (min-width: 640px) {
    .step-circle {
        width: 40px;
        height: 40px;
        font-size: 16px;
        border: 3px solid #e5e7eb;
    }
}

.step-circle.active {
    background-color: #ff9500;
    border-color: #ff9500;
    color: white;
    -webkit-transform: scale(1.05);
    transform: scale(1.05);
}

@media (min-width: 640px) {
    .step-circle.active {
        -webkit-transform: scale(1.1);
        transform: scale(1.1);
    }
}

.step-circle.completed {
    background-color: #8B4513;
    border-color: #8B4513;
    color: white;
}

.step-content {
    animation: fadeIn 0.5s ease-in-out;
}

/* Estilos para scroll vertical de horarios comprimidos */
#times-scroll-container {
    scrollbar-width: thin; /* Firefox - permitir scroll vertical */
    scrollbar-color: #ff9500 #f1f1f1;
}

#times-scroll-container::-webkit-scrollbar {
    width: 6px; /* WebKit - scroll vertical delgado */
}

#times-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#times-scroll-container::-webkit-scrollbar-thumb {
    background: #ff9500;
    border-radius: 3px;
}

#times-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #e6850e;
}

/* Smooth scrolling para touch devices */
#times-scroll-container {
    -webkit-overflow-scrolling: touch;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.consultation-card {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
}

.consultation-card:hover {
    transform: translate3d(0, -2px, 0);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Reduce janky animations on mobile */
@media (max-width: 768px) {
    .animate-float {
        animation-duration: 8s;
    }
    
    .hover\:scale-105:hover {
        transform: scale(1.02) translateZ(0);
    }
    
    .transition-all {
        transition-duration: 0.15s !important;
    }
}