/* =========================
   BASE Style.css (Corregido para móvil)
========================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #121212;
    color: #fff;
    font-family: Arial, sans-serif;
    overflow-x: hidden;
}

.clearfix:before,
.clearfix:after {
    content: " ";
    display: table;
}
.clearfix:after {
    clear: both;
}
.clearfix {
    *zoom: 1;
}

/* =========================
   APP WRAPPER EXTERIOR
========================= */
.app-wrapper1 { 
    max-width: 1800px; 
    margin: 40px auto;
    background: #1e1e1e;
    border: 2px solid #ff9800;
    border-radius: 16px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.7);
    padding: 20px;
}

/* =========================
   APP WRAPPER INTERIOR (CONTENIDO)
========================= */
.app-wrapper {
    max-width: 1400px;
    margin: auto;
    background: #1e1e1e;
    border-radius: 16px;
    padding: 20px;
}

/* =========================
   HEADER
========================= */
.header {
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
    height: 120px;
    padding: 20px 30px;
    border-bottom: 2px solid #ff9800;
    background: #1e1e1e;
    box-sizing: border-box;
    display: flex; /* Nuevo: Activa el sistema flexible */
    align-items: center; /* Nuevo: Centra el logo y el menú verticalmente */
}
/* =========================
   WEB – AJUSTE MENÚ LOGO
========================= */
.nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    width: 100%; /* Nuevo: Ocupa todo el ancho disponible */
}

/* =========================
   LOGO GRANDE – centrado verticalmente
========================= */
/* =========================
   LOGO GRANDE – centrado verticalmente
========================= */
.logo {
    /* Ya no es necesario position, top o transform gracias a Flexbox en el .header */
    left: auto;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 200px;  /* altura más grande que antes */
    width: auto;   /* mantiene proporción */
    display: block;
}

.logo-text {
    margin-left: 10px;       /* separa el texto de la imagen */
    font-size: 1.6em;        /* más grande para destacar */
    font-weight: bold;
    color: #ff9800;
    line-height: 1;
}

/* Opcional: ajustar el link del logo para que no estire el header */
.header .logo {
    display: inline-flex;
    align-items: center;
    margin-right: 20px;
}


/* =========================
   MENÚ HORIZONTAL
========================= */
.menu {
    /* Ajuste para mover el menú ligeramente hacia arriba en la versión de escritorio */
    margin-top: -15px; /* Ajusta este valor (ej: -10px, -20px) para subirlo más o menos */
    list-style: none;
    display: flex;
    gap: 25px;
    margin: 0;
    padding: 0;
}

.menu li {
    position: relative;
}

.menu a {
    color: #ff9800;
    text-decoration: none;
    font-weight: bold;
    padding: 8px 14px;
    border-radius: 6px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.menu a i {
    font-size: 16px;
}

.menu a:hover,
.menu a.active {
    background: linear-gradient(45deg,#ff9800,#ffc107);
    color: #121212;
}

/* Submenús desplegables */
.menu li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #1e1e1e;
    border-radius: 8px;
    min-width: 180px;
    z-index: 1000;
    padding: 0;
}

.menu li:hover > ul {
    display: block;
}

.menu li ul li a {
    padding: 10px 15px;
    border-bottom: 1px solid #2c2c2c;
    display: block;
}

.menu li ul li a:hover {
    background: linear-gradient(45deg,#ff9800,#ffc107);
    color: #121212;
}

/* =========================
   CONTENIDO DE PÁGINA
========================= */
.page-wrapper {
    padding: 40px 30px;
    max-width: 1140px;
    margin: auto;
}

.main {
    max-width: 1200px;
    margin: auto;
    padding: 40px 50px;
    background: #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

.main h2 {
    text-align: center;
    color: #ff9800;
    margin-bottom: 30px;
}

/* =========================
   OCR
========================= */
.container {
    max-width: 1100px;
    margin: auto;
    background: #1e1e1e;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

.container h2 {
    text-align: center;
    color: #ff9800;
    margin-bottom: 30px;
}

form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    width: 100%;
}

/* =========================
   HISTORIAL
========================= */
.history-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

.history {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 15px 0;
    border-top: 1px solid #ff9800;
    border-bottom: 1px solid #ff9800;
    scroll-behavior: smooth;
}

.history img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid #ff9800;
    border-radius: 6px;
    transition: 0.3s;
}

.history img:hover {
    border-color: #ffc107;
    transform: scale(1.05);
}

/* =========================
   ELEMENTOS COMUNES
========================= */
input, textarea, select {
    background: #2c2c2c;
    color: #fff;
}

button {
    background: linear-gradient(45deg,#ff9800,#ffc107);
    color: #121212;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
    transition: 0.3s;
}

button:hover {
    background: linear-gradient(45deg,#ffc107,#ff9800);
}

/* =========================
   FOOTER
========================= */
.footer {
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
    padding: 20px 30px;
    border-top: 2px solid #ff9800;
    text-align: center;
    box-sizing: border-box;
}

/* =========================
   HEADER + MENU MOBILE – UNIFICADO (Ajustado)
========================= */
@media (max-width: 900px) {

    /* HEADER */
    .header {
        padding: 5px 10px;
        border-bottom-width: 1px;
        height: auto; /* Altura automática para que no quede espacio abajo */
    }

    /* LOGO */
    .logo {
        position: relative;
        left: auto;
        /* margin-bottom: 5px;  <-- Eliminado, el gap del NAV gestiona el espacio */
    }

    .logo-img {
        height: 100px; /* Logo más pequeño en móvil */
        width: auto;
    }

    /* NAV GENERAL */
    .nav {
        flex-direction: column;
        gap: 0px; /* Reduce la separación entre el logo y el menú a cero */
        align-items: center;
        justify-content: flex-start;
    }

    /* MENU CLÁSICO */
    .menu {
        flex-direction: column;
        gap: 0px; /* Reduce la separación entre elementos del menú a cero */
        width: 100%;
        text-align: center;
        margin-top: 0;
    }

    .menu li a {
         padding: 5px 10px; /* Padding más compacto para los enlaces */
        font-size: 0.9em;
    }

    .menu a i {
        font-size: 14px;
    }

    /* DOCK MENU (No incluido en el CSS base que me has pasado) */

    /* CONTENIDO PÁGINA */
    .page-wrapper {
        padding: 25px 20px;
    }

    .main {
        padding: 25px;
    }
}
