/* Reset and Base Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

:root {
    --primary: #0b4a86;
    --accent: #60a5fa;
    --muted: #64748b;
    --bg: #f8fafc;
    --card: #ffffff;
    --header-height: 72px;
    --max-width: 1200px;
}

/* Base */
body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #0b2e4a;
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* Header (fixed) */
.header {
    background: linear-gradient(135deg, #2c5aa0, #1e3a8a);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0; left: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    height: var(--header-height);
    display: flex; align-items: center;
}
.header .container { display:flex; justify-content:space-between; align-items:center; }
.logo h1 { color:#fff; font-size:1.15rem; font-weight:700; display:flex; gap:.5rem; align-items:center; }
.logo i { color: var(--accent); }

/* Nav */
.nav { display:flex; gap:1rem; align-items:center; }
.nav a {
    color:#fff; text-decoration:none; font-weight:600; padding:.25rem .35rem; position:relative;
    transition: color .25s ease;
}
.nav a:hover { color: var(--accent); }
.nav a::after {
    content:''; position:absolute; left:0; bottom:-6px; height:2px; width:0; background:var(--accent);
    transition: width .28s ease;
}
.nav a:hover::after { width:100%; }

/* Spacer under fixed header */
.header-spacer { height: var(--header-height); }

/* HERO */
.hero {
    display:flex; gap:2rem; align-items:center;
    padding: calc(var(--header-height) + 38px) 0 2.5rem; min-height:62vh;
}

/* Carousel column */
.hero-carousel {
    width:52%; height:62vh; min-height:300px; max-height:72vh;
    overflow:hidden; border-radius:12px; box-shadow:0 12px 30px rgba(11,74,134,0.08);
    background: var(--card); position:relative;
}
.carousel-wrap, .carousel, .carousel-item { height:100%; }

/* Carousel track */
.carousel {
    display:flex; height:100%; transition:transform .6s ease; will-change:transform;
    align-items:center; justify-content:flex-start; min-height:180px;
}

/* Slide: background fallback; supports <img> fallback */
.carousel-item {
    min-width:100%; flex-shrink:0; display:flex; align-items:center; justify-content:center;
    background-color: var(--bg); background-position:center center; background-repeat:no-repeat;
    background-size:contain; border-radius:8px; overflow:hidden;
}

/* If using <img> inside slides */
.carousel-item img {
    display:block !important; max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain;
}

/* Controls */
.carousel-control {
    position:absolute; top:50%; transform:translateY(-50%);
    background:rgba(255,255,255,0.95); color:var(--primary); border:none; width:40px; height:40px;
    border-radius:50%; display:flex; align-items:center; justify-content:center;
    box-shadow:0 6px 14px rgba(2,6,23,0.08); cursor:pointer; font-weight:700; z-index:6;
}
.carousel-control.prev { left:12px; } .carousel-control.next { right:12px; }

/* Hero content */
.hero-content { width:44%; color:#08335f; }
.hero-content h1 {
    font-size:clamp(1.9rem, 4vw, 3rem); margin:0 0 .6rem; letter-spacing:1px; text-transform:uppercase;
}
.hero-content p { color:var(--muted); margin:0 0 1rem; font-size:1.05rem; }

/* Buttons */
.cta-buttons { display:flex; gap:.8rem; flex-wrap:wrap; margin-bottom:.9rem; }
.btn-primary, .btn-secondary {
    display:inline-flex; align-items:center; gap:.5rem; padding:.75rem 1.1rem; border-radius:28px;
    text-decoration:none; font-weight:600; transition:transform .18s ease, box-shadow .18s ease; cursor:pointer;
}
.btn-primary { background:var(--primary); color:#fff; box-shadow:0 10px 22px rgba(11,74,134,0.10); }
.btn-primary:hover { transform:translateY(-3px); }
.btn-secondary { background:transparent; color:var(--primary); border:1px solid rgba(11,74,134,0.14); }
.btn-secondary:hover { background:#f1f8ff; }

/* Trust badges */
.hero-trust { display:flex; gap:1rem; flex-wrap:wrap; margin-top:.6rem; color:#475569; font-size:.95rem; }
.hero-trust span { display:flex; align-items:center; gap:.5rem; background:#f1f8ff; padding:.45rem .6rem; border-radius:8px; }

/* Sections */
section { padding:2.5rem 0; }
.services h2, .about h2, .contact h2 { text-align:center; color:var(--primary); margin-bottom:1.2rem; }
.services-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:1.1rem; }
.service-card {
    background:var(--card); padding:1.1rem; border-radius:10px; text-align:center;
    box-shadow:0 8px 18px rgba(11,74,134,0.04); transition:transform .28s ease, box-shadow .28s ease;
    border:1px solid rgba(11,74,134,0.04);
}
.service-card:hover { transform:translateY(-8px); box-shadow:0 12px 34px rgba(11,74,134,0.08); }
.service-image { display:flex; justify-content:center; margin-bottom:.6rem; }

/* About */
.about { background:var(--card); }
.features { display:grid; grid-template-columns:repeat(4,1fr); gap:1rem; }

/* Contact */
.contact { background: linear-gradient(135deg,#f1f5f9,#e2e8f0); }
.contact-info { display:grid; grid-template-columns:repeat(4,1fr); gap:1rem; margin-bottom:1.5rem; }
.contact-card { background:var(--card); padding:1rem; border-radius:10px; text-align:center; box-shadow:0 6px 16px rgba(2,6,23,0.04); transition:transform .2s ease; }
.contact-card:hover { transform:translateY(-5px); }
.contact-form { max-width:600px; margin:0 auto; background:var(--card); padding:1.25rem; border-radius:10px; box-shadow:0 6px 18px rgba(11,74,134,0.04); }

/* Form */
.form-group { display:grid; grid-template-columns:1fr 1fr; gap:1rem; margin-bottom:1rem; }
.form-group input, .form-group select, textarea {
    padding:12px; border:1px solid #e6eef9; border-radius:8px; font-size:.98rem; background:#fbfdff;
}
.form-group input:focus, .form-group select:focus, textarea:focus {
    outline:none; border-color:#3b82f6; box-shadow:0 6px 18px rgba(59,130,246,0.06);
}
textarea { width:100%; resize:vertical; margin-bottom:.8rem; }
.contact-form .btn-primary { width:100%; justify-content:center; border:none; }

/* Footer */
.footer { background:#0b2340; color:#dbeafe; padding:2rem 0; margin-top:2rem; }
.footer-content { display:flex; gap:1rem; flex-wrap:wrap; }
.footer-section { flex:1 1 220px; min-width:220px; margin-bottom:1rem; }
.footer-bottom { text-align:center; margin-top:1rem; padding-top:1rem; border-top:1px solid rgba(255,255,255,0.04); color:#cfe3ff; }

/* Misc */
.fab.fa-whatsapp { color:#25d366 !important; }
.hero-images, .hero-video, .hero-background { display:none !important; }

/* Animations */
.service-card, .feature, .contact-card { animation: fadeInUp 0.6s ease-out; }
@keyframes fadeInUp { from { opacity:0; transform:translateY(30px); } to { opacity:1; transform:translateY(0); } }
.service-card:hover i, .feature:hover i, .contact-card:hover i { transform:scale(1.1); transition:transform .3s ease; }

/* Recuadro redondeado y acorde al diseño */
.panel {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,251,255,0.95));
    border: 1px solid rgba(11,74,134,0.06);
    border-radius: 16px;
    padding: 1.6rem;
    box-shadow: 0 16px 40px rgba(11,74,134,0.06);
    transition: transform .22s ease, box-shadow .22s ease;
    margin: 1rem 0;
}

/* Versión más compacta para tarjetas pequeñas */
.panel--compact { padding: 1rem; border-radius: 12px; }

/* Título dentro del panel */
.panel h2, .panel .section-title {
    margin-top: 0;
    margin-bottom: .8rem;
    color: var(--primary);
    text-align: center;
}

/* Opcional: cabecera destacada para paneles */
.panel-header {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:.6rem;
    margin-bottom:.9rem;
}
.panel-header .icon {
    background: linear-gradient(90deg, var(--accent), rgba(96,165,250,0.6));
    color:#fff; width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center;
    box-shadow:0 8px 20px rgba(11,74,134,0.06);
}

/* Interacción sutil */
.panel:hover { transform: translateY(-6px); box-shadow: 0 22px 48px rgba(11,74,134,0.08); }

/* Ajustes responsivos */
@media (max-width:900px) {
    .panel { padding: 1.1rem; border-radius: 12px; }
}

/* Responsive Breakpoints */

/* Large tablets / small desktops */
@media (max-width:1100px) {
    .services-grid { grid-template-columns:repeat(2,1fr); }
    .features { grid-template-columns:repeat(2,1fr); }
    .contact-info { grid-template-columns:repeat(2,1fr); }
    .hero { gap:1.2rem; padding-top: calc(var(--header-height) + 28px); }
    .hero-carousel { min-height:300px; }
}

/* Tablets and small laptops — stack hero */
@media (max-width:900px) {
    .hero { flex-direction:column; align-items:stretch; padding: calc(var(--header-height) + 24px) 0 2rem; min-height:54vh; gap:.8rem; }
    .hero-carousel, .hero-content { width:100%; }
    .hero-carousel { height:46vh; min-height:160px; max-height:56vh; border-radius:10px; }
    .carousel, .carousel-wrap, .carousel-item { height:100%; min-height:160px; }
    .carousel { touch-action: pan-y; user-select:none; -webkit-user-select:none; -ms-user-select:none; }
    .carousel-item { background-size:cover; background-position:center; } /* crop on narrow screens */
    .carousel-control { width:36px; height:36px; font-size:.95rem; background:rgba(255,255,255,0.92); box-shadow:0 6px 14px rgba(2,6,23,0.06); }
    .carousel-control.prev { left:8px; } .carousel-control.next { right:8px; }

    .hero-content { padding:0 10px; text-align:center; }
    .hero-content h1 { font-size:clamp(1.4rem,6vw,1.9rem); margin-bottom:.4rem; }
    .hero-content p { font-size:1rem; margin-bottom:.8rem; }

    .cta-buttons { justify-content:center; flex-direction:column; gap:.6rem; align-items:center; }
    .btn-primary, .btn-secondary { width:100%; max-width:360px; padding:.7rem 1rem; border-radius:24px; box-sizing:border-box; }
    .btn-primary { font-size:1rem; } .btn-secondary { font-size:.98rem; }

    .hero-trust { justify-content:center; gap:.6rem; }
    .container { padding:0 12px; }
    .logo h1 { font-size:1rem; }
    .services-grid, .features, .contact-info { grid-template-columns:1fr; }
}

/* Narrow phones */
@media (max-width:700px) {
    .hero-carousel { height:40vh; min-height:180px; }
    .hero-content h1 { font-size:1.6rem; }
    .form-group { gap:.6rem; }
    .service-card { padding:.9rem; }
}

/* Small phones */
@media (max-width:480px) {
    .hero { padding: calc(var(--header-height) + 12px) 0 1.4rem; }
    .cta-buttons { flex-direction:column; gap:.6rem; }
    .form-group { grid-template-columns:1fr; }
    .logo h1 { font-size:1rem; }
    .hero-trust { justify-content:center; }
    .container { padding:0 12px; }
    .hero-carousel { border-radius:8px; min-height:160px; height:36vh; }
    .carousel-item img { max-height:100%; }
    .btn-primary, .btn-secondary { padding:.6rem .9rem; font-size:.95rem; border-radius:22px; }
    .carousel-control { width:34px; height:34px; font-size:.85rem; }
}

/* Very small screens */
@media (max-width:360px) {
    .hero-carousel { min-height:140px; height:34vh; }
    .hero-content h1 { font-size:1.4rem; }
    .btn-primary, .btn-secondary { padding:.55rem .85rem; font-size:.95rem; border-radius:22px; }
}

/* Prevent collapse if CSS loads slowly */
.hero-carousel, .carousel-wrap, .carousel, .carousel-item { min-height:140px; }
