/* ===============================
   ADVANCED ANIMATIONS & DYNAMIC EFFECTS
   Efectos profesionales y llamativos
=============================== */

/* ===============================
   KEYFRAME ANIMATIONS
=============================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1200px 0;
    }
    100% {
        background-position: 1200px 0;
    }
}

@keyframes rotateGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(30, 136, 229, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(30, 136, 229, 0.6);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===============================
   SCROLL ANIMATIONS
=============================== */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

.animate-slide-left {
    opacity: 0;
    transform: translateX(-100px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-slide-left.animated {
    opacity: 1;
    transform: translateX(0);
}

.animate-slide-right {
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-slide-right.animated {
    opacity: 1;
    transform: translateX(0);
}

.animate-zoom-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-zoom-in.animated {
    opacity: 1;
    transform: scale(1);
}

.animate-bounce-in {
    opacity: 0;
    transform: scale(0.3);
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.animate-bounce-in.animated {
    opacity: 1;
    transform: scale(1);
}

/* Animation Delays */
.animate-delay-100 { transition-delay: 0.1s; }
.animate-delay-200 { transition-delay: 0.2s; }
.animate-delay-300 { transition-delay: 0.3s; }
.animate-delay-400 { transition-delay: 0.4s; }
.animate-delay-500 { transition-delay: 0.5s; }

/* ===============================
   ENHANCED BUTTON EFFECTS
=============================== */

.btn-enhanced {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
}

.btn-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
    z-index: -1;
}

.btn-enhanced:hover::before {
    left: 100%;
}

.btn-enhanced:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Glowing Button */
.btn-glow {
    animation: glow 2s ease-in-out infinite alternate;
}

.btn-glow:hover {
    animation: none;
    box-shadow: 0 0 30px rgba(30, 136, 229, 0.8);
}

/* ===============================
   CARD HOVER EFFECTS
=============================== */

/* 3D Card Effect */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-3d:hover {
    transform: rotateY(5deg) rotateX(5deg) translateZ(20px);
}

/* Enhanced Product Cards */
.product-card {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center bottom;
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.product-card:hover::before {
    transform: translateX(100%);
}

.product-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.product-card:hover .product-image img {
    transform: scale(1.1) rotate(2deg);
}

/* Enhanced Service Cards */
.service-card {
    transform-style: preserve-3d;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 15px;
    z-index: -1;
}

.service-card:hover::after {
    opacity: 0.1;
}

.service-card:hover {
    transform: translateY(-20px) rotateX(10deg);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
    color: var(--white);
}

.service-icon {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 10px 25px rgba(30, 136, 229, 0.3);
}

/* ===============================
   NAVIGATION ENHANCEMENTS
=============================== */

.nav-link {
    position: relative;
    overflow: hidden;
    transition: color 0.3s ease, transform 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-color);
    transform: translateY(-1px);
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 500;
}

/* Removed the ::after pseudo-element lines that were causing the ugly underlines */

/* Mobile Menu Animation */
.nav-menu {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===============================
   FORM ENHANCEMENTS
=============================== */

.form-group input,
.form-group textarea,
.form-group select {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(30, 136, 229, 0.15);
}

/* Floating Label Effect */
.form-group-floating {
    position: relative;
}

.form-group-floating input,
.form-group-floating textarea {
    padding-top: 20px;
    padding-bottom: 5px;
}

.form-group-floating label {
    position: absolute;
    top: 15px;
    left: 15px;
    color: var(--text-light);
    pointer-events: none;
    transition: all 0.3s ease;
}

.form-group-floating input:focus + label,
.form-group-floating input:not(:placeholder-shown) + label,
.form-group-floating textarea:focus + label,
.form-group-floating textarea:not(:placeholder-shown) + label {
    top: 5px;
    font-size: 0.8rem;
    color: var(--primary-color);
}

/* ===============================
   HERO SECTION ENHANCEMENTS
=============================== */

.hero-title {
    animation: fadeInUp 1s ease-out 0.3s both;
}

.hero-subtitle {
    animation: fadeInUp 1s ease-out 0.6s both;
}

.hero-buttons {
    animation: fadeInUp 1s ease-out 0.9s both;
}

/* Typewriter Effect for Hero */
.typewriter-text {
    overflow: hidden;
    border-right: 3px solid var(--primary-color);
    white-space: nowrap;
    animation: 
        typewriter 4s steps(40) 1s 1 normal both,
        blink 1s steps(2) infinite;
}

/* Floating Elements */
.float-element {
    animation: float 6s ease-in-out infinite;
}

.float-element:nth-child(2n) {
    animation-delay: 2s;
}

.float-element:nth-child(3n) {
    animation-delay: 4s;
}

/* ===============================
   SCROLL PROGRESS INDICATOR
=============================== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    z-index: 1001;
    transition: width 0.1s ease;
}

/* ===============================
   GRADIENT BACKGROUNDS
=============================== */

.gradient-animated {
    background: linear-gradient(-45deg, var(--primary-color), var(--secondary-color), var(--accent-color), var(--primary-dark));
    background-size: 400% 400%;
    animation: rotateGradient 15s ease infinite;
}

/* ===============================
   SHIMMER EFFECTS
=============================== */

.shimmer-effect {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* ===============================
   GLASS MORPHISM
=============================== */

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ===============================
   COUNTER ANIMATIONS
=============================== */

.counter {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.counter.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Statistics Section */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.stat-item {
    text-align: center;
    padding: 2rem 1.25rem;
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.35rem;
}

.stat-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
}

.stat-icon {
    width: 88px;
    height: 88px;
    min-width: 88px;
    min-height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    box-shadow: 0 8px 24px rgba(30, 136, 229, 0.3);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.stat-item:hover .stat-icon {
    transform: scale(1.05);
}

.stat-icon i {
    font-size: 2.25rem;
    color: var(--white);
    line-height: 1;
    display: block;
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.25rem;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-dark);
    font-weight: 500;
    line-height: 1.4;
    max-width: 160px;
}

/* ===============================
   PARTICLES BACKGROUND
=============================== */

.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(30, 136, 229, 0.3);
    border-radius: 50%;
    animation: floatParticle 20s linear infinite;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10vh) translateX(100px);
        opacity: 0;
    }
}

/* ===============================
   LOADING ANIMATIONS
=============================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-overlay .loading-spinner {
    width: 50px;
    height: 50px;
    margin-bottom: 20px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--white);
}

.loading-overlay p {
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 500;
    text-align: center;
}

.loading-spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-dots::after {
    content: '';
    animation: dots 2s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* ===============================
   HOVER EFFECTS ENHANCEMENT
=============================== */

/* Cart Button Hover */
.cart-btn {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cart-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 5px 15px rgba(30, 136, 229, 0.3);
}

/* Footer Enhancement */
.footer {
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    animation: scan 3s linear infinite;
}

@keyframes scan {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===============================
   CART NOTIFICATIONS
=============================== */

.cart-notification {
    position: fixed;
    top: 20px;
    right: -400px;
    background: var(--success-color, #28a745);
    color: var(--white);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    transition: right 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cart-notification.show {
    right: 20px;
}

.cart-notification i {
    font-size: 1.2rem;
}

/* Cart Item Styles */
.cart-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 15px;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-details h4 {
    margin: 0 0 5px 0;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.cart-item-price {
    margin: 0 0 10px 0;
    color: var(--primary-color);
    font-weight: 600;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-controls button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    background: var(--white);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.quantity-controls button:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.quantity-input {
    width: 60px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 5px;
    font-size: 0.9rem;
    background: var(--white);
}

.quantity-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Remove spinner arrows from number input */
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input[type=number] {
    -moz-appearance: textfield;
}

.remove-item {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--danger-color, #dc3545);
    color: var(--white);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-item:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

.empty-cart {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 30px 0;
}

/* ===============================
   RESPONSIVE ANIMATION ADJUSTMENTS
=============================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===============================
   BUSINESS CTA SECTION - SIMPLIFIED
=============================== */

.business-cta {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.business-cta-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.business-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--white);
}

.business-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.business-benefits {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.benefit-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.benefit-icon {
    width: 40px;
    height: 40px;
    background: var(--white);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.benefit-text h4 {
    margin: 0 0 0.3rem 0;
    color: var(--white);
    font-size: 1rem;
}

.benefit-text p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.85rem;
}

.cta-card-simple {
    background: var(--white);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.cta-card-simple h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.3rem;
}

.simple-form input,
.simple-form select,
.simple-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    background: var(--white);
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.simple-form input:focus,
.simple-form select:focus,
.simple-form textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.simple-form textarea {
    resize: vertical;
    min-height: 50px;
    font-family: inherit;
}

.contact-mini {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
}

.contact-mini p {
    margin: 0;
}

.btn-full-width {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1rem;
}

.contact-info-mini {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.contact-info-mini p {
    margin: 0.5rem 0;
    color: var(--text-light);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.contact-info-mini i {
    color: var(--primary-color);
}

.contact-info-mini strong {
    color: var(--text-dark);
}

@media (max-width: 768px) {
    .business-cta-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .business-title {
        font-size: 1.8rem;
    }
    
    .benefit-item {
        flex-direction: column;
        text-align: center;
        gap: 0.8rem;
        padding: 1rem;
    }
    
    .benefit-item:hover {
        transform: translateY(-5px);
    }
    
    .cta-card-simple {
        padding: 1.2rem;
    }
    
    .simple-form input,
    .simple-form select,
    .simple-form textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .contact-info-mini p {
        flex-direction: column;
        gap: 0.2rem;
    }
    
    .card-3d:hover {
        transform: translateY(-10px) scale(1.02);
    }
    
    .service-card:hover {
        transform: translateY(-10px);
    }
    
    .product-card:hover {
        transform: translateY(-10px);
    }
    
    .cart-notification {
        right: -300px;
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .cart-notification.show {
        right: 10px;
    }
}