/* =========================================
   VARIABLES & CONFIGURACIÓN GLOBAL
   ========================================= */
:root {
    --primary-color: #0b132b;    
    --secondary-color: #1c2541;  
    --accent-gold: #f59e0b;      
    --accent-blue: #2563eb;      
    --accent-hover: #1d4ed8;
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --whatsapp: #25D366;
    --whatsapp-dark: #128C7E;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   ENCABEZADO Y NAVEGACIÓN
   ========================================= */
.navbar {
    background-color: var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 85px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.logo i {
    color: var(--accent-gold);
    margin-right: 6px;
}

.logo span {
    color: var(--accent-gold);
    font-weight: 400;
}

.menu {
    display: flex;
    align-items: center;
    gap: 25px;
}

.menu a {
    text-decoration: none;
    color: #cbd5e1;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.menu a:hover {
    color: var(--accent-gold);
}

.btn-nav {
    background-color: var(--accent-blue);
    color: var(--white) !important;
    padding: 10px 22px;
    border-radius: 30px;
    font-weight: 600 !important;
}

.btn-nav:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

/* =========================================
   SECCIÓN HERO DINÁMICA
   ========================================= */
.hero {
    position: relative;
    min-height: 85vh;
    background: url('https://encrypted-tbn2.gstatic.com/licensed-image?q=tbn:ANd9GcQa4G4Uuz_zxfnhGnKUR6hprO5etfXTn2NOk0W5hyQOSf_2jF9RofamN7GiAPpjJ2v52fTFnxr5GsKjTxg') center/cover no-repeat;
    display: flex;
    align-items: center;
    color: var(--white);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(11, 19, 43, 0.92) 0%, rgba(28, 37, 65, 0.85) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 850px;
    padding-top: 40px;
    padding-bottom: 40px;
}

.badge {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 20px;
}

.hero-content h1 {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-content h1 span {
    color: var(--accent-gold);
    background: linear-gradient(120deg, #f59e0b, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.15rem;
    color: #e2e8f0;
    margin-bottom: 35px;
    font-weight: 300;
}

.hero-btns {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--accent-gold);
    color: var(--primary-color);
    padding: 15px 32px;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
    background-color: #d97706;
    color: var(--white);
    transform: translateY(-3px);
}

.btn-whatsapp-hero {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--whatsapp);
    color: var(--white);
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp-hero:hover {
    background-color: var(--whatsapp-dark);
    transform: translateY(-3px);
}

/* =========================================
   ESTRUCTURA DE SECCIONES DE SERVICIOS
   ========================================= */
.section-header {
    text-align: center;
    max-width: 750px;
    margin: 0 auto 50px;
}

.section-header h2 {
    font-size: 2.3rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 12px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.featured-section {
    padding: 90px 0 60px;
    background: #ffffff;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 35px;
}

.services-section {
    padding: 80px 0 100px;
    background-color: var(--bg-light);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

/* =========================================
   EFECTO DE TARJETAS FLIP (GIRO 3D)
   ========================================= */

/* Contenedor principal de la tarjeta: aporta perspectiva */
.card {
    background-color: transparent;
    perspective: 1500px;
    height: 480px; /* Altura fija necesaria para el flip */
}

/* Contenedor interno: maneja la rotación */
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: left;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

/* Activa el giro de 180 grados en Y al hacer hover */
.card:hover .card-inner {
    transform: rotateY(180deg);
}

/* Configuración común para el frente y la parte de atrás */
.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; 
    backface-visibility: hidden;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* -- CARA FRONTAL -- */
.card-front {
    background: var(--card-bg);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    flex-direction: column;
}

.card-img {
    position: relative;
    height: 220px;
    width: 100%;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-icon {
    font-size: 2rem;
    color: var(--accent-blue);
    margin-bottom: 15px;
}

.card-front h3 {
    font-size: 1.35rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 12px;
}

.card-front p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Estilos especiales para servicios destacados (Frente) */
.card-featured {
    border: 2px solid rgba(245, 158, 11, 0.3);
    background: linear-gradient(180deg, #ffffff 0%, #fffdfa 100%);
}

.tag-featured {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--accent-gold);
    color: var(--primary-color);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.icon-badge {
    width: 50px;
    height: 50px;
    background-color: var(--accent-gold);
    color: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 18px;
}

/* -- CARA TRASERA (GIRO 180°) -- */
.card-back {
    background-color: var(--primary-color);
    color: var(--white);
    transform: rotateY(180deg); /* Ya está volteada */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 30px;
    border: 2px solid var(--accent-gold);
}

.back-icon {
    font-size: 4rem;
    color: var(--accent-gold);
    margin-bottom: 20px;
}

.card-back h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--white);
}

.card-back p {
    font-size: 1rem;
    color: #cbd5e1;
    margin-bottom: 30px;
    line-height: 1.6;
}

.btn-card-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--whatsapp);
    color: var(--white);
    padding: 14px 25px;
    width: 100%;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    transition: var(--transition);
}

.btn-card-whatsapp:hover {
    background-color: var(--whatsapp-dark);
    transform: translateY(-3px) scale(1.02);
}

/* =========================================
   SECCIÓN DE COMENTARIOS Y SUGERENCIAS
   ========================================= */
.comments-section {
    padding: 90px 0;
    background-color: var(--secondary-color);
    color: var(--white);
    position: relative;
}

/* Decoración de fondo simple CSS */
.comments-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(circle at right top, rgba(245, 158, 11, 0.05), transparent 40%);
    pointer-events: none;
}

.comments-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.comments-info h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--accent-gold);
}

.comments-info p {
    font-size: 1.1rem;
    color: #e2e8f0;
    margin-bottom: 30px;
    line-height: 1.7;
}

.comments-benefits {
    list-style: none;
}

.comments-benefits li {
    font-size: 1.05rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.comments-benefits i {
    color: var(--whatsapp);
    font-size: 1.2rem;
}

/* Formulario */
.comments-form-container {
    background-color: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    color: var(--text-dark);
    background-color: var(--bg-light);
    transition: var(--transition);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background-color: var(--white);
}

.btn-submit {
    width: 100%;
    margin-top: 10px;
    padding: 16px;
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
}

/* =========================================
   PIE DE PÁGINA (FOOTER)
   ========================================= */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 70px 0 30px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
}

.footer-info h3 {
    font-size: 1.4rem;
    color: var(--accent-gold);
    margin-bottom: 12px;
}

.footer-info p {
    color: #94a3b8;
    margin-bottom: 6px;
}

.footer-info a {
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.footer-info a:hover {
    color: var(--accent-gold);
}

.footer-cta h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.footer-divider {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 30px 0;
}

.footer-phrase {
    font-size: 1.3rem;
    font-weight: 300;
    font-style: italic;
    text-align: center;
    max-width: 900px;
    margin: 0 auto 30px;
    color: #e2e8f0;
    line-height: 1.6;
}

.copyright {
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
}

/* =========================================
   BOTÓN FLOTANTE WHATSAPP
   ========================================= */
.whatsapp-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background-color: var(--whatsapp);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.3rem;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    text-decoration: none;
    z-index: 9999;
    transition: var(--transition);
    animation: pulse 2.5s infinite;
}

.whatsapp-btn:hover {
    background-color: var(--whatsapp-dark);
    transform: scale(1.12);
    animation: none;
}

.tooltip {
    position: absolute;
    right: 80px;
    background-color: var(--white);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    transform: translateX(15px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    white-space: nowrap;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -6px;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-style: solid;
    border-color: transparent transparent transparent var(--white);
}

.whatsapp-btn:hover .tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* ANIMACIONES */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
    70% { box-shadow: 0 0 0 18px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* RESPONSIVE DESIGN */
@media (max-width: 992px) {
    .comments-wrapper {
        grid-template-columns: 1fr;
    }
    
    .comments-info {
        text-align: center;
    }

    .comments-benefits li {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .nav-content {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
    }

    .menu {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .featured-grid, .services-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        height: 520px; /* Un poco más alto para móviles por el texto */
    }

    .comments-form-container {
        padding: 25px;
    }

    .footer-top {
        flex-direction: column;
        text-align: center;
    }

    .footer-phrase {
        font-size: 1.1rem;
    }
}