/* ============================================
   RESET Y VARIABLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #20B2AA;
    --secondary-color: #16A085;
    --accent-color: #7FDBDA;
    --text-dark: #2d3748;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    /* Fondo principal (usar en body y hero) */
    --hero-bg: linear-gradient(135deg, #e0f7f5 0%, #b2f5ea 100%);
    /* Fondo del footer (verde oscuro) */
    --footer-bg: #0f513f;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    /* aplicar fondo global igual que la hero */
    background: var(--hero-bg);
}

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

/* ============================================
   NAVEGACIÓN
   ============================================ */

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: var(--transition);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0;
    margin-left: -40px;
}

.logo-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.3);
    transition: var(--transition);
}

.logo-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(74, 144, 226, 0.4);
}

.logo h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.logo span {
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.language-switch {
    margin-left: auto;
}

.language-switch .nav-link {
    color: #4a90e2;
    font-weight: 700;
}

.language-switch .nav-link:hover {
    color: #2e5c8a;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1.1rem;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    transition: var(--transition);
    border-radius: 3px;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 120px 20px 80px;
    background: var(--hero-bg);
    gap: 4rem;
}

.hero-content {
    flex: 1;
    max-width: 600px;
    animation: fadeInLeft 1s ease;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.highlight {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image {
    flex: 1;
    max-width: 700px;
    animation: fadeInRight 1s ease;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: var(--shadow);
    object-fit: cover;
}

/* ============================================
   BOTONES
   ============================================ */

.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(32, 178, 170, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(32, 178, 170, 0.5);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-3px);
}

/* ============================================
   SECCIONES GENERALES
   ============================================ */

section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

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

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

/* ============================================
   SERVICIOS
   ============================================ */

.services {
    background: var(--white);
}

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

.service-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
}

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

.service-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

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

.service-card p {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 1.1rem;
}

/* ============================================
   PORTFOLIO
   ============================================ */

.portfolio {
    background: var(--bg-light);
}

/* ============================================
   CARRUSEL DE PORTFOLIO
   ============================================ */

.carousel-container {
    position: relative;
    margin-top: 40px;
}

.carousel-main {
    position: relative;
    margin-bottom: 30px;
}

.carousel-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: var(--shadow);
    background: var(--white);
    max-width: 900px;
    margin: 0 auto;
    aspect-ratio: 16 / 10;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}

.carousel-item {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 12px 16px;
    font-size: 20px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s ease;
    z-index: 10;
}

.carousel-button:hover {
    background: rgba(0, 0, 0, 0.7);
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

/* Miniaturas */
.carousel-thumbnails {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.thumbnail-item {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color 0.3s ease, transform 0.3s ease;
    flex-shrink: 0;
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumbnail-item:hover {
    transform: scale(1.05);
}

.thumbnail-item.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--primary-color);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    z-index: 5;
}

.carousel-btn:hover {
    background: var(--white);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.carousel-btn-prev {
    left: 20px;
}

.carousel-btn-next {
    right: 20px;
}

.carousel-btn svg {
    width: 24px;
    height: 24px;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(32, 178, 170, 0.3);
    cursor: pointer;
    transition: var(--transition);
}

.indicator.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

.indicator:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

/* ============================================
   SOBRE NOSOTROS
   ============================================ */

.about {
    background: var(--white);
}

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

.about-text {
    animation: fadeInLeft 1s ease;
}

.about-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.about-stats {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
}

.stat-item h3 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-item p {
    color: var(--text-light);
    font-weight: 500;
}

.about-image {
    animation: fadeInRight 1s ease;
}

.about-image img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: var(--shadow);
    object-fit: cover;
}

/* ============================================
   CONTACTO
   ============================================ */

.contact {
    background: var(--bg-light);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    padding: 2rem;
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.contact-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.contact-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-item h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.contact-item p {
    color: var(--text-light);
}

.contact-form {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(32, 178, 170, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    /* Restablecer fondo oscuro para garantizar contraste */
    background: var(--footer-bg);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

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

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

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

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
}

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

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

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

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

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

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

.social-links a:hover {
    transform: translateY(-5px);
    color: var(--white);
    background: rgba(255, 255, 255, 0.2);
}

.social-links a svg {
    width: 20px;
    height: 20px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   ANIMACIONES
   ============================================ */

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

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

/* Estilos adicionales para carrusel en dispositivos pequeños */
@media (max-width: 768px) {
    .carousel-button {
        padding: 10px 12px;
        font-size: 16px;
    }

    .carousel-prev {
        left: 10px;
    }

    .carousel-next {
        right: 10px;
    }

    .carousel-thumbnails {
        gap: 8px;
        padding: 0 10px;
    }

    .thumbnail-item {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .carousel-wrapper {
        border-radius: 12px;
    }

    .carousel-button {
        padding: 8px 10px;
        font-size: 14px;
    }

    .carousel-thumbnails {
        gap: 6px;
        padding: 0 5px;
    }

    .thumbnail-item {
        width: 50px;
        height: 50px;
        border-radius: 6px;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 968px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--white);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        box-shadow: var(--shadow);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding: 100px 20px 60px;
    }

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

    .hero-image {
        max-width: 100%;
    }

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

    .about-stats {
        justify-content: center;
    }

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

    /* en móvil limitar altura sin forzar escala */
    .carousel-slide img {
        max-height: 400px;
        height: auto;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
    }
    
    .carousel-btn-prev {
        left: 10px;
    }
    
    .carousel-btn-next {
        right: 10px;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }

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

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

    .about-stats {
        flex-direction: column;
        gap: 2rem;
    }

    .hero-buttons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }

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

    .btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }

    .contact-form {
        padding: 1.5rem;
    }
}

/* ============================================
   BOTÓN FLOTANTE DE WHATSAPP
   ============================================ */

.whatsapp-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    color: white;
    text-decoration: none;
    animation: pulse 2s infinite;
}

.whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
    background: #20BA5A;
}

.whatsapp-button svg {
    width: 32px;
    height: 32px;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(37, 211, 102, 0.6);
    }
    100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
}

@media (max-width: 768px) {
    .whatsapp-button {
        width: 55px;
        height: 55px;
        bottom: 20px;
        right: 20px;
    }
    
    .whatsapp-button svg {
        width: 28px;
        height: 28px;
    }
}

/* ============================================
   ESTILOS ADICIONALES
   ============================================ */

/* Placeholder para portfolio vacío */
.portfolio-empty {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    max-width: 900px;
    margin: 0 auto;
    color: var(--muted);
}
.portfolio-empty p { margin: 0.5rem 0; }

/* Asegurar que las secciones no tengan fondo sólido que oculte el fondo global */
section,
.section-header,
.container {
    background: transparent;
}

/* Forzar que las secciones muestren el fondo global */
section, .services, .portfolio, .about, .contact {
    background: transparent;
}

/* Restablecer fondo oscuro para garantizar contraste en el footer */
.footer {
    background: var(--footer-bg);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

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