/* 1. CARGAMOS LAS FUENTES LOCALES */
@font-face {
    font-family: 'Made Tommy';
    src: url('../fonts/MadeTommy-Bold.otf') format('opentype'); 
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'The Sans';
    src: url('../fonts/TheSans-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* 2. ESTILOS GLOBALES BLANCO Y NEGRO */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'The Sans', sans-serif; 
    background-color: #ffffff; 
    color: #000000; 
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Made Tommy', sans-serif; 
    font-weight: bold;
    color: #000000;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

/* HEADER Y NAVEGACIÓN GLOBAL */
header {
    background-color: #000000;
    color: #ffffff;
    padding: 20px 0;
    text-align: center;
    border-bottom: 4px solid #333333;
}

header h1 {
    color: #ffffff;
    margin-top: 10px;
    margin-bottom: 0;
}

.global-nav {
    background-color: #f9f9f9;
    text-align: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eeeeee;
}

.global-nav a {
    color: #000000;
    text-decoration: none;
    font-family: 'Made Tommy', sans-serif;
    font-weight: bold;
    font-size: 0.85em;
    margin: 0 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: inline-block;
}

.global-nav a:hover {
    color: #666666;
    transform: translateY(-2px);
}

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

/* ESTILOS DE BOTONES */
.btn {
    display: inline-block;
    background-color: #000000;
    color: #ffffff;
    padding: 15px 30px;
    text-decoration: none;
    font-weight: bold;
    font-family: 'Made Tommy', sans-serif;
    border: 2px solid #000000;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    background-color: #ffffff;
    color: #000000;
}

.btn-outline-dark {
    display: inline-block;
    background-color: transparent;
    color: #000000;
    padding: 15px 30px;
    text-decoration: none;
    font-weight: bold;
    font-family: 'Made Tommy', sans-serif;
    border: 2px solid #000000;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.btn-outline-dark:hover {
    background-color: #000000;
    color: #ffffff;
}

.btn-back {
    display: inline-block;
    margin-bottom: 20px;
    color: #000000;
    text-decoration: none;
    font-weight: bold;
    border-bottom: 1px solid #000000;
}

/* SECCIÓN PORTADA (GRID 10 FOTOS) */
.concept-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); 
    gap: 15px;
    margin: 40px 0;
}

a.concept-box {
    text-decoration: none;
    cursor: pointer;
    position: relative;
    height: 200px;
    border-radius: 4px;
    overflow: hidden;
    background-color: #000; 
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

a.concept-box:hover {
    transform: translateY(-5px);
}

a.concept-box img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

a.concept-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65); 
    z-index: 2;
    transition: background 0.3s ease;
}

a.concept-box:hover::after {
    background: rgba(0, 0, 0, 0.4); 
}

a.concept-box span {
    position: relative;
    z-index: 3;
    color: #ffffff;
    font-family: 'Made Tommy', sans-serif;
    font-size: 1.1rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 10px;
}

/* NAVEGACIÓN INFERIOR DIVIDIDA (Ahora 3 columnas) */
.split-navigation {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.nav-card {
    background-color: #ffffff;
    border: 2px solid #000000;
    padding: 40px 30px;
    text-align: center;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.nav-card:hover {
    background-color: #000000;
    color: #ffffff;
}

.nav-card:hover h2, .nav-card:hover p {
    color: #ffffff;
}

.nav-card .btn {
    width: 100%;
}

/* ESTILOS DE LANDINGS INTERIORES */
.sub-page {
    max-width: 825px;
}

.hero-section {
    text-align: center;
    padding: 0 0 40px 0;
    margin-bottom: 30px;
}

.hero-image {
    width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 30px;
    border: 1px solid #eeeeee;
}

.value-props {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.prop-card {
    background: #fcfcfc;
    padding: 20px;
    border-left: 5px solid #000000;
    border-radius: 0 4px 4px 0;
    border-top: 1px solid #eeeeee;
    border-right: 1px solid #eeeeee;
    border-bottom: 1px solid #eeeeee;
}

.form-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #000000;
    text-align: center;
}

.iframe-container {
    margin-top: 20px;
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #eeeeee;
}

/* ESTILOS FOOTER Y FORMULARIOS DUALES */
.footer-image-wrapper {
    width: 100%;
    margin-top: 40px;
    line-height: 0;
    background-color: #000;
}
.footer-image-wrapper img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.dual-forms {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 40px;
    border-top: 2px solid #000;
    padding-top: 40px;
}
.form-col h3 {
    text-align: center;
    font-size: 1.3em;
    margin-bottom: 10px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .concept-grid {
        grid-template-columns: repeat(2, 1fr); 
    }
    .dual-forms {
        grid-template-columns: 1fr;
    }
    .global-nav a {
        display: block;
        margin: 10px 0;
    }
}

@media (max-width: 480px) {
    .concept-grid {
        grid-template-columns: 1fr;
    }
    a.concept-box {
        height: 150px;
    }
}

/* ────────────────────────────────────────────────────────────────────
   MOBILE RESPONSIVE GLOBAL
   ────────────────────────────────────────────────────────────────────
   Reglas defensivas para que la app funcione bien en celulares sin
   tener que tocar el HTML/CSS de cada página. Uso !important donde
   sobreescribo estilos inline frecuentes (width:1000px de containers,
   modals con max-width fijo, etc.).
*/

@media (max-width: 768px) {
    /* Contenedor principal: ancho completo con padding suave */
    body { font-size: 15px; }
    .container { padding: 16px !important; max-width: 100% !important; }
    .sub-page { max-width: 100% !important; }

    /* Inputs: que ocupen todo el ancho del form */
    input[type="text"], input[type="email"], input[type="password"],
    input[type="tel"], input[type="number"], input[type="date"],
    input[type="search"], select, textarea {
        width: 100% !important; box-sizing: border-box; max-width: 100% !important;
    }

    /* Grids 2 cols → 1 col */
    .grid-2, .grid-3 { grid-template-columns: 1fr !important; }
    .dual-forms { grid-template-columns: 1fr !important; }

    /* Tablas: scroll horizontal en vez de romper el layout */
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Nav global: stack vertical */
    .global-nav { flex-wrap: wrap; }
    .global-nav a { display: inline-block; margin: 4px 8px 4px 0; }

    /* Botones con tap target razonable (40px mín. recomendado por iOS) */
    .btn, .btn-small, .btn-outline-dark, button { min-height: 38px; }

    /* Modales (CRM, eliminar, etc.): ancho casi completo de viewport */
    .modal-backdrop > div, .modal-content {
        width: 96vw !important; max-width: 96vw !important;
        max-height: 92vh !important; margin: 4vh 2vw !important;
        box-sizing: border-box;
    }

    /* ── Vista de propuesta (proposal_view.html) ── */
    /* Cada .page renderizada como hoja carta no entra en pantalla móvil.
       La forzamos a ocupar el ancho disponible y dejar que el alto
       crezca según contenido. La hoja se "ve" mal proporcionada pero
       legible. Para el PDF/Word la generación sigue usando las
       dimensiones reales porque html2canvas y docx miden el DOM con
       sus dimensiones intrínsecas. */
    .pages-wrap { padding: 8px 8px 40px !important; gap: 12px !important; }
    .page {
        width: 100% !important; min-width: 0 !important;
        min-height: 0 !important; height: auto !important;
        padding: 14px 16px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    }
    .cover { min-height: auto !important; }
    .cover .title-main { font-size: 2em !important; }
    .cover .company { font-size: 1.4em !important; }
    .cover .program-subtitle { font-size: 1em !important; }
    .page h1.proposal-title { font-size: 1.6em !important; }
    .page h2 { font-size: 1.15em !important; }

    /* Meta strip del slide de opción: 2 columnas */
    .meta-strip { grid-template-columns: repeat(2, 1fr) !important; }

    /* Opt-cols (entregables/objetivos): apilados */
    .opt-cols { grid-template-columns: 1fr !important; }

    /* Toolbar superior de proposal_view: stack vertical */
    .toolbar { flex-direction: column !important; align-items: stretch !important; gap: 8px !important; }
    .toolbar .actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start; }
    .toolbar .actions a, .toolbar .actions button {
        flex: 1 1 auto; text-align: center; font-size: 0.85em;
    }

    /* ── Wizard de propuesta (proposal_form.html) ── */
    .stepper { overflow-x: auto; flex-wrap: nowrap !important; gap: 4px !important; }
    .stepper .step { min-width: 110px; font-size: 0.78em; }
    .add-option-bar { position: static !important; }
    .add-option-bar select { width: 100%; min-width: 0 !important; }
    .option-card { padding: 12px !important; }
    .nav-actions { flex-direction: column !important; gap: 10px; }
    .nav-actions .left, .nav-actions .right { display: flex; gap: 6px; }
    .nav-actions button { flex: 1; }

    /* ── CRM (crm.html) ── */
    .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
    .kpi-card { padding: 10px !important; }
    .kpi-num { font-size: 1.6em !important; }
    .tabs-nav { overflow-x: auto; flex-wrap: nowrap !important; }
    .extra-contact-row { grid-template-columns: 1fr !important; }

    /* Footer fixed bottom mobile-friendly */
    footer { padding: 16px !important; font-size: 0.85em; }
}

@media (max-width: 480px) {
    body { font-size: 14px; }
    .container { padding: 12px !important; }
    .kpi-grid { grid-template-columns: 1fr !important; }
    .meta-strip { grid-template-columns: 1fr !important; }
    .global-nav a { display: block; margin: 6px 0 !important; }
    .toolbar .actions { flex-direction: column; }
    .toolbar .actions a, .toolbar .actions button { width: 100%; }
    .cover .title-main { font-size: 1.6em !important; }
    .stepper .step { min-width: 90px; font-size: 0.72em; }
}