/* CSS - Estilo para el generador de documentos */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

/* Scroll */
::-webkit-scrollbar {
    width: 10px; /* o el tamaño que prefieras */
}

::-webkit-scrollbar-thumb {
    background-color: #056bd8; /* Color del "dedo" del scrollbar */
    border-radius: 4px;
}

::-webkit-scrollbar-track {
    background: #fff; /* Color del fondo del track */
}

body {
    font-family: 'Arial', sans-serif;
    background-color: rgb(244, 247, 252);
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
}

/* Links */
.link__distancia {
    position: fixed;
    top: 30px;
    right: 20px;
    font-size: 14px;
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    background-color: #fff;
    padding: 8px 16px;
    border-radius: 5px;
    box-shadow: 0 0 5px #0003;
    transition: all 0.3s ease;
}

.link__incoterms {
    position: fixed;
    top: 30px;
    left: 20px;
    font-size: 14px;
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    background-color: #fff;
    padding: 8px 16px;
    border-radius: 5px;
    box-shadow: 0 0 5px #0003;
    transition: all 0.3s ease;
}

.link__divisas {
    position: fixed;
    top: 70px;
    right: 20px;
    font-size: 14px;
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    background-color: #fff;
    padding: 8px 16px;
    border-radius: 5px;
    box-shadow: 0 0 5px #0003;
    transition: all 0.3s ease;
}

.link__divisas i {
    margin-left: 8px;
    font-size: 16px;
}

.link__tests {
    position: fixed;
    top: 70px;
    left: 20px;
    font-size: 14px;
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    background-color: #fff;
    padding: 8px 16px;
    border-radius: 5px;
    box-shadow: 0 0 5px #0003;
    transition: all 0.3s ease;
}

.link__tests i {
    margin-left: 8px;
    font-size: 16px;
}

.link__peso i {
    margin-left: 8px;
    font-size: 16px;
}

.link__peso {
    position: fixed;
    top: 110px;
    left: 20px;
    font-size: 14px;
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    background-color: #fff;
    padding: 8px 16px;
    border-radius: 5px;
    box-shadow: 0 0 5px #0003;
    transition: all 0.3s ease;
}

.link__distancia:hover, .link__incoterms:hover, .link__divisas:hover, .link__tests:hover, .link__peso:hover {
    background-color: #007bff;
    color: #fff;
    transform: scale(1.1);
}
/* Main */
.container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    padding: 20px 50px;
    width: 700px;       
    max-width: 100%;          
    margin: 30px auto;
    margin-bottom: 60px; 
}

h1 {
    font-size: 28px;
    color: rgb(0, 123, 255);
    margin-bottom: 20px;
}

textarea, select, input {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 16px;
    margin-top: 5px;
    text-align: center;
}

.form-group {
    margin: 10px 0 10px 0;
}

.invisible {
    display: none;
}

.iva {
    margin-left: -14px;
}

#mercanciaContainer {
    margin-top: 20px;
    width: fit-content;
    max-width: 100%;
}

h4 {
    margin-top: 5px;
    font-size: 18px;
    color: rgb(0, 123, 255);
    margin-bottom: 15px;
}

#mercanciasList ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#mercanciasList li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background-color: #cee2f6;
    margin-bottom: 10px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    font-size: 16px;
    max-width: 100%;
}

#mercanciasList li span {
    flex: 1;
    text-align: center;
}

#mercanciasList .descripcion {
    font-weight: bold;
    color: #333;
}

#mercanciasList .removeMercancia {
    cursor: pointer;
    color: red;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
}

#mercanciasList .removeMercancia:hover {
    color: #cc0000;
    transform: scale(1.1);
}

#addMercanciaBtn {
    display: block;
    margin: 20px auto;
    padding: 8px 16px;
    background-color: rgb(193, 220, 249);
    color: #0651a1;
    font-size: 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#addMercanciaBtn:hover {
    background-color: #007bff;
    color: white;
}

#addMercanciaBtn:active {
    background-color: rgb(2, 56, 129);
}

#instructions {
    font-size: 14px;
    color: #666;
    text-align: center;
    margin-top: 15px;
    font-style: italic;
}

button {
    width: fit-content;
    padding: 12px;
    background-color: rgb(0, 123, 255);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
    white-space: nowrap;
}

button:hover {
    background-color: rgb(2, 88, 179);
}

#resultado {
    margin-top: 10px;
    font-size: 19px;
    padding: 5px;
    font-weight: bold;
    text-align: center;
    color: #333;
    background-color: #cae0f8;
    border: 1px solid #0056b3;
    border-radius: 8px;
    box-shadow: 0 0 5px #0056b399;
}

.extraFields {
    display: none;
}

@media (max-width: 1280px) {
    .link__incoterms, .link__distancia {
        position: absolute;
        top: 0;
    }
    .container {
        max-width: 700px;
        margin-top: 125px;
    }
    .link__divisas {
        position: absolute;
        top: 40px;
    }
    .link__tests {
        position: absolute;
        top: 40px;
    }
    .link__peso {
        position: absolute;
        top: 80px;
    }
}
@media (max-width: 500px) {
    .container {
        max-width: 300px;
        margin-top: 50px;
    }
    .link__incoterms {
        position: absolute;
        top: 37px;
        left: 50%;
        transform: translateX(-50%);
        white-space: nowrap;
        width: fit-content;
    }
    .link__distancia {
        left: 50%;
        transform: translateX(-50%);
        width: fit-content;
        white-space: nowrap;
    }
    .link__divisas {
        position: absolute;
        top: 73px;
        left: 50%;
        transform: translateX(-50%);
        white-space: nowrap;
        width: fit-content;
    }
    .link__tests {
        position: absolute;
        top: 108px;
        left: 50%;
        transform: translateX(-50%);
        white-space: nowrap;
        width: fit-content;
    }
    .link__peso {
        position: absolute;
        top: 145px;
        left: 50%;
        transform: translateX(-50%);
        white-space: nowrap;
        width: fit-content;
    }
    .container {
        margin-top: 185px;
    }
}

/* LEGALIDADES VARIAS */
.footer-legal {
    width: 100%;
    background-color: transparent;
    text-align: center;
    padding: 15px;
    bottom: 0;
    left: 0;
}

.footer-legal a {
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
    margin: 0 10px;
    font-weight: 600;
}

.footer-legal a:hover {
    text-decoration: underline;
}

.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
}

/* Contenido del modal */
.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    position: relative;
}

.modal-text {
    max-height: 70vh;
    overflow-y: auto;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

/* Botón cerrar */
.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

.modal-text h2,
.modal-text h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #222;
}

.modal-text p {
    margin-bottom: 1em;
    color: #444;
    line-height: 1.6;
    font-size: 15px;
}

.modal-text ul {
    margin: 0 0 1.5em 1.5em;
    color: #444;
    font-size: 15px;
    line-height: 1.6;
}

.modal-text ul li {
    margin-bottom: 0.5em;
}

#cookie-banner {
    display: none;
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 18px 22px;
    max-width: 520px;
    width: 90%;
    z-index: 10000;
    font-size: 14px;
    color: #333;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

#cookie-banner .cookie-text {
    flex: 1 1 60%;
    min-width: 220px;
}

#cookie-banner .cookie-text p {
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
}

.cookie-buttons {
    flex: 0 1 auto;
    display: flex;
    gap: 10px;
}

#cookie-banner button {
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background-color 0.25s ease;
}

#accept-cookies {
    background-color: #007bff;
    color: white;
}

#accept-cookies:hover {
    background-color: #0056b3;
}

#reject-cookies {
    background-color: #f0f0f0;
    color: #333;
}

#reject-cookies:hover {
    background-color: #dcdcdc;
}

#modal-preferencias .modal-text label {
    display: block;
    margin: 12px 0 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
    color: #222;
}

#modal-preferencias .modal-text input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.botones {
    display: flex;
    justify-content: center;
}

#modal-preferencias button {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}

#modal-preferencias button:first-of-type {
    background-color: #007bff;
    color: white;
}

#modal-preferencias button:first-of-type:hover {
    background-color: #0056b3;
}

#modal-preferencias button:last-of-type {
    background-color: #444;
    margin-left: 10px;
}

#modal-preferencias button:last-of-type:hover {
    background-color: #aaa;
}

.instructions {
    font-style: italic;
    font-size: 0.9em;
    color: #555;
    margin-top: 5px;
}

.exim {
    margin-top: 10px;
}

/* Título */
h3 {
    margin-top: 15px;
    margin-bottom: 15px;
    font-size: 19px;
    font-weight: 600;
}

h3.exim {
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 19px;
    font-weight: 600;
}

/* Labels */
.label {
    display: block;
    margin-top: 10px;
    margin-bottom: 4px;
    font-size: 16px;
    color: #333;
}

/* Tabla */
#tablaMercancias {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

/* Cabecera */
#tablaMercancias thead th {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    padding: 8px;
    background-color: #f5f5f5;
    border: 1px solid #ccc;
}

/* Filas */
#tablaMercancias tbody tr {
    border-bottom: 1px solid #eee;
}

/* Celdas */
#tablaMercancias td {
    padding: 6px;
}

/* Inputs dentro de la tabla */
#tablaMercancias td input {
    width: 100%;
    padding: 6px;
    font-size: 12px;
    border: none;
    border-bottom: 1px solid #ccc;
    background: transparent;
}

/* Focus limpio */
#tablaMercancias td input:focus {
    outline: none;
    border-bottom: 1px solid #000;
}

/* Botón */
button {
    margin-top: 8px;
    padding: 8px 10px;
    font-size: 15px;
    cursor: pointer;
}

/* Observaciones */
#observaciones {
    width: 100%;
    min-height: 80px;
    padding: 8px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#tablaMercancias {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#tablaMercancias th,
#tablaMercancias td {
    padding: 8px;
    text-align: center;
}

#tablaMercancias input {
    width: 100%;
    box-sizing: border-box;
}

.tabla-scroll {
    overflow-x: auto;
}

@media (max-width: 768px) {
    #tablaMercancias {
        font-size: 12px;
    }

    #tablaMercancias input {
        min-width: 70px;
    }
}

.cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 50px;
    margin-bottom: 50px;
}

.card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    background: #e9ecef;
}

@media (max-width: 768px) {
    .cards {
        grid-template-columns: 1fr;
    }
}
