/* ========== SCROLL SUAVE ========== */
html { scroll-behavior: smooth; }

/* ========== SCROLLBAR PERSONALIZADA ========== */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--primary-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}
html {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) var(--primary-dark);
}

/* ========== RESET & VARIABLES ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary-dark: #0b2342;
    --primary-light: #59b7e4;
    --accent-blue: #8cd1f0;
    --bg-gray: #f8f9fa;
    --text-dark: #1a1a1a;
    --text-white: #ffffff;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}
body { font-family: var(--font-body); color: var(--text-dark); line-height: 1.6; overflow-x: hidden; background: white; }
section { position: relative; z-index: 1; width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 4%; }

.btn { display: inline-block; padding: 12px 30px; border-radius: 50px; font-weight: 700; text-transform: uppercase; font-size: 0.9rem; cursor: pointer; transition: all 0.3s ease; border: none; text-align: center; }
.btn-light { background: var(--primary-light); color: white; }
.btn-light:hover { background: #4aa3d1; transform: translateY(-2px); }
.btn-outline-white { background: transparent; border: 2px solid white; color: white; }
.btn-outline-white:hover { background: white; color: var(--primary-dark); }

/* ========== BOTÓN FLOTANTE VOLVER ARRIBA ========== */
.back-to-top {
    position: fixed; bottom: 25px; right: 25px; width: 50px; height: 50px;
    background-color: var(--primary-light); color: white; border: none; border-radius: 50%;
    cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.2); z-index: 10000;
    font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
    transition: all 0.3s ease; opacity: 0; visibility: hidden; transform: translateY(20px);
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background-color: var(--primary-dark); transform: translateY(-5px); }

/* ========== HEADER ========== */
.header-wrapper { position: absolute; top: 0; left: 0; width: 100%; z-index: 1000; }
.top-bar { background: var(--primary-dark); color: white; padding: 8px 0; font-size: 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.top-bar .contact-info { display: flex; align-items: center; gap: 20px; }
.top-bar .contact-info i { margin-right: 6px; }
.top-bar .social-icons a { color: white; margin-left: 12px; font-size: 0.9rem; }
.top-bar .social-icons a:hover { color: var(--primary-light); }

.navbar { background: white; padding: 15px 0; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.navbar .container { display: flex; justify-content: space-between; align-items: center; gap: 20px; }

/* LOGO COMO IMAGEN (Header) */
.logo-link { display: flex; align-items: center; }
.logo-img { max-height: 60px; width: auto; }

.nav-links { display: flex; gap: 30px; font-weight: 600; font-size: 0.9rem; color: var(--primary-dark); }
.nav-links a { transition: color 0.3s; }
.nav-links a:hover { color: var(--primary-light); }
.btn-nav { background: var(--primary-light); color: white; padding: 10px 22px; border-radius: 50px; font-weight: 700; font-size: 0.8rem; text-transform: uppercase; transition: all 0.3s; white-space: nowrap; }
.btn-nav:hover { background: #4aa3d1; transform: scale(1.05); }
.menu-toggle { display: none; font-size: 1.5rem; color: var(--primary-dark); cursor: pointer; }

/* ========== HERO ========== */
#inicio { min-height: 100vh; display: flex; align-items: center; padding-top: 140px; padding-bottom: 60px; overflow: hidden; position: relative; }
.hero-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; opacity: 0; transition: opacity 1s ease-in-out; z-index: 1; }
.hero-slide.active { opacity: 1; z-index: 2; }
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(90deg, rgba(11,35,66,0.7) 0%, rgba(11,35,66,0.3) 100%); z-index: 3; }
.hero-content { position: relative; z-index: 4; color: white; max-width: 650px; }
.hero-content h1 { font-family: var(--font-heading); font-size: 3.5rem; font-weight: 800; line-height: 1.2; margin-bottom: 20px; text-transform: uppercase; }
.hero-content h1 span { display: block; font-weight: 400; font-size: 1.8rem; letter-spacing: 1px; }
.hero-content p { font-size: 1rem; margin-bottom: 35px; line-height: 1.8; opacity: 0.9; max-width: 450px; }
.hero-dots { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; z-index: 5; }
.hero-dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, 0.5); cursor: pointer; transition: background 0.3s, transform 0.3s; }
.hero-dot.active { background: #ffffff; transform: scale(1.2); }

/* ========== QUIÉNES SOMOS ========== */
#nosotros { padding: 80px 0; background: white; position: relative; z-index: 2; }
#nosotros .container { display: grid; grid-template-columns: 1fr 1.5fr; gap: 50px; align-items: stretch; }
.about-text { display: flex; flex-direction: column; justify-content: space-between; }
.about-text h2 { font-family: var(--font-heading); font-size: 2.8rem; color: var(--primary-dark); margin-bottom: 25px; line-height: 1.1; }
.about-text p { margin-bottom: 20px; color: #555; font-size: 0.95rem; }
.about-text .btn { align-self: flex-start; margin-top: auto; }
.mission-vision { display: flex; flex-direction: column; gap: 20px; }
.mission-row { display: flex; align-items: center; justify-content: center; gap: 30px; flex: 1; }
.mission-text-box { background-color: var(--accent-blue); padding: 20px; border-radius: 10px; width: 220px; height: 220px; color: #ffffff; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; text-align: left; overflow: hidden; }
.mission-text-box h3 { color: var(--primary-dark); font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; text-transform: uppercase; }
.mission-text-box p { font-size: 0.8rem; line-height: 1.4; }
.mission-img-box { width: 130px; height: 130px; display: flex; align-items: center; justify-content: center; }
.mission-img-box img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }

/* ========== CLIENTES ========== */
#clientes { padding: 60px 0 80px; background: white; position: relative; z-index: 2; }
#clientes h2 { font-family: var(--font-heading); font-size: 2.8rem; color: var(--primary-dark); margin-bottom: 40px; }
.clientes-carousel-wrapper { position: relative; display: flex; align-items: center; gap: 20px; }
.clientes-arrow { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-dark); color: white; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer; transition: background 0.3s; flex-shrink: 0; }
.clientes-arrow:hover { background: var(--primary-light); }
.clientes-carousel-viewport { flex: 1; overflow: hidden; }
.clientes-track { display: flex; transition: transform 0.5s ease-in-out; }
.cliente-item { flex: 0 0 33.333%; max-width: 33.333%; padding: 15px; display: flex; justify-content: center; align-items: center; }
.cliente-item img { max-height: 150px; object-fit: contain; transition: transform 0.3s; }
.cliente-item img:hover { transform: scale(1.05); }
.clientes-dots { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }
.clientes-dot { width: 10px; height: 10px; border-radius: 50%; background: #ddd; cursor: pointer; transition: background 0.3s; }
.clientes-dot.active { background: var(--primary-dark); }

/* ========== FUNCIONES ========== */
#funciones { padding: 80px 0; background: var(--bg-gray); position: relative; z-index: 2; }
#funciones h2 { font-family: var(--font-heading); font-size: 2.8rem; color: var(--primary-dark); margin-bottom: 30px; }
.func-row { margin-bottom: 40px; }
.func-row .subtitle { font-family: var(--font-heading); font-size: 1.2rem; color: var(--primary-dark); margin-bottom: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.func-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.func-card { background: #7fbde3; padding: 25px; border-radius: 16px; transition: all 0.3s ease; height: 160px; overflow: hidden; position: relative; }
.func-card:hover { height: auto; max-height: 350px; transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); z-index: 10; }
.func-card::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 40px; background: linear-gradient(to bottom, rgba(127, 189, 227, 0) 0%, rgba(127, 189, 227, 1) 100%); opacity: 1; transition: opacity 0.3s ease; pointer-events: none; }
.func-card:hover::after { opacity: 0; }
.func-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.func-card .num { font-family: var(--font-heading); font-weight: 800; font-size: 2.5rem; color: var(--primary-dark); line-height: 1; }
.func-card h4 { font-family: var(--font-heading); font-size: 1.1rem; color: var(--primary-dark); margin: 0; text-transform: uppercase; line-height: 1.2; }
.func-card p { font-size: 0.9rem; color: #333; margin-top: 10px; }
.hidden-functions { display: none; }
.hidden-functions.visible { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.func-more { text-align: right; margin-top: 20px; }
.func-more button { background: none; border: none; font-weight: 700; color: var(--primary-dark); font-size: 1rem; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; transition: color 0.3s; font-family: var(--font-body); }
.func-more button:hover { color: var(--primary-light); }
.func-more button i { font-size: 1.2rem; transition: transform 0.3s; }

/* ========== LINKS ========== */
#links { background: var(--primary-dark); padding: 60px 0; color: white; text-align: center; position: relative; z-index: 2; }
#links::before { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 100%; height: 100%; background: url('../img/link.png') no-repeat center center / contain; opacity: 0.05; z-index: 0; pointer-events: none; }
#links .container { position: relative; z-index: 1; }
#links h2 { font-family: var(--font-heading); font-size: 2.5rem; margin-bottom: 40px; text-transform: uppercase; }
.links-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; max-width: 900px; margin: 0 auto; }
.link-logo { width: 100%; max-width: 260px; display: flex; justify-content: center; align-items: center; transition: transform 0.3s, opacity 0.3s; }
.link-logo:hover { transform: scale(1.05); opacity: 1; }
.link-logo img { max-height: 130px; filter: brightness(0) invert(1); opacity: 0.9; transition: opacity 0.3s; }
.link-logo:hover img { opacity: 1; }

/* ========== CONTACTO ========== */
#contacto { padding: 80px 0; background: white; position: relative; z-index: 2; }
#contacto .container { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: stretch; }
.contact-form h2 { font-family: var(--font-heading); font-size: 2.5rem; color: var(--primary-dark); margin-bottom: 30px; }
.contact-form form { display: flex; flex-direction: column; gap: 20px; }
.contact-form input, .contact-form textarea { width: 100%; padding: 15px 18px; border: 1px solid #ddd; border-radius: 8px; font-family: var(--font-body); font-size: 1rem; outline: none; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--primary-light); }
.contact-form textarea { min-height: 150px; resize: vertical; }
.contact-form .btn { align-self: flex-start; width: 100%; padding: 16px; font-size: 1rem; }
.contact-image { border-radius: 12px; overflow: hidden; min-height: 400px; background: url('../img/contacto.jpg') no-repeat center center/cover; }

/* ========== FOOTER ========== */
footer { background: var(--primary-dark); color: white; padding: 60px 0 20px; position: relative; z-index: 2; }
.footer-content { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 10px; margin-bottom: 40px; }

/* LOGO COMO IMAGEN (Footer) */
.footer-logo-img { max-height: 80px; width: auto; margin-bottom: 20px; }

.footer-logo p { font-size: 0.9rem; line-height: 1.8; color: #ccc; margin-bottom: 15px; }
.footer-logo .contact-details { font-size: 0.85rem; color: #aaa; }
.footer-logo .contact-details div { margin-bottom: 8px; }
.footer-logo .contact-details i { width: 20px; color: var(--primary-light); }
.footer-nav h4 { font-family: var(--font-heading); font-size: 1.1rem; margin-bottom: 20px; }
.footer-nav ul { display: flex; flex-direction: column; gap: 12px; }
.footer-nav ul a { color: #ccc; font-size: 0.9rem; transition: color 0.3s; }
.footer-nav ul a:hover { color: var(--primary-light); }
.footer-social h4 { font-family: var(--font-heading); font-size: 1.1rem; margin-bottom: 20px; }
.footer-social .social-btns { display: flex; gap: 15px; margin-bottom: 25px; }
.footer-social .social-btns a { color: white; font-size: 1.2rem; transition: transform 0.3s, color 0.3s; }
.footer-social .social-btns a:hover { color: var(--primary-light); transform: scale(1.2); }
.footer-social .btn { display: inline-block; background: var(--primary-light); color: white; padding: 10px 20px; font-size: 0.8rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: #888; flex-wrap: wrap; gap: 10px; }
.footer-bottom span { color: #aaa; }

/* ========== BLOG / INDEX (contenido WordPress) ========== */
#inicio.hero-simple { background: var(--primary-dark); }
.blog-post { padding: 40px 0; border-bottom: 1px solid #eee; }
.blog-post:last-child { border-bottom: none; }
.blog-post .entry-title { font-family: var(--font-heading); color: var(--primary-dark); margin-bottom: 15px; }
.blog-post .entry-title a { color: var(--primary-dark); }
.blog-post .entry-title a:hover { color: var(--primary-light); }
.pagination { margin: 40px 0; text-align: center; }
.site-main { min-height: 60vh; padding-bottom: 60px; }

/* ========== RESPONSIVE ========== */
@media (max-width: 992px) {
    .hero-content h1 { font-size: 2.8rem; }
    .hero-content h1 span { font-size: 1.4rem; }
    #nosotros .container { grid-template-columns: 1fr; gap: 30px; }
    .mission-vision { flex-direction: row; flex-wrap: wrap; }
    .mission-row { flex: 1; min-width: 250px; }
    #contacto .container { grid-template-columns: 1fr; }
    .contact-image { min-height: 250px; }
    .footer-content { grid-template-columns: 1fr 1fr; }
    .cliente-item { flex-basis: 50%; max-width: 50%; }
}

@media (max-width: 768px) {
    .header-wrapper { position: relative; }
    #inicio { padding-top: 20px; min-height: 70vh; }
    .top-bar .container { flex-direction: column; gap: 5px; text-align: center; }
    .top-bar .social-icons { margin-top: 5px; }
    .menu-toggle { display: block; }
    .nav-links { display: none; flex-direction: column; gap: 15px; width: 100%; background: white; padding: 20px 0; text-align: center; }
    .navbar .container { flex-wrap: wrap; }
    .navbar .container .nav-links.open { display: flex; }
    .navbar .container .btn-nav { display: none; }
    .navbar .container .btn-nav-mobile { display: block; margin-top: 10px; }
    .func-grid { grid-template-columns: 1fr 1fr; }
    .hidden-functions.visible { grid-template-columns: 1fr 1fr; }
    .links-grid { grid-template-columns: 1fr 1fr; }
    .footer-content { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .cliente-item { flex-basis: 100%; max-width: 100%; }
}

@media (max-width: 480px) {
    .hero-content h1 { font-size: 2rem; }
    .hero-content h1 span { font-size: 1rem; }
    .hero-content p { font-size: 0.9rem; }
    #nosotros h2, #funciones h2, #contacto h2 { font-size: 2rem; }
    .func-grid { grid-template-columns: 1fr; }
    .hidden-functions.visible { grid-template-columns: 1fr; }
    .links-grid { grid-template-columns: 1fr; }
    .mission-row { flex-direction: column; align-items: center; text-align: center; }
    .mission-text-box { width: 180px; height: 180px; }
    .mission-img-box { width: 110px; height: 110px; }
}

.nav-links.open { display: flex; }
.btn-nav-mobile { display: none; }
@media (max-width: 768px) {
    .btn-nav-mobile { display: block; width: 100%; text-align: center; margin-top: 10px; }
    .btn-nav-mobile .btn-nav { display: inline-block; }
}