/* Estilos personalizados para CMS Webs Profesionales */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gradient-primary: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    --gradient-secondary: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --border-radius: 0.5rem;
    --transition: all 0.3s ease;
}

/* Tipografía */
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 1.15rem !important; /* Aumentado */
    font-weight: 400 !important;    /* Evitar fuentes finas */
    line-height: 1.6;
    color: #212529;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-weight: 700 !important;
    color: #000;
}

h1, .h1 {
    font-size: 2.5rem !important;
}

.lead {
    font-weight: 400 !important;
}

/* Utilidades */
.bg-gradient-primary {
    background: var(--gradient-primary) !important;
}

.bg-gradient-hero {
    background-color: #1e3c72 !important;
    background: linear-gradient(135deg, #171818 0%, #2a5298 100%) !important;
}

.text-hero-highlight {
    color: #4fc3f7 !important; /* Light Blue */
}

.hero-text-shadow {
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.bg-gradient-secondary {
    background: var(--gradient-secondary) !important;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-hover {
    transition: var(--transition);
}

.shadow-hover:hover {
    box-shadow: var(--shadow-lg) !important;
    transform: translateY(-5px);
}

.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

/* Navegación */
.navbar {
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-size: 1.5rem !important;
    font-weight: 700;
}

.nav-link {
    font-weight: 600 !important;
    transition: var(--transition);
    font-size: 1.2rem !important;
    color: rgba(255, 255, 255, 0.95) !important;
}

.nav-link:hover {
    color: var(--warning-color) !important;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    padding-top: 85px !important; /* Reduced to move content up */
    contain: layout; /* CLS Optimization */
}

.hero-section h1, 
.hero-section h2, 
.hero-section p, 
.hero-section .lead {
    color: #fff !important;
}

@media (max-width: 768px) {
    .hero-section {
        padding-top: 220px !important; /* Increased padding for mobile */
    }
    
    /* Force content to start lower instead of centering, to avoid overlap */
    .hero-section .row {
        align-items: flex-start !important; 
        padding-top: 20px;
    }
    
    .hero-section h1 {
        margin-top: 10px;
    }

    h1, .h1 {
        font-size: 2rem !important;
    }
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="a" cx=".5" cy=".5" r=".5"><stop offset="0%" stop-color="%23ffffff" stop-opacity=".1"/><stop offset="100%" stop-color="%23ffffff" stop-opacity="0"/></radialGradient></defs><circle cx="200" cy="200" r="100" fill="url(%23a)"/><circle cx="800" cy="300" r="150" fill="url(%23a)"/><circle cx="400" cy="700" r="120" fill="url(%23a)"/></svg>') no-repeat center center;
    background-size: cover;
    opacity: 0.1;
}

.hero-image {
    position: relative;
    z-index: 2;
}

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

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

.animate-fade-in {
    animation: fadeInUp 0.8s ease-out;
}

.animate-fade-in-delay {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.animate-fade-in-delay-2 {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
    animation-delay: 1s; /* CLS Optimization: Wait for paint */
    will-change: transform;
}

/* Ajustes del botón "¿Te gusta la idea?" */
#cta-contact-chat {
    display: inline-flex;
    align-items: center;
    justify-content: center; /* centrar el texto horizontalmente */
    text-align: center;      /* asegurar centrado del contenido */
    margin-top: 1.5rem; /* un poco más abajo */
    min-width: 280px;    /* más ancho */
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

@media (max-width: 576px) {
    #cta-contact-chat {
        min-width: 100%; /* en móvil ocupa todo el ancho */
    }
    .cta-wrap { display: block; width: 100%; }
    #btn-miweb { width: 100%; display: block; }
}

/* Botón principal más ancho */
#btn-miweb {
    min-width: 320px;
}

/* Contenedor CTA (para otros usos) */
.cta-wrap { position: relative; display: inline-block; }

/* Botón WhatsApp fijo centro-derecha de la ventana */
.btn-whatsapp-fixed {
    position: fixed;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #128C48 0%, #0E7F39 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(18,140,72,.45);
    border: none;
    z-index: 1000;
    animation: whatsappFixedPulse 1.8s ease-in-out infinite;
}
.btn-whatsapp-fixed i { font-size: 1.7rem; }
.btn-whatsapp-fixed i { font-size: 2.1rem; }
.btn-whatsapp-fixed:hover {
    transform: translateY(-52%);
    box-shadow: 0 16px 34px rgba(18,140,72,.55);
}
@keyframes whatsappFixedPulse {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.08); }
    100% { transform: translateY(-50%) scale(1); }
}

@media (max-width: 768px) {
    .btn-whatsapp-fixed {
        top: auto; bottom: 64px; right: 16px;
        transform: none;
        width: 54px; height: 54px;
    }
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.feature-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.05);
}

.feature-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.feature-icon {
    transition: var(--transition);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

.feature-card h5,
.feature-card p {
    overflow-wrap: anywhere;
}

/* CLS Optimization: Fix Icon Spacing */
.btn i, .btn .fas, .btn .fab { 
    display: inline-block; 
    width: 1.25em; 
    text-align: center; 
}

@media (max-width: 991.98px) {
    .feature-card {
        padding: 1.5rem;
    }
    .feature-card h5 {
        font-size: 1.05rem;
    }
    .feature-card p {
        font-size: 0.9rem;
    }
}

/* Template Cards */
.template-card {
    overflow: hidden;
    transition: var(--transition);
}

.template-preview {
    position: relative;
    overflow: hidden;
}

.template-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.template-card:hover .template-overlay {
    opacity: 1;
}

.template-card img {
    transition: var(--transition);
}

.template-card:hover img {
    transform: scale(1.05);
}

/* Profession Cards */
.profession-card {
    transition: var(--transition);
}

.profession-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

/* Estilos de Botón WhatsApp Pulse (Movidos desde index.php para uso global) */
.text-whatsapp {
    color: #25D366 !important;
}

@keyframes pulse-white {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.btn-cta-pulse {
    animation: pulse-white 2s infinite;
}

.btn-cta-pulse:hover {
    animation: none;
    transform: scale(1.1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    color: #007bff !important; /* Azul primario */
}

/* Mobile Sticky Bar */
.mobile-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    display: flex;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.mobile-sticky-bar a {
    flex: 1;
    padding: 15px;
    text-align: center;
    color: white;
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.1rem;
    transition: background-color 0.3s;
    border: none;
}

.mobile-sticky-bar .btn-sms {
    background-color: #0d6efd; /* Azul Bootstrap */
}
.mobile-sticky-bar .btn-sms:hover {
    background-color: #0b5ed7;
}

.mobile-sticky-bar .btn-wa {
    background-color: #25d366; /* Verde WhatsApp */
}
.mobile-sticky-bar .btn-wa:hover {
    background-color: #20bd5a;
}

/* Ocultar botón flotante existente en móvil cuando la barra está visible */
@media (max-width: 767.98px) {
    .btn-whatsapp-fixed,
    .whatsapp-btn,
    .whatsapp-float,
    .floating-whatsapp,
    #chat-launcher,
    #chat-panel,
    #floating-contact-banner,
    .floating-contact-banner {
        display: none !important;
    }
    /* Ajustar margen inferior del body para que no tape contenido */
    body {
        padding-bottom: 60px;
    }

    /* Make carousel taller on mobile */
    #bestDesignsCarousel .ratio-16x9 {
        --bs-aspect-ratio: 125%; /* Taller aspect ratio for mobile */
    }
}

