/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

/* Estilo general */
body {
    font-family: 'Arial', sans-serif;
    background-color: #f4f7fc;
    min-height: 110vh;
    margin: 0;
}

/* 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 */
}

/* 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__distancia 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__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 i {
    margin-left: 8px;
    font-size: 16px;
}

.link__facturas {
    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__facturas i {
    margin-left: 8px;
    font-size: 16px;
}

.link__divisas {
    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__facturas:hover, .link__incoterms:hover, .link__tests:hover, .link__divisas:hover {
    background-color: #007bff;
    color: #fff;
    transform: scale(1.1);
}

/* Contenedor calculadora */
.container {
    width: 100%;
    max-width: 800px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin: 30px auto;
}

/* === Calculadora volumen y peso dimensional === */

.container label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.container input[type="number"] {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 6px;
    border: 1px solid #d0d7e2;
    margin-bottom: 20px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.container input[type="number"]::placeholder {
    color: #9aa4b2;
}

.container input[type="number"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* Botón calcular */
.container button {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.15s ease;
}

.container button:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.container button:active {
    transform: translateY(0);
}

/* Resultado */
#resultado {
    display: none;
    margin-top: 25px;
    padding: 20px;
    background-color: #f4f7fc;
    border-left: 5px solid #007bff;
    border-radius: 6px;
}

#resultado p {
    font-size: 15px;
    color: #333;
    margin-bottom: 8px;
}

#resultado p:last-child {
    margin-bottom: 0;
}

#resultado strong {
    color: #0056b3;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    header {
        padding: 22px;
    }
}

/* Encabezado */
header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    padding: 30px;
    border-radius: 12px;
    color: white;
    margin-bottom: 30px;
    text-align: center;
}

header h1 {
    color: white;
    margin-bottom: 8px;
}

/* Texto de ayuda bajo inputs */
.ayuda {
    display: block;
    margin-top: -12px;
    margin-bottom: 18px;
    font-size: 13px;
    font-style: italic;
    color: #6b7280; /* gris suave */
    line-height: 1.4;
}

/* Bloque explicativo SEO */
.seo-text {
    background-color: #f9fafb;      /* gris muy suave de fondo */
    border-left: 4px solid #007bff; /* línea azul para resaltar */
    padding: 20px 18px;
    margin-top: 30px;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.6;
    color: #374151;                 /* gris oscuro para lectura */
}

.seo-text h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #1f2937;
}

.seo-text p {
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 600px) {
    .seo-text {
        padding: 16px 14px;
    }

    .seo-text h2 {
        font-size: 1.1rem;
    }

    .seo-text p {
        font-size: 14px;
    }
}

.sr-only {
    font-size: 1.3rem;
    font-weight: 600;
    color: #282b30; 
    margin-bottom: 12px;
}

/* Ajustes móviles para links y container */
@media (max-width: 600px) {

    /* Reducir tamaño de los links para que quepan */
    a.link__distancia,
    a.link__facturas,
    a.link__incoterms,
    a.link__divisas,
    a.link__tests {
        position: absolute;
        font-size: 11px;       /* un poco más pequeño */
        padding: 6px 12px;     /* menos espacio interno */
    }

    /* Ajuste vertical de los links si es necesario */
    .link__distancia { top: 20px; right: 12px; }
    .link__facturas { top: 60px; right: 12px; }
    .link__incoterms { top: 20px; left: 12px; }
    .link__divisas { top: 100px; left: 12px; }
    .link__tests { top: 60px; left: 12px; }

    /* Empujar el container hacia abajo para que no se sobreponga */
    .container {
        margin-top: 160px;  /* suficiente espacio para los 5 links */
        padding: 18px;      /* ya tenías padding reducido */
    }
}

@media (max-width: 1300px) {

    /* Reducir tamaño de los links para que quepan */
    .link__distancia,
    .link__facturas,
    .link__incoterms,
    .link__divisas,
    .link__tests {
        position: absolute;
        font-size: 13px;       /* un poco más pequeño */
        padding: 7px 14px;     /* menos espacio interno */
    }

    /* Ajuste vertical de los links si es necesario */
    .link__distancia { top: 20px; right: 12px; }
    .link__facturas { top: 60px; right: 12px; }
    .link__incoterms { top: 20px; left: 12px; }
    .link__divisas { top: 100px; left: 12px; }
    .link__tests { top: 60px; left: 12px; }

    /* Empujar el container hacia abajo para que no se sobreponga */
    .container {
        margin-top: 160px;  /* suficiente espacio para los 5 links */
        padding: 18px;      /* ya tenías padding reducido */
    }
}

/* Políticas */
.footer-legal {
    width: 100%;
    background-color: transparent;
    text-align: center;
    padding: 15px;
    z-index: 10;
}

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

.footer-legal a:hover, #cookie-settings-btn:hover {
    text-decoration: underline;
}

/* Modal general */
.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;
}