/* ============================================
   PISCINAS GUADIANA - ESTILOS PRINCIPALES
   ============================================ */

/* Variables CSS */
:root {
    --primary: #8FD5FF;
    --secondary: #004499;
    --accent: #00a8e8;
    --dark: #003459;
    --light: #f0f9ff;
    --text-primary: #1a1a1a;
    --text-secondary: #4a5568;
    --white: #ffffff;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.08);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.12);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-lg: 15px;
    --radius-xl: 20px;
}

/* Body padding para compensar header fijo */
body {
    padding-top: 80px;
}

/* ============================================
   HEADER & NAVIGATION - ACTUALIZADO
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
    padding: 1rem 0;
    max-height: 80px; /* AÑADIDO - Limitar altura máxima */
}

/* Cuando se oculta el header */
.header.hide {
    transform: translateY(-100%);
}

/* Cuando se hace scroll */
.header.scrolled {
    padding: 0.75rem 0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

/* AÑADIDO - Container del navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    min-height: 60px;
    max-height: 60px;
}

.navbar-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Logo con transición suave */
.navbar-brand .logo img {
    height: 60px;
    width: auto;
    transition: height 0.3s ease;
}

.header.scrolled .logo img {
    height: 50px;
}

/* AÑADIDO - Menu desktop */
.navbar-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.navbar-menu a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 5px 0;
    transition: color 0.3s;
}

.navbar-menu a:hover {
    color: var(--primary);
}

.navbar-cta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.btn-phone:hover {
    color: var(--primary);
}

/* Hamburger menu animation */
.navbar-toggler {
    display: none;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.navbar-toggler span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--dark);
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.navbar-toggler.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.navbar-toggler.active span:nth-child(2) {
    opacity: 0;
}

.navbar-toggler.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: linear-gradient(135deg, #87CEEB 0%, #5BA0E6 100%);
    color: white;
    padding: 80px 0;
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    padding: 12px 25px;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: var(--dark);
}

.btn-primary:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-outline:hover {
    background: white;
    color: var(--dark);
}

.btn-lg {
    padding: 15px 35px;
    font-size: 1.1rem;
}

.hero-features {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.hero-features .feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
}

.hero-features .feature i {
    color: var(--accent);
    font-size: 1.2rem;
}

.hero-image {
    position: relative;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   SERVICES SECTION
   ============================================ */
.services {
    padding: 80px 0;
    background: var(--light);
}

.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    text-align: center;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-icon i {
    font-size: 2rem;
    color: var(--primary);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.service-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.service-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: gap 0.3s;
}

.service-link:hover {
    gap: 10px;
}

/* ============================================
   STATS SECTION
   ============================================ */
.stats {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    position: relative;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    text-align: center;
}

.stat {
    position: relative;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    font-family: 'Inter', sans-serif;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta {
    padding: 100px 0;
    background: linear-gradient(135deg, var(--dark) 0%, #00171f 100%);
    text-align: center;
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
}

.cta-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1.5rem;
}

.cta-subtitle {
    font-size: 1.25rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 2.5rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-white {
    background: white;
    color: var(--dark);
}

.btn-white:hover {
    background: var(--light);
}

.btn-outline-white {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-outline-white:hover {
    background: white;
    color: var(--dark);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--dark);
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1.5rem;
    color: white;
}

.footer-section p {
    color: rgba(255,255,255,0.8);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section ul li a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: var(--primary);
}

.contact-info li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.contact-info i {
    color: var(--primary);
    width: 20px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary);
}

/* ============================================
   WHATSAPP BUTTON
   ============================================ */
.whatsapp-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    z-index: 999;
    transition: all 0.3s;
    opacity: 0;
    transform: scale(0);
}

.whatsapp-btn.show {
    opacity: 1;
    transform: scale(1);
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 25px rgba(37, 211, 102, 0.5);
}

/* Pulso animado para WhatsApp */
.whatsapp-btn::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #25d366;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 100%;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--danger);
}

.contact-form {
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(143, 213, 255, 0.1);
}

.btn-block {
    width: 100%;
}

/* ============================================
   NOTIFICATIONS
   ============================================ */
.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    min-width: 300px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid var(--success);
}

.notification-error {
    border-left: 4px solid var(--danger);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.6s ease;
}

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

/* ============================================
   RESPONSIVE - CORREGIDO
   ============================================ */
@media (max-width: 1024px) {
    .hero .container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    .header {
        padding: 0.75rem 0;
        max-height: 70px; /* AÑADIDO */
    }

    .header.scrolled {
        padding: 0.5rem 0;
    }
    
    /* AÑADIDO - Ajuste del navbar en móvil */
    .navbar {
        min-height: 50px;
        max-height: 50px;
        padding: 0.5rem 0;
    }

    .navbar-brand .logo img {
        height: 45px;
    }

    .header.scrolled .logo img {
        height: 40px;
    }

    .navbar-toggler {
        display: block;
    }
    
    /* CORREGIDO - Menu móvil */
    .navbar-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: var(--shadow-md);
        padding: 1rem;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }

    .navbar-menu.active {
        display: block;
        max-height: calc(100vh - 70px); /* CORREGIDO - Limitar altura */
        overflow-y: auto; /* AÑADIDO - Scroll si es necesario */
        padding: 1rem;
    }

    .navbar-menu li {
        list-style: none;
        padding: 0.5rem 0;
    }

    .navbar-menu a {
        color: var(--dark);
        text-decoration: none;
        display: block;
        padding: 0.5rem;
        transition: background 0.3s;
    }

    .navbar-menu a:hover {
        background: var(--light);
        border-radius: var(--radius);
    }
    
    /* AÑADIDO - Evitar que el contenido se oculte */
    body.menu-open {
        overflow: visible; /* Permitir scroll en el body */
    }

    .section-title {
        font-size: 2rem;
    }

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

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .cta-buttons .btn {
        width: 100%;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .whatsapp-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 20px;
        right: 20px;
    }

    .navbar-cta {
        display: none !important; /* Ocultar en móvil */
    }

    .mobile-cta-divider {
        width: 100%;
        height: 1px;
        background: #eee;
        margin: 15px 0;
        list-style: none;
    }
    
    .mobile-cta {
        width: 100%;
        padding: 10px 0;
        list-style: none;
    }
    
    .btn-phone-mobile {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
        padding: 12px;
        background: #f8f9fa;
        border-radius: 8px;
        color: #003459;
        text-decoration: none;
        font-weight: 600;
        width: 100%;
    }
    
    /* Ocultar items CTA en desktop */
    .mobile-cta,
    .mobile-cta-divider {
        display: none;
    }
    
    .navbar-menu.active .mobile-cta,
    .navbar-menu.active .mobile-cta-divider {
        display: block;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 60px;
    }
    
    .header {
        max-height: 60px;
    }

    .hero-title {
        font-size: 1.75rem;
    }

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

    .stat-number {
        font-size: 2rem;
    }

    .cta-title {
        font-size: 1.75rem;
    }

    .navbar-brand .logo img {
        height: 40px;
    }

    .header.scrolled .logo img {
        height: 35px;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

/* Eliminar espacios no deseados */
#navbar-container {
    margin: 0;
    padding: 0;
}

#footer-container {
    margin: 0;
    padding: 0;
}

/* Asegurar que no hay margin en el último elemento */
body > *:last-child {
    margin-bottom: 0;
}