/* ==============================
   Variables
   ============================== */
:root {
    --blue-900: #002640;
    --blue-700: #004b8a;
    --blue-500: #0077cc;
    --accent: #00aaff;
    --muted: #6b7280;
    --card: #f7fbff;
    --radius: 12px;
}

/* ==============================
   Reset + layout base
   ============================== */
* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font-family: Inter, Segoe UI, Arial, Helvetica, sans-serif;
    line-height: 1.5;
    color: #0f1724;
    background: linear-gradient(180deg, #fbfdff 0%, #fff 100%);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 1 auto;
    margin-top: 80px
}

.container {
    width: 92%;
    max-width: 1200px;
    margin: 0 auto
}

a {
    text-decoration: none
}

/* ==============================
   Header
   ============================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    width: 100%;
    background: linear-gradient(90deg, var(--blue-900), var(--blue-700));
    color: #fff;
    box-shadow: 0 6px 18px rgba(2, 6, 23, .15);
    opacity: .95;
}

.header-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 14px 0
}

.logo {
    height: 52px
}

/* Main nav (desktop) */
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 18px;
    align-items: center;
    margin: 0;
    transition: max-height .3s ease;
}

.main-nav a {
    color: #e6f2ff;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background .18s ease, color .18s ease;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff
}

/* anulamos “doble animación”: sin translate en los enlaces del menú */
.main-nav a {
    transform: none
}

/* Botones */
.btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    transition: transform .2s ease, box-shadow .2s ease
}

.btn-primary {
    background: var(--blue-500);
    color: #fff;
    box-shadow: 0 6px 18px rgba(3, 78, 162, .18)
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(3, 78, 162, .2)
}

.btn-ghost {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, .12)
}

.btn-outline {
    background: transparent;
    color: #fff;
    border: 1px solid #fff;
    padding: 8px 12px;
    border-radius: 4px
}

.card .btn-sm {
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 700;
    background: var(--blue-500);
    color: #fff;
    box-shadow: 0 4px 14px rgba(3, 78, 162, .16)
}

.card .btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(3, 78, 162, .18)
}

/* Toggle móvil */
.nav-toggle {
    display: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: 0;
    padding: 8px
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: transform .3s ease, opacity .3s ease
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px)
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px)
}

/* ==============================
   Hero
   ============================== */
.hero {
    padding: 64px 0
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 480px;
    gap: 28px;
    align-items: center
}

.hero h1 {
    font-size: 2.25rem;
    color: #021529;
    margin-bottom: 10px
}

.lead {
    color: var(--muted);
    font-size: 1.05rem
}

.hero-media {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(3, 78, 162, .12)
}

.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block
}

/* ==============================
   Secciones / componentes
   ============================== */
.section {
    padding: 48px 0
}

.section h2 {
    font-size: 1.5rem;
    color: var(--blue-900);
    margin-bottom: 6px
}

.section-intro {
    color: var(--muted);
    margin-bottom: 18px
}

.split {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 24px;
    align-items: center
}

.values {
    margin-top: 12px;
    list-style: none;
    padding-left: 0
}

.values li {
    padding: 8px 0;
    color: var(--muted)
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-top: 18px
}

.card {
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    transition: transform .24s ease, box-shadow .24s ease
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(2, 6, 23, .12)
}

.card img {
    width: 100%;
    height: 180px;
    object-fit: cover
}

.card-body {
    padding: 16px
}

.card h3 {
    margin-bottom: 8px;
    color: var(--blue-900)
}

.card p {
    color: var(--muted);
    font-size: .95rem;
    margin-bottom: 12px
}

.store-banner {
    margin-top: 22px;
    padding: 18px;
    border-radius: 10px;
    background: linear-gradient(90deg, #f7fbff, #eef7ff);
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.services-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center
}

.service {
    flex: 1 1 250px;
    background: #e6f0ff;
    padding: 1.5rem;
    text-align: center;
    border-radius: 8px;
    transition: .3s
}

.service:hover {
    background: #cce0ff;
    transform: translateY(-5px)
}

.service h3 {
    color: var(--blue-700)
}

.contact-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 18px;
    align-items: start
}

.contact-card {
    background: #fff;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid rgba(2, 6, 23, .04)
}

.contact-card p {
    color: var(--muted);
    margin: 8px 0
}

.contact-form form {
    display: flex;
    flex-direction: column;
    gap: 12px
}

.contact-form input,
.contact-form textarea {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e6eefc
}

/* Footer */
.site-footer {
    background: #021529;
    color: #dbeeff;
    padding: 20px 0;
    margin-top: 30px
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px
}

.footer-link {
    color: var(--accent);
    margin-left: 12px
}

/* ==============================
   Mega-menú (desktop)
   ============================== */
.has-mega {
    position: relative
}

.mega {
    /*position: absolute;
    top: calc(100% + 5px);
    right: 0;
    left: auto;*/
    position: fixed;
    transform: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: #fff;
    color: #021529;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(2, 6, 23, .12);
    padding: 18px;
    gap: 28px;
    /*min-width: 600px;*/
    max-width: min(92vw, 920px);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    z-index: 1300;
}

.has-mega:hover>.mega,
.has-mega:focus-within>.mega {
    opacity: 1;
    visibility: visible;
    pointer-events: auto
}

.mega h4 {
    margin: 0 0 8px;
    color: var(--blue-700)
}

.mega a {
    color: #021529;
    display: block;
    padding: 6px 0;
    border-radius: 6px
}

.mega a:hover {
    background: #f5f9ff;
    color: #021529
}

/* Lista vertical con viñetas */
.mega ul {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
    display: block;
}

.mega ul li {
    display: list-item;
    margin: 4px 0
}

/* ==============================
   Trustbar / chips
   ============================== */
.trustbar {
    padding: 16px 0;
    background: linear-gradient(90deg, #f7fbff, #eef7ff)
}

.trustbar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    align-items: center
}

.trust-item {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #fff;
    padding: 10px 12px;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(2, 6, 23, .06)
}

.trust-item .icon {
    font-size: 1.2rem
}

.mini-links {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

.mini-links a {
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid #d9e9ff;
    border-radius: 999px;
    color: var(--blue-700);
    background: #f7fbff;
    font-size: .85rem
}

.mini-links a:hover {
    background: #eef7ff
}

/* ==============================
   Focus visible
   ============================== */
a:focus,
button:focus {
    outline: 3px solid rgba(0, 119, 204, .18);
    outline-offset: 3px
}

.mega-toggle {
    display: none;
}

/* ==============================
   Responsive
   ============================== */
@media (max-width:900px) {

    .hero-grid,
    .split,
    .contact-grid {
        grid-template-columns: 1fr
    }

    .testimonials {
        grid-template-columns: 1fr
    }

    .header-grid {
        padding: 12px 0
    }

    /* Menú móvil cerrado por defecto */
    .main-nav ul {
        display: none
    }

    .nav-toggle {
        display: flex;
        margin-left: auto;
        z-index: 1200
    }

    /* Menú móvil abierto (clase .open la pone tu JS) */
    .main-nav ul {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 60px;
        right: 0;
        width: 260px;
        background: linear-gradient(180deg, var(--blue-900), var(--blue-700));
        max-height: 0;
        overflow: hidden;
        box-shadow: 0 6px 12px rgba(0, 0, 0, .15);
        border-radius: 10px 0 0 10px;
        transition: max-height .35s ease;
        z-index: 1100;
        margin-left: auto
    }

    .main-nav ul.open {
        max-height: 80vh;
        overflow: auto
    }

    /* Items más compactos */
    .main-nav li {
        padding: 12px 14px;
        text-align: right
    }

    /* ---- Mega en móvil (acordeón) ---- */
    .has-mega {
        position: static;
        display: block
    }

    /* encabezado (texto + +) en una línea SIN usar flex en <li> */
    .mega-trigger {
        display: inline-block;
        width: auto;
        padding-right: 8px
    }

    .mega-toggle {
        display: inline-block;
        vertical-align: middle;
        background: none;
        border: 0;
        margin-left: 8px;
        width: 24px;
        height: 24px;
        position: relative;
        cursor: pointer;
    }

    .mega-toggle::before,
    .mega-toggle::after {
        content: "";
        position: absolute;
        left: 6px;
        right: 6px;
        height: 2px;
        background: #e6f2ff;
        top: 11px;
        transition: transform .2s ease;
        transition: opacity .2s ease, transform .2s ease;
        transform: translate(-50%, -50%);
    }

    .mega-toggle::after {
        transform: translate(-50%, -50%) rotate(90deg);
        /* cerrado = PLUS */
    }

    /* submenú debajo del item */
    .mega {
        position: static;
        min-width: auto;
        max-width: none;
        grid-template-columns: 1fr;
        box-shadow: none;
        padding: 8px 16px;
        margin-top: 6px;
        display: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto
    }

    .has-mega.open>.mega {
        display: grid
    }

    .has-mega.open>.mega-toggle::after {
        transform: rotate(90deg);
        transform: translate(-50%, -50%);
        opacity: 0;
    }
}

#website {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

#statusMsg {
    min-height: 1.2em;
}

/* ====== Contacto (resiliente a cambios en HTML) ====== */

.section.contact-section .contact-form form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 700px) {
    .section.contact-section .contact-form form {
        grid-template-columns: 1fr;
    }
}

/* Agrupación de campos */
.section.contact-section .contact-form :where(.form-row, .form-group, .field) {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Hacer que “Mensaje” y otros campos largos ocupen todo el ancho */
.section.contact-section .contact-form .wide {
    grid-column: 1 / -1;
}

/* Resto de estilos iguales */
.section.contact-section .contact-form label {
    font-size: .95rem;
    color: #0f1724;
    font-weight: 600;
}

.section.contact-section .contact-form input:not([type="checkbox"]),
.section.contact-section .contact-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e6eefc;
    border-radius: 8px;
    font: inherit;
    color: #0f1724;
    background: #fff;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.section.contact-section .contact-form textarea {
    min-height: 140px;
    resize: vertical;
    max-height: 420px;
}

.section.contact-section .contact-form input:focus,
.section.contact-section .contact-form textarea:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(0, 119, 204, .12);
}

.section.contact-section .contact-form .obligatorio {
    color: #cc0000;
    font-weight: 700;
    margin-left: 4px;
}

/* Botón y mensaje de estado */
.section.contact-section #sendBtn.btn-primary,
.section.contact-section #statusMsg {
    grid-column: 1 / -1;
}

/* ==============================
   Página 404
   ============================== */
.not-found {
    padding: 100px 0;
    text-align: center;
}

.not-found h1 {
    font-size: 2rem;
    color: var(--blue-900);
    margin-bottom: 10px;
}

.not-found .lead {
    color: var(--muted);
    font-size: 1.05rem;
    margin-bottom: 18px;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    color: var(--blue-700);
    animation: spin-slow 6s linear infinite;
}

.error-ctas {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}