/* Root variables */
:root {
    --primary: #6f42c1;
    --secondary: #5327a3;
    --dark: #343a40;
    --light: #f8f9fa;
    --wa: #25D366;
    --easing: cubic-bezier(.4,.0,.2,1);
    --emergency-bg: #dc3545;
    --emergency-text: #fff;
}

/* Common utility classes */
.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy.loaded {
    opacity: 1;
}

/* Common animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Botón de emergencias flotante */
.emergency-banner {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    background-color: #dc3545 !important;
    color: white !important;
    border-radius: 50% !important;
    padding: 15px !important;
    z-index: 99999 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    cursor: pointer;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 60px !important;
    height: 60px !important;
    animation: pulse 2s infinite !important;
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
}

.emergency-banner:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 6px 25px rgba(220, 53, 69, 0.5) !important;
}

.emergency-banner.expanded {
    border-radius: 30px !important;
    width: auto !important;
    max-width: 90%;
    padding: 15px 25px !important;
    animation: none !important;
}

.emergency-banner i {
    font-size: 1.8rem !important;
    margin: 0 !important;
    color: white !important;
}

.emergency-banner .emergency-text {
    display: none;
    white-space: nowrap;
    margin-left: 15px !important;
    margin-right: 5px;
    font-weight: 600;
    color: white !important;
    font-size: 1.1rem;
}

.emergency-banner.expanded .emergency-text {
    display: inline-block !important;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

@media (max-width: 768px) {
    .emergency-banner {
        bottom: 20px;
        right: 20px;
        padding: 10px 15px;
        max-width: 45px;
        height: 45px;
    }
    
    .emergency-banner i {
        font-size: 1.3rem;
    }
    
    .emergency-banner.expanded {
        max-width: 250px;
        padding: 10px 15px;
    }
}

/* Base styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--dark);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Floating Buttons */
#scrollToTop, .whatsapp-float, #whatsappBtn {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        cursor: pointer;
        z-index: 1000;
        box-shadow: 0 4px 12px rgba(0,0,0,.25);
        transition: transform .3s var(--easing), box-shadow .3s var(--easing), background-color .3s var(--easing);
        border: none;
        text-decoration: none;
}

#scrollToTop {
    bottom: 90px;
    background: var(--primary);
    display: none;
    font-size: 24px;
}
#scrollToTop:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(111, 66, 193, 0.5);
    background: var(--secondary);
}

.whatsapp-float, #whatsappBtn {
    background: var(--wa);
    font-size: 32px;
}
.whatsapp-float:hover, #whatsappBtn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
    color: #fff;
}

/* Exit demo button */
.demo-exit-float {
        position: fixed;
        left: 24px;
        bottom: 90px; /* above whatsapp */
        background: linear-gradient(135deg,var(--secondary),var(--primary));
        color: #fff;
        font-size: 13px;
        font-weight: 600;
        letter-spacing: .5px;
        text-decoration: none;
        padding: 10px 16px;
        border-radius: 28px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        z-index: 1000;
        box-shadow: 0 6px 16px rgba(0,0,0,.25);
        transition: transform .35s var(--easing), box-shadow .35s var(--easing), background-color .35s var(--easing);
        backdrop-filter: blur(4px);
}
.demo-exit-float i { font-size: 14px; line-height: 1; }
.demo-exit-float:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.35); }

/* Refine icon vertical centering */
#scrollToTop i { 
    line-height: 1; 
    font-size: 20px; 
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

@media (max-width: 640px) {
    .demo-exit-float { bottom: 78px; left: 16px; font-size: 12px; padding: 8px 14px; }
    #scrollToTop i { font-size: 18px; }
}

@media (max-width: 768px) {
    #scrollToTop, .whatsapp-float, #whatsappBtn {
        width: 56px;
        height: 56px;
        right: 16px;
    }
    .whatsapp-float, #whatsappBtn {
        bottom: 16px;
        font-size: 28px;
    }
    #scrollToTop {
        bottom: 82px;
        font-size: 20px;
    }
}

/* Common buttons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--secondary);
    border-color: var(--secondary);
    transform: translateY(-2px);
}

/* Form elements */
.form-control {
    border: 1px solid #dee2e6;
    padding: 0.8rem;
    transition: all 0.3s ease;
    background-color: white;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.15rem rgba(111, 66, 193, 0.1);
}

/* Cards */
.card {
    border-radius: 8px;
    transition: transform 0.3s ease;
    border: 2px solid #d1c4e9;
    box-shadow: 0 8px 16px rgba(111, 66, 193, 0.19);
}

.card:hover {
    transform: translateY(-2.5px);
}

/* Image optimizations */
img {
    max-width: 100%;
    height: auto;
    will-change: auto;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Common spacing utilities */
.section-padding {
    padding: 80px 0;
}

/* Ajustes hero en móviles */
@media (max-width: 576px) {
    .hero-section,
    .hero-contact,
    .hero-pricing,
    .hero-info,
    .hero-fashion,
    .hero-section-demo { /* fallback para plantillas */
        min-height: 55vh !important; /* reducido de 68vh */
        padding-top: 80px !important; /* reducido de 110px */
        padding-bottom: 20px !important; /* reducido de 32px */
        background-attachment: scroll !important; /* evitar jank */
    }
    .hero-section .hero-subtitle,
    .hero-contact h1,
    .hero-pricing h1,
    .hero-info h1 { 
        line-height: 1.1;
        margin-bottom: 1.2rem;
    }
    .hero-description { font-size: 0.95rem !important; }
}

@media (max-width: 400px) {
    .hero-section,
    .hero-contact,
    .hero-pricing,
    .hero-info { min-height: 50vh !important; } /* reducido de 60vh */
}

/* Loading indicators */
.img-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
/* Navbar styles */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1030;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Default dark navbar con fundido */
.navbar.bg-dark {
    background: linear-gradient(180deg, var(--dark) 0%, var(--dark) 70%, rgba(52, 58, 64, 0.95) 85%, rgba(52, 58, 64, 0.8) 95%, rgba(52, 58, 64, 0.4) 100%) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* White navbar override */
.navbar.bg-white {
    background-color: white !important;
}

.navbar-brand img {
    height: 44px;
    width: auto;
}

.navbar-nav .nav-link {
    padding-left: 1.2rem !important;
    padding-right: 1.2rem !important;
}

/* Professional Dropdown Menu Styling */
.dropdown-menu {
    z-index: 1031;
    border: none;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.95) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15),
                0 5px 15px rgba(0, 0, 0, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    padding: 12px 8px;
    margin-top: 8px;
    min-width: 280px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
}

.dropdown-menu.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.dropdown-item {
    padding: 12px 20px;
    margin: 4px 0;
    border-radius: 12px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: transparent;
    border: 1px solid transparent;
    overflow: hidden;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 0 12px 12px 0;
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    z-index: -1;
}

.dropdown-item:hover {
    background: transparent;
    color: white;
    transform: translateX(8px) translateY(-2px);
    box-shadow: 0 8px 25px rgba(111, 66, 193, 0.25);
    border-color: rgba(255, 255, 255, 0.2);
}

.dropdown-item:hover::before {
    transform: scaleY(1);
}

.dropdown-item:hover::after {
    opacity: 1;
}

.dropdown-item:active {
    transform: translateX(6px) translateY(-1px);
}

/* Professional dropdown dividers */
.dropdown-divider {
    height: 1px;
    margin: 8px 12px;
    background: linear-gradient(90deg, transparent, rgba(111, 66, 193, 0.2), transparent);
    border: 0;
    opacity: 1;
}

/* Subtle animation on dropdown open */
.nav-item.dropdown:hover .dropdown-menu {
    animation: dropdownFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdownFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-15px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Enhanced dropdown arrow indicator */
.nav-item.dropdown > .nav-link::after {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item.dropdown:hover > .nav-link::after {
    transform: rotate(180deg);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-collapse {
        max-height: 70vh;
        overflow-y: auto;
    }
}
/* Footer styles */
.social-links a {
    transition: color 0.3s ease;
    text-decoration: none;
}

.social-links a:hover {
    color: var(--secondary) !important;
}

/* Base footer spacing */
footer {
    margin-top: auto;
}

/* Social icons spacing */
.social-links a {
    font-size: 1.5rem;
    margin: 0 0.5rem;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .social-links {
        display: flex;
        justify-content: center;
        margin-top: 1rem;
    }
    
    .social-links a {
        font-size: 1.2rem;
    }
}
