/* ============================================================
   global.css — Sistema de diseño unificado InterGrid
   Cargado UNA SOLA VEZ desde cabecera.php
   Fuentes cargadas en cabecera.php — NO repetir @import acá
   ============================================================ */

/* ============================================================
   VARIABLES DE DISEÑO
   ============================================================ */
:root {
    /* Colores de marca */
    --azul:         #042b5b;
    --azul-mid:     #0b376c;
    --cyan:         #0cbae1;
    --cyan-light:   #e8f8fd;
    --verde:        #00a650;
    --gris:         #f5f7fa;
    --texto:        #1a1a2e;
    --muted:        #6b7280;

    /* Sombras */
    --sombra:       0 4px 24px rgba(4,43,91,0.10);
    --sombra-hover: 0 12px 40px rgba(4,43,91,0.18);

    /* Radios */
    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  14px;
    --radius-xl:  16px;
    --radius-pill: 50px;
}

/* ============================================================
   RESET BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'DM Sans', sans-serif;
    margin: 0;
    padding: 0;
    background: #fff;
    color: var(--texto);
    line-height: 1.6;
}

img { max-width: 100%; display: block; }
a   { text-decoration: none; }

/* ============================================================
   TIPOGRAFÍA GLOBAL
   ============================================================ */
/* h1, h2, h3, h4, h5, h6 {
   /* font-family: 'Barlow Condensed', sans-serif;*/
    /*font-weight: 800;
  /*  line-height: 1.15;
  /*  color: var(--azul);
   /* margin: 0;
} */

/* ============================================================
   BANNER SUPERIOR — .cartel / .segundo-header
   Compartido por: nos, serv, proy, cont + cualquier página nueva
   ============================================================ */
.cartel,
.segundo-header {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 340px;
    display: flex;
    align-items: center;
}

.cartel::before,
.segundo-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(4, 43, 91, 0.82) 0%,
        rgba(12, 186, 225, 0.30) 100%
    );
}

.cartel::after,
.segundo-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.container-primario {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 0 auto;
    padding: 72px 24px;
}

/* Tag decorativo del banner (opcional, se agrega en el PHP) */
.header-tag {
    display: inline-block;
    background: rgba(12, 186, 225, 0.18);
    color: var(--cyan);
    border: 1px solid rgba(12, 186, 225, 0.40);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    margin-bottom: 14px;
    font-family: 'DM Sans', sans-serif;
    display: block;
    width: fit-content;
}

.container-primario h1 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 12px;
}

.container-primario p {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.80);
    max-width: 520px;
    line-height: 1.6;
    margin: 0;
}

/* ============================================================
   CABECERA — navbar
   ============================================================ */
.cabecera {
    background: linear-gradient(to right, #05003d, var(--azul-mid));
    color: #fff;
    width: 100%;
}

.cabecera .top-bar {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    padding: 12px 20px;
    gap: 16px;
    transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.3s ease;
    overflow: hidden;
    max-height: 200px;
    opacity: 1;
}

.top-bar.hidden {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    opacity: 0 !important;
}

.cabecera .logo {
    max-width: 100px;
    min-width: 60px;
    display: block;
    flex-shrink: 0;
}

.cabecera .search-bar {
    flex: 1 1 auto;
    display: flex;
    max-width: 420px;
    min-width: 0;
}

.cabecera .search-bar input {
    flex: 1;
    border-radius: 5px 0 0 5px;
    padding: 7px 14px;
    border: none;
    background: #f5f5f5;
    font-size: 14px;
    color: #333;
    outline: none;
    transition: background 0.3s;
    width: 100%;
}

.cabecera .search-bar input:hover,
.cabecera .search-bar input:focus { background: #e9e9e9; }

.cabecera .search-bar button {
    border-radius: 0 5px 5px 0;
    padding: 7px 12px;
    background: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
}

.btn-advertising {
    background: linear-gradient(to right, orange, red);
    color: white;
    border: none;
    border-radius: 20px 0 30px 20px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.btn-advertising:hover { opacity: 0.9; }

.bottom-bar {
    background: #092d5a;
    border-top: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    z-index: 999;
    width: 100%;
}
.bottom-bar.is-sticky { box-shadow: 0 2px 12px rgba(0,0,0,0.35); }

.bottom-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    padding: 8px 20px;
    gap: 16px;
}

.lugar {
    font-size: 12px;
    font-weight: 300;
    color: rgba(255,255,255,0.8);
    line-height: 1.5;
    min-width: 130px;
    flex-shrink: 0;
}
.lugar a { color: rgba(255,255,255,0.9); text-decoration: none; }
.lugar a:hover { color: #fff; }

#nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    padding: 0;
}

.nav-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    list-style: none;
    gap: 2px;
    margin: 0;
    padding: 0;
}

.nav-list li a {
    font-size: 13px;
    color: #fff !important;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    display: block;
    transition: background 0.2s;
    white-space: nowrap;
    text-decoration: none !important;
}
.nav-list li a:hover  { background: rgba(255,255,255,0.12); }
.nav-list li a.active { background: #4CAF50; font-weight: bold; }

.social-icons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.social-icons a {
    color: rgba(255,255,255,0.85) !important;
    font-size: 18px;
    text-decoration: none;
    transition: color 0.2s;
    line-height: 1;
}
.social-icons a:hover { color: #fff !important; }

.abrir-menu,
.cerrar-menu {
    display: none;
    border: 0;
    font-size: 2.2rem;
    background: transparent;
    cursor: pointer;
    color: #fff;
    line-height: 1;
}

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

/* Primario — cyan */
.cta-button,
.btn-primary-ig {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--cyan);
    color: #fff;
    padding: 13px 32px;
    border-radius: var(--radius-pill);
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.cta-button:hover,
.btn-primary-ig:hover {
    background: #0aaad0;
    color: #fff;
    transform: translateY(-2px);
}

/* Secundario — contorno blanco */
.secondary-button,
.btn-secondary-ig {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    padding: 13px 32px;
    border-radius: var(--radius-pill);
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    border: 2px solid rgba(255,255,255,0.40);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}
.secondary-button:hover,
.btn-secondary-ig:hover {
    background: rgba(255,255,255,0.22);
    color: #fff;
}

/* Botón azul oscuro */
.btn-dark-ig {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--azul);
    color: #fff;
    padding: 13px 32px;
    border-radius: var(--radius-pill);
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-dark-ig:hover {
    background: var(--azul-mid);
    color: #fff;
    transform: translateY(-2px);
}

/* ============================================================
   CARDS — sistema unificado
   ============================================================ */
.card-ig {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1.5px solid transparent;
    box-shadow: var(--sombra);
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.card-ig:hover {
    transform: translateY(-5px);
    box-shadow: var(--sombra-hover);
    border-color: var(--cyan);
}

/* ============================================================
   SECTION TAGS — etiqueta cyan encima de títulos
   ============================================================ */
.section-tag {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--cyan);
    margin-bottom: 10px;
    font-family: 'DM Sans', sans-serif;
}

/* ============================================================
   BLOQUE CTA OSCURO — gradiente azul → cyan (reutilizable)
   Usado en: nos-cta-section, post-cta, cta-final del index
   ============================================================ */
.cta-block {
    background: linear-gradient(135deg, var(--azul) 0%, #0b5ea8 60%, var(--cyan) 100%);
    border-radius: var(--radius-xl);
    padding: 60px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta-block::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}
.cta-block h2 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    position: relative;
}
.cta-block p {
    color: rgba(255,255,255,0.80);
    font-size: 1rem;
    margin-bottom: 28px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    position: relative;
}
.cta-block-btns {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

/* ============================================================
   MODAL DE ESTADO — ok / error (cont.php, index)
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(4,43,91,0.55);
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    text-align: center;
    z-index: 1001;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--sombra-hover);
    border: 1.5px solid transparent;
    animation: popIn 0.3s ease;
}
@keyframes popIn {
    from { transform: translate(-50%, -48%); opacity: 0; }
    to   { transform: translate(-50%, -50%); opacity: 1; }
}

.modal.ok    { border-color: #1D9E75; }
.modal.error { border-color: #E24B4A; }
.modal-icon  { font-size: 2.8rem; margin-bottom: 16px; line-height: 1; }

.modal h3 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--azul);
    margin-bottom: 10px;
}
.modal p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 24px;
}
.modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--cyan);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    padding: 11px 32px;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}
.modal-btn:hover         { background: #0aaad0; transform: translateY(-2px); }
.modal.error .modal-btn  { background: var(--azul); }
.modal.error .modal-btn:hover { background: var(--azul-mid); }

/* ============================================================
   FAQ ACCORDION
   ============================================================ */
.faq-item {
    border: 1px solid #e8edf3;
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    background: var(--gris);
    margin: 0;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    color: var(--azul);
    transition: background 0.2s;
}
.faq-question:hover { background: #eef1f5; }
.faq-content {
    padding: 0 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.7;
}
.faq-content.active {
    max-height: 300px;
    padding: 14px 16px;
    background: var(--cyan-light);
}
.faq-toggle { transition: transform 0.3s ease-out; }
.faq-toggle.active { transform: rotate(90deg); }

/* ============================================================
   CHAT WHATSAPP FLOTANTE
   ============================================================ */
.whatsapp-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: transform 0.2s, box-shadow 0.2s;
}
.whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0,0,0,0.4);
}

.whatsapp-modal {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 50px;
    width: 300px;
    background: var(--azul-mid);
    border-radius: 30px 40px 0 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    padding: 20px;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.whatsapp-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.whatsapp-modal .modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    font-family: 'DM Sans', sans-serif;
}

.close-chat {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}
.close-chat:hover { color: #ff6b6b; }

.chat-input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    background: rgba(255,255,255,0.95);
    color: var(--texto);
    resize: none;
}
.chat-input:focus {
    outline: none;
    border-color: var(--cyan);
}

.send-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--cyan);
    color: white;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    padding: 13px;
    width: 100%;
    margin-top: 10px;
    cursor: pointer;
    border-radius: 5px 5px 0 10px;
    transition: background 0.2s;
}
.send-button:hover { background: #0aaad0; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: var(--azul-mid);
    color: #b0bec5;
    padding: 40px 0;
    width: 100%;
    font-family: 'DM Sans', sans-serif;
}

.footer-line {
    border-right: 1px solid #b0bec5;
    padding: 0 40px;
    margin-bottom: 40px;
}

.footer .btn-custom {
    border-radius: var(--radius-sm);
    background: #0D5287;
    color: #fff;
    border: none;
    width: 100%;
    height: 50px;
    line-height: 50px;
    padding: 0 15px;
    margin-top: 10px;
    cursor: pointer;
    transition: background 0.3s;
    font-family: 'DM Sans', sans-serif;
}
.footer .btn-custom:hover { background: rgb(13,71,142); }

.footer .btn-white {
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--azul-mid);
    border: 1px solid var(--azul-mid);
    width: 100%;
    height: 50px;
    line-height: 50px;
    padding: 0 15px;
    margin-top: 10px;
    cursor: pointer;
    transition: color 0.3s, background 0.3s;
    font-family: 'DM Sans', sans-serif;
}
.footer .btn-white:hover { background: rgb(111,137,170); color: #fff; }

.social-icons2 {
    display: flex;
    justify-content: space-around;
    margin-top: 40px;
}
.social-icons2 a {
    color: #b0bec5;
    font-size: 30px;
    text-decoration: none;
    transition: color 0.3s;
}
.social-icons2 a:hover { color: #fff; }

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    font-size: 14px;
}

/* ============================================================
   ANIMACIONES GLOBALES
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ============================================================
   RESPONSIVE — cabecera y banner
   ============================================================ */
@media (max-width: 768px) {
    .cabecera .top-bar { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
    .cabecera .search-bar { order: 3; max-width: 100%; width: 100%; }
    .btn-advertising { order: 2; }
    .bottom-inner { flex-wrap: wrap; padding: 8px 16px; min-height: 48px; }
    .lugar, .social-icons { display: none !important; }

    .abrir-menu {
        display: block !important;
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
    }
    .cerrar-menu { display: block !important; align-self: flex-end; margin-bottom: 8px; }

    #nav {
        opacity: 0;
        visibility: hidden;
        flex-direction: column !important;
        align-items: flex-end !important;
        gap: 1rem;
        position: fixed;
        top: 0; right: 0;
        height: 100vh;
        background: var(--azul-mid);
        padding: 1.5rem !important;
        z-index: 1000;
        border-radius: 0 0 0 20px;
        transform: translateX(100%);
        transition: opacity 0.3s, transform 0.4s, visibility 0.3s;
        min-width: 220px;
        box-shadow: -4px 0 20px rgba(0,0,0,0.3);
    }
    #nav.visible { opacity: 1; visibility: visible; transform: translateX(0); }
    .nav-list { flex-direction: column !important; align-items: flex-end; gap: 8px !important; }
    .nav-list li a { font-size: 15px !important; padding: 8px 12px !important; }

    .cartel, .segundo-header { min-height: 240px; }
    .container-primario { padding: 48px 20px; }

    .footer .footer-line { border-right: none; border-bottom: 1px solid #b0bec5; padding: 20px; margin-bottom: 20px; }

    .cta-block { padding: 48px 24px; }
    .cta-button, .secondary-button { display: block; text-align: center; margin: 0 0 10px; }
}
