/* Estilos Generales */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 160px;
    overflow-x: hidden; /* Previene el scroll horizontal */
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    overflow-x: hidden; /* Previene el scroll horizontal */
    position: relative; /* Asegura que el contenido se mantenga dentro */
    width: 100%; /* Asegura que el body ocupe todo el ancho disponible */
}

/* Ocultar el botón de menú en escritorio */
.menu-toggle {
    display: none;
}

/* Header */
header {
    background-color: #555555;
    color: #ffffff;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed; /* Hace que el header quede fijo en la parte superior */
    top: 0;
    left: 0;
    width: 100%; /* Ocupa todo el ancho de la página */
    z-index: 1000; /* Se asegura de que esté por encima del resto del contenido */
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2); /* Añade un efecto de sombra */
}

header h1 {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
    display: flex;
    align-items: center;
}

.header-title {
    font-size: 32px;
    margin-left: 20px;
    color: #ffffff;
}

header nav {
    display: flex;
    gap: 20px;
    margin-left: auto;
}

header nav a {
    /* Estilos para los botones de navegación */
    display: inline-block;
    width: 120px;
    height: 40px;
    background-color: #7c0a0a;
    color: #ffffff;
    text-align: center;
    line-height: 40px;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
    border-radius: 30px; /* Botones redondeados */
    transform: translateX(-50px); /* Mueve cada botón 50px a la izquierda */
}

/* Ajuste de margen para el contenido principal */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    padding: 50px;
    max-width: 900px;
    margin: 120px auto 20px; /* Añade margen superior para no superponerse con el header */
    margin-bottom: 80px; /* Ajustar el margin-bottom del main-content para dejar espacio al footer */
    align-items: start; /* Alinea los elementos hijos arriba */
}

/* Estilos de Secciones */
#inicio, #acerca-de-mi, #experiencia, #idiomas, #traduccion-jurada {
    background-color: #7c0a0a;
    border-radius: 40px;
    padding: 30px 20px; /* Aumentamos el padding superior */
    color: white;
    font-size: 18px;
}

#acerca-de-mi {
    height: 300px;
    width: 660px;
    margin-left: -320px; /* Cambiado de -360px a -100px */
    border-radius: 75px;
}

#experiencia {
    grid-column: span 2;
    height: 300px;
    width: 1050px;
    margin-left: -100px;
    border-radius: 75px;
}

#idiomas {
  /* Quita height y min-height para que la sección crezca según el contenido */
  /* height: 300px; */
  /* min-height: 300px; */
  width: 660px;
  margin-left: -100px;
  border-radius: 75px;
}

#traduccion-jurada {
    grid-column: span 2;
    min-height: 340px;
    width: 1010px;      /* Igual que #experiencia */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    margin-left: -100px; /* Igual que #experiencia */
    border-radius: 75px;
    padding: 35px 40px 35px 40px;
    position: relative;
}

#traduccion-jurada h2 {
    text-align: left;
    margin: 0 0 18px 0;
    font-size: 2rem;
}

#traduccion-jurada p {
    text-align: left;
    margin: 0 0 22px 0;
    font-size: 1.08rem;
    width: 100%;
}

#traduccion-jurada p + p {
    margin-top: 22px; /* Espacio extra entre los dos textos */
}

#solicitar-presupuesto {
    align-self: center;
    margin: 48px 0 0 0;
    display: block;
    background-color: #ffffff;
    color: #7c0a0a;
    padding: 18px 48px;
    border-radius: 35px;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: bold;
    margin-left: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: background 0.2s, color 0.2s;
}

/* Botón */
#solicitar-presupuesto {
    background-color: #ffffff;
    color: #7c0a0a;
    padding: 10px 25px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    margin-left: 40px;
}

/* Espacio para Imágenes */
.imagen-placeholder {
    background-color: #cccccc;
    border-radius: 50%;
    width: 360px;
    height: 360px;
    margin-left: -100px;
    overflow: hidden; /* Asegura que la imagen no se salga del círculo */
    display: flex; /* Para centrar la imagen */
    align-items: center;
    justify-content: center;
}

.imagen-placeholder picture, .imagen-placeholder-two picture {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 0; /* El recorte lo hace el contenedor */
}

.imagen-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Mantiene la proporción y cubre todo el espacio */
    display: block; /* Evita el gap de línea base que puede cortar visualmente los bordes */
}

/* Espacio para segunda imagen */
.imagen-placeholder-two {
    width: 380px;
    height: 380px;
    border-radius: 75px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(70px); /* Mueve la imagen a la derecha para alinearla */
}

.imagen-placeholder-two img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block; /* Evita espacio extra arriba/abajo en imágenes inline */
    border-radius: 0; /* El recorte lo hace el contenedor */
}

.thank-you-message {
    text-align: center;
    margin-top: 100px;
}

.thank-you-message h2 {
    font-size: 24px;
    color: #7c0a0a;
}

.thank-you-message p {
    font-size: 18px;
    color: #555555;
}

.thank-you-message button {
    background-color: #7c0a0a;
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: auto; /* Adjust width to fit content */
    position: relative;
    border-radius: 10px;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.close-button {
    position: absolute;
    right: 20px;
    top: 10px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

close-button:hover {
    color: #000;
}

/* Formulario */
form {
    background: #ffffff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 450px; /* Ancho fijo */
    margin: auto;
    position: relative;
}

#question2-container, 
#destination-language-container, 
#question3-container {
    width: 100%;
    margin-bottom: 15px;
}

input, 
select {
    box-sizing: border-box;
    display: block;
    width: 100%;
    padding: 10px 15px;
    margin-bottom: 15px;
    border: 2px solid #7c0a0a;
    border-radius: 20px;
    color: #7c0a0a;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
    font-size: 14px;
}

select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%237c0a0a%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px auto;
    padding-right: 30px;
}

input[type="file"] {
    padding: 8px 15px;
    background-color: initial;
    color: initial;
    border: 2px solid #7c0a0a;
}

input[type="file"]::-webkit-file-upload-button {
    visibility: visible;
    display: initial;
}

input[type="file"]::before {
    content: none;
}

button {
    padding: 10px 20px;
    background-color: #7c0a0a;
    color: #ffffff;
    border: none;
    border-radius: 20px; /* Bordes más redondeados */
    cursor: pointer;
}

button:hover {
    background-color: #5a0808;
}

#submit-button {
    display: none;
    width: auto;  /* Cambiado de 100% a auto */
    padding: 12px 20px;
    margin-top: 15px;
}

/* Add this to your existing CSS file */
#fileAttachment {
    background-color: white;
    border: 2px solid #7c0a0a;
    border-radius: 25px;
    padding: 8px;
    width: 100%;
    box-sizing: border-box;
    color: #333;
    cursor: pointer;
}

#fileAttachment::-webkit-file-upload-button {
    background: white;
    border: 1px solid #7c0a0a;
    border-radius: 20px;
    padding: 3px 12px;
    color: #7c0a0a;
    cursor: pointer;
}

#fileAttachment::file-selector-button {
    background: white;
    border: 1px solid #7c0a0a;
    border-radius: 20px;
    padding: 3px 12px;
    color: #7c0a0a;
    cursor: pointer;
}

#thank-you-message {
    text-align: center;
    margin-top: 20px;
    color: #7c0a0a;
}

#thank-you-message h2 {
    font-size: 20px;
    margin-bottom: 10px;
}

#thank-you-message p {
    font-size: 16px;
}

.error-message {
    color: #ff0000;
    font-size: 14px;
    margin-top: -10px;
    margin-bottom: 15px;
    display: none;
}

.input-error {
    border-color: #ff0000 !important;
}

/* Estilos para la barra de progreso del formulario */
.progress-container {
    width: calc(100% - 40px);
    background-color: #e0e0e0;
    border-radius: 5px;
    margin-bottom: 20px;
}

.progress-bar {
    width: 0%;
    height: 15px;
    background-color: #8B0000; /* Color granate */
    border-radius: 5px;
    text-align: center;
    color: white;
    line-height: 15px; /* Centra el texto si se añade */
    transition: width 0.4s ease-in-out;
}

/* Footer */
footer {
    background-color: #555555;
    color: #ffffff;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-shadow: 0px -4px 6px rgba(0, 0, 0, 0.2);
}

footer p {
    margin: 20px;
    font-size: 16px;
    font-weight: bold;
}

/* Media Queries para Responsive Design */
@media screen and (max-width: 850px) {
    /* Header y navegación */
    header {
        flex-direction: column;
        text-align: center;
        padding: 0 20px;
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 1000;
        height: 70px;
        display: flex;
        align-items: center;
    }

    header h1 {
        display: flex;
        align-items: center;
        margin: 0;
        width: 100%;
        justify-content: flex-start;
        padding-left: 20px;
        height: 100%;
        align-items: center;
    }

    header h1 img {
        width: 50px;
        height: 50px;
        margin-left: 0;
    }

    header nav {
        flex-direction: column;
        width: 100%;
        gap: 10px;
        margin-top: 10px;
    }

    header nav a {
        display: block;
        width: 200px; /* Ancho fijo para todos los dispositivos móviles */
        transform: none;
        margin: 8px auto;
        background-color: #7c0a0a;
        padding: 8px 0;
        height: auto;
        line-height: normal;
        font-size: 14px; /* Tamaño de fuente consistente */
    }

    .header-title {
        font-size: 20px;
        margin: 0;
        margin-left: 15px;
    }

    .menu-toggle {
        display: block !important;
        position: absolute;
        right: 45px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        outline: none;
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        padding: 0;
        margin: 0;
        color: white;
        font-size: 24px;
        cursor: pointer;
        z-index: 1001;
        appearance: none;
    }

    .menu-toggle:active,
    .menu-toggle:focus,
    .menu-toggle:hover,
    .menu-toggle::after,
    .menu-toggle::before {
        background: none;
        outline: none;
        border: none;
        box-shadow: none;
        -webkit-tap-highlight-color: transparent;
    }

    .menu-toggle * {
        -webkit-tap-highlight-color: transparent;
    }

    .nav-menu {
        position: fixed;           /* Se superpone, no empuja */
        top: 50px;                 /* Altura exacta de tu header */
        left: 0;
        width: 100%;
        background-color: #ffffff;
        overflow: hidden;          /* Oculta al cerrar */
        max-height: 0;             /* Altura colapsada */
        transform: translateY(-20px);
        opacity: 0;
        transition:
          max-height 0.4s ease-in-out,
          transform 0.4s ease-in-out,
          opacity 0.4s ease-in-out;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: 999;
    }
    .nav-menu.active {
        max-height: 500px;         /* Suficiente para tus 4 botones */
        transform: translateY(0);
        opacity: 1;
    }

    .main-content {
        display: flex;
        flex-direction: column;
        align-items: center; /* Centra todos los elementos hijos horizontalmente */
        gap: 20px;
        padding: 10px 20px;
        margin-top: 90px;
        margin-left: auto;
        margin-right: auto;
        max-width: 95%; /* Limita el ancho máximo */
    }

    #acerca-de-mi,
    #experiencia,
    #idiomas,
    #traduccion-jurada {
        width: 100%;
        margin-left: auto;
        margin-right: auto;
        /* Quita height/min-height aquí también */
        /* height: auto; */
        /* min-height: 300px; */
        border-radius: 40px;
        padding: 20px;
        box-sizing: border-box;
        max-width: 800px; /* Limita el ancho máximo */
    }

    .main-content .imagen-placeholder {
        width: 220px; /* Reducimos un poco más el tamaño */
        height: 220px;
        border-radius: 50%;
        /* Técnica simple pero efectiva de centrado */
        display: block;
        margin-top: 20px !important;
        margin-bottom: 20px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        /* Eliminar cualquier efecto previo de posicionamiento */
        position: static;
        left: auto;
        transform: none;
        /* Asegurar el contenido */
        overflow: hidden;
        box-sizing: border-box;
    }

    .main-content .imagen-placeholder img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .main-content .imagen-placeholder-two {
        width: 100%; /* Ocupar todo el ancho disponible */
        height: 250px;
        border-radius: 40px;
        margin: 0 auto !important;
        margin-left: auto !important;
        overflow: hidden;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        box-sizing: border-box;
    }

    form {
        width: 90%;
        padding: 20px;
        margin: 10px;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    input, 
    select {
        font-size: 16px;
    }

    footer p {
        margin: 10px;
        font-size: 12px; /* Reducido un 25% del tamaño original de 16px */
    }
}

/* Nuevo Media Query para orientación horizontal en móviles */
@media screen and (max-width: 900px) and (orientation: landscape) {
    .main-content {
        margin-top: 90px;
        padding: 20px 40px;
        max-width: 90%;
    }

    #acerca-de-mi,
    #experiencia,
    #idiomas,
    #traduccion-jurada {
        width: 90%;
        margin: 0 auto;
        padding: 25px;
    }

    .main-content .imagen-placeholder,
    .main-content .imagen-placeholder-two {
        width: 200px;
        height: 200px;
        margin: 20px auto !important;
        margin-left: auto !important; /* Sobrescribe el margin-left: -100px del CSS base */
    }

    header {
        height: 60px;
    }

    .header-title {
        font-size: 18px;
    }
}

/* Media Query para dispositivos muy pequeños */
@media screen and (max-width: 480px) {
    header h1 img {
        width: 40px;
        height: 40px;
    }

    .header-title {
        font-size: 18px;
    }

    header nav a {
        /* Eliminamos las propiedades específicas de ancho y altura aquí,
           ya que queremos que hereden del media query anterior */
        font-size: 14px;
    }
}

/* Tabla de idiomas (estilo invertido y más grande) */
.idiomas-table {
    border-collapse: separate;
    border-spacing: 0;
    background-color: #fff;
    margin: 0 auto;
    font-size: 18px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 40px;
    border-radius: 24px;
    overflow: hidden;
}
.idiomas-table th, .idiomas-table td {
    padding: 18px 28px;
    font-size: 18px;
    vertical-align: middle;
}
.idiomas-table th {
    background-color: #111;
    color: #fff;
    border: 1px solid #111;
    text-align: left;
}
.idiomas-table td {
    background-color: #fff;
    color: #111;
    border: 1px solid #111;
    vertical-align: top;
}
/* Bordes redondeados solo en las esquinas exteriores */
.idiomas-table th:first-child {
    border-top-left-radius: 40px;
}
.idiomas-table th:last-child {
    border-top-right-radius: 40px;
}
.idiomas-table tr:last-child td:first-child {
    border-bottom-left-radius: 40px;
}
.idiomas-table tr:last-child td:last-child {
    border-bottom-right-radius: 40px;
}

@media screen and (max-width: 900px) {
    .idiomas-table, .idiomas-table th, .idiomas-table td {
        font-size: 15px;
        padding: 10px 8px;
    }
    .idiomas-table {
        max-width: 100%;
        height: auto; /* Quita la altura fija también en móvil */
    }
}

/* Ajuste para que la tabla se vea bien en la sección */
#idiomas {
    background: none;
    color: inherit;
    padding: 30px 0 0 0;
}
#idiomas h2 {
    color: #7c0a0a;
    text-align: left;
    margin-bottom: 24px;
    margin-left: 0;
    padding-left: 0;
}

/* Nueva sección para idiomas en grid */
.idiomas-grid {
    display: grid;
    grid-template-columns: 1fr auto; /* Columna 1 flexible, Columna 2 automática */
    gap: 40px;
    align-items: start; /* Alinea tabla e imagen en la parte superior */
    width: 100%; /* Asegura que el grid ocupe todo el ancho de la sección */
}

@media screen and (max-width: 900px) {
    .idiomas-grid {
        display: flex;
        flex-direction: column;
        gap: 0; /* Eliminar espacio entre elementos */
        width: 100%; /* Asegurar que ocupe todo el ancho */
    }

    #acerca-de-mi,
    #experiencia {
        height: auto; /* Asegura que la altura se ajuste al contenido */
        min-height: 0; /* Resetea cualquier altura mínima si la hubiera */
    }
}

/*
==============================================
LANGUAGE ACCORDION
==============================================
*/

/* Desktop: Two-column layout resembling the original table */
.language-accordion {
    background-color: #fff;
    width: 600px;
    height: 380px; /* Altura fija idéntica a la imagen */
    margin: 0;
    font-size: 18px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid #111;
    display: flex;
    flex-direction: column;
}

.language-item {
    flex-grow: 1; /* Estira la fila para ocupar el espacio vertical */
    display: flex; /* Convierte la fila en un contenedor flex para sus celdas */
    border-bottom: 1px solid #111;
}

.language-item:last-child {
    border-bottom: none;
}

.language-header {
    flex-basis: 30%;
    flex-shrink: 0;
    padding: 18px 28px;
    border-right: 1px solid #111; /* Línea vertical */
    display: flex;
    align-items: center; /* Centra el texto verticalmente */
    cursor: default;
}

.language-header:hover {
    background-color: transparent; /* Sin efecto hover */
}

.language-services {
    flex-basis: 70%;
    padding: 18px 28px;
    display: flex;
    align-items: center; /* Centra el texto verticalmente */
}

.language-header .arrow {
    display: none;
}

/* Mobile: Accordion style */
@media screen and (max-width: 900px) {

    /* Apply changes only to mobile devices detected by JS */
    body.mobile .idiomas-grid {
        display: flex;
        flex-direction: column;
        align-items: stretch; /* Estira los elementos para llenar el espacio */
        gap: 0;
        width: 100%;
        padding: 0;
        margin: 0;
    }

    body.mobile .language-accordion {
        width: 100%;
        height: auto;
        border: 1px solid #cccccc; /* Borde unificado para la tabla */
        border-radius: 30px; /* Bordes más redondeados */
        box-shadow: none;
        background-color: transparent;
        overflow: hidden; /* Para que los hijos respeten el border-radius */
        margin: 0 auto 20px auto; /* Centrar la tabla y añadir margen inferior */
    }

    body.mobile .imagen-placeholder-two {
        width: 100%; /* Ocupar todo el ancho disponible */
        display: block;
        margin: 0 auto !important; /* Centrado horizontal */
        margin-left: auto !important; /* Sobrescribir cualquier margin-left */
        margin-right: auto !important;
        padding: 0;
        /* La técnica que funcionó previamente */
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 40px;
    }
    
    body.mobile .imagen-placeholder-two img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }

    body.mobile #idiomas {
        width: 100%;
        margin-left: 0;
        padding: 0;
        background: none;
    }

    body.mobile .language-item {
        display: flex;
        flex-direction: column;
        border: none; /* Eliminamos el borde individual */
        border-bottom: 1px solid #cccccc; /* Línea separadora */
        margin-bottom: 0; /* Eliminamos el margen */
        overflow: hidden;
    }

    body.mobile .language-item:last-child {
        border-bottom: none; /* La última fila no necesita borde inferior */
    }

    body.mobile .language-header {
        border-right: none;
        cursor: pointer;
        background-color: #fff;
        padding: 15px 40px 15px 15px; /* Add padding to the right for the arrow */
        width: 100%;
        box-sizing: border-box;
        position: relative; /* Needed to position the arrow */
    }

    body.mobile .language-header .arrow {
        display: block;
        position: absolute;
        top: 50%;
        right: 15px;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-top: 6px solid #7c0a0a; /* Arrow color */
        transition: transform 0.35s ease-in-out;
    }

    body.mobile .language-item.active .language-header .arrow {
        transform: translateY(-50%) rotate(180deg);
    }

    body.mobile .language-services {
        display: block; /* Important: override desktop 'display:flex' */
        max-height: 0;
        overflow: hidden;
        padding: 0 15px;
        background-color: #f9f9f9;
        border-top: 1px solid #cccccc;
        transition: max-height 0.35s ease-in-out, padding 0.35s ease-in-out;
    }

    body.mobile .language-services.open {
        max-height: 100px; /* Adjust if content is taller */
        padding: 15px;
    }
}

/* Fix para imagen cuadrada en horizontal (móvil) */
@media screen and (max-width: 900px) and (orientation: landscape) {
    body.mobile .imagen-placeholder-two {
        width: 250px;
        height: 250px;
        margin: 20px auto !important; /* Centrado y con margen vertical */
        /* Reseteamos el posicionamiento para evitar conflictos */
        position: static;
        left: auto;
        transform: none;
    }
}
