/**
 * Bustacara Custom Styles - Complementarias a Tailwind
 */

/* Font Configuration - Modern & Professional */
html {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

h1, h2, h3, h4, h5, h6,
.font-heading {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
    letter-spacing: -0.5px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Botón WhatsApp Flotante */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 999;
    text-decoration: none;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    background-color: #20BA5B;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.whatsapp-float i {
    font-size: 30px;
    color: white;
}

/* Barra Flotante de Redes Sociales (Lateral) */
.social-float-bar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 998;
    padding-right: 0;
}

.social-float-bar a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50% 0 0 50%;
    color: white;
    text-decoration: none;
    font-size: 20px;
    transition: all 0.3s ease;
    box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.2);
}

.social-float-bar .facebook {
    background-color: #3B5998;
}

.social-float-bar .facebook:hover {
    background-color: #2D4373;
    padding-right: 10px;
}

.social-float-bar .email {
    background-color: #F5A623;
}

.social-float-bar .email:hover {
    background-color: #e89500;
    padding-right: 10px;
}

.social-float-bar .whatsapp {
    background-color: #25D366;
}

.social-float-bar .whatsapp:hover {
    background-color: #20BA5B;
    padding-right: 10px;
}

/* Ocultar en mobile si es muy intrusivo */
@media (max-width: 768px) {
    .social-float-bar {
        display: none; /* Ocultar barra lateral en mobile */
    }

    .whatsapp-float {
        bottom: 80px; /* Subir más arriba en mobile */
    }
}

/* Hero Section - Dynamic with Background Image */
.hero {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-dynamic {
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(21, 101, 192, 0.6);
    z-index: 2;
}

.hero h1 {
    font-size: 3.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .hero {
        min-height: 400px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }
}

/* ==================== SCROLL ANIMATIONS ==================== */

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Elementos a animar - Estado inicial (esperando .animate-in) */
.scroll-animate {
    opacity: 0;
}

/* Regla genérica: todos los elementos con scroll-animate que reciben animate-in */
.scroll-animate.animate-in {
    opacity: 1 !important;
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Service Cards - Fade in from bottom (SOLO cuando entra en viewport) */
.service-card.scroll-animate.animate-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

.service-card.scroll-animate.animate-in:nth-child(1) { animation-delay: 0.1s; }
.service-card.scroll-animate.animate-in:nth-child(2) { animation-delay: 0.2s; }
.service-card.scroll-animate.animate-in:nth-child(3) { animation-delay: 0.3s; }

/* Property Cards - Zoom in (SOLO cuando entra en viewport) */
.property-card.scroll-animate.animate-in {
    animation: zoomIn 0.5s ease-out forwards;
}

.property-card.scroll-animate.animate-in:nth-child(1) { animation-delay: 0.1s; }
.property-card.scroll-animate.animate-in:nth-child(2) { animation-delay: 0.2s; }
.property-card.scroll-animate.animate-in:nth-child(3) { animation-delay: 0.3s; }

/* Headings - Fade in from left (SOLO cuando entra en viewport) */
section h2.scroll-animate.animate-in,
section h3.scroll-animate.animate-in {
    animation: fadeInLeft 0.6s ease-out forwards;
}

/* About Section - Slide from left (SOLO cuando entra en viewport) */
.about.scroll-animate.animate-in {
    animation: fadeInLeft 0.8s ease-out forwards;
}

/* Hero - Fade in (SOLO cuando entra en viewport) */
.hero.scroll-animate.animate-in {
    animation: fadeInDown 0.8s ease-out forwards;
}

/* Legacy animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-slide-in {
    animation: slideIn 0.6s ease-out;
}

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

.animate-scale-up {
    animation: scaleUp 0.6s ease-out;
}

/* Animaciones se activan automáticamente con .animate-in */

/* Service Cards */
.service-card {
    overflow: hidden;
    border-radius: 8px;
}

.service-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
}

.service-card h3 {
    font-size: 1.5rem;
}

/* Tarjetas de Propiedades */
.property-card {
    transition: all 0.3s ease;
    border-radius: 8px;
}

.property-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
}

.cta-bg-pattern {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.05) 10px,
        rgba(255, 255, 255, 0.05) 20px
    );
}

/* Botones */
button, .btn {
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 12px 28px;
    border-radius: 6px;
    text-decoration: none;
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.1rem;
}

.btn-primary {
    background-color: #1565C0;
    color: white;
}

.btn-primary:hover {
    background-color: #0D47A1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.3);
}

.btn-accent {
    background-color: #F5A623;
    color: white;
}

.btn-accent:hover {
    background-color: #e89500;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.3);
}

.btn-white {
    background-color: white;
    color: #1565C0;
    border: 2px solid white;
}

.btn-white:hover {
    background-color: transparent;
    color: white;
    transform: translateY(-2px);
}

/* Header Sticky with Shrink Effect - Modern Design */
#masthead {
    transition: all 0.3s ease;
    padding: 0;
    background: white;
}

#masthead.shadow-lg {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Navbar Modern Style */
#site-navigation {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1.2rem 0;
    background: linear-gradient(to bottom, #FFFFFF 0%, #F8F9FA 100%);
    border-bottom: 4px solid #1565C0;
    position: relative;
}

#site-navigation::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, rgba(21, 101, 192, 0.1), rgba(21, 101, 192, 0.3), rgba(21, 101, 192, 0.1));
}

#site-navigation.navbar-compact {
    padding: 0.4rem 0;
}

#site-navigation.navbar-ultra-compact {
    padding: 0.15rem 0 !important;
}

/* Reduce container padding when navbar is compact */
#site-navigation.navbar-ultra-compact .container {
    padding-top: 0.2rem !important;
    padding-bottom: 0.2rem !important;
    gap: 0.5rem !important;
}

/* Top Bar Compact */
.site-header > div:first-child.topbar-compact {
    padding: 0.15rem 0 !important;
    font-size: 0.65rem !important;
    display: none;
}

/* Logo Transition */
.site-branding img {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left center;
}

/* Navigation Links - Modern Hover */
.nav-link {
    position: relative;
    color: #1565C0 !important;
    font-weight: 600 !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #F5A623;
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-link:hover {
    color: #F5A623 !important;
    background-color: rgba(245, 166, 35, 0.05);
}

.nav-link:hover::after {
    width: 24px;
}

/* Primary Menu List */
#primary-menu {
    display: flex;
    gap: 0.5rem;
}

#primary-menu li {
    list-style: none;
}

/* Top Bar Transition */
.site-header > div:first-child {
    transition: padding 0.3s ease, font-size 0.3s ease;
}

/* Menú Mobile Toggle */
#mobile-menu-toggle {
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-size: 24px;
}

/* Utility Classes */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.prose {
    line-height: 1.8;
}

/* Links */
a {
    color: #1565C0;
}

a:hover {
    color: #0D47A1;
}

/* Accesibilidad */
.skip-link:focus {
    top: 0;
    left: 0;
    z-index: 10000;
}

/* ==================== DROPDOWN MENU STYLES ==================== */

/* Submenú desplegable - Oculto por defecto */
.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    flex-direction: column;
    gap: 0;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    z-index: 999;
    padding: 8px 0;
    list-style: none;
}

/* Mostrar submenú al hacer hover en el item padre */
.menu-item-has-children:hover > .sub-menu,
.menu-item-has-children:focus-within > .sub-menu {
    display: flex;
}

/* Items del submenú */
.sub-menu li {
    list-style: none;
}

.sub-menu a {
    display: block;
    padding: 10px 20px;
    color: #1565C0;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.sub-menu a:hover {
    background-color: rgba(245, 166, 35, 0.1);
    color: #F5A623;
    padding-left: 25px;
}

/* Item padre con submenu - Posición relativa */
.menu-item-has-children {
    position: relative;
}

/* Indicador visual de que tiene submenu (opcional) */
.menu-item-has-children > a::after {
    content: ' ▼';
    font-size: 0.65rem;
    margin-left: 4px;
    opacity: 0.7;
}
