html {
    scroll-behavior: smooth;
    height: 100%;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: sans-serif;
    background: #022a75;
    padding-top: 80px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    body {
        padding-top: 75px;
    }
    
    .container {
        width: 92%;
    }
}

@media (max-width: 768px){
    body {
        padding-top: 65px;
    }

    .container {
        width: 95%;
    }

    .footer-logo {
        width: 120px;
    }

    .footer-menu {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .footer-menu a {
        display: block;
        margin: 0;
        font-size: 14px;
    }

    .footer-legal {
        font-size: 11px;
        padding-top: 5px;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 55px;
    }
    
    .container {
        width: 97%;
        padding: 0 8px;
    }

    .footer-logo {
        width: 100px;
    }

    .footer-menu a {
        font-size: 13px;
    }

    .footer-legal {
        font-size: 10px;
    }
}
/* ===== MODAL OVERLAY ===== */

.modal-overlay{
    position: fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background: rgba(0,0,0,0.5);
    display:none;
    justify-content:center;
    align-items:center;
    z-index:10000;
}

.modal-overlay.active{
    display:flex;
}

/* ===== CONTENEDOR ===== */

.modal-content{
    background:#fff;
    width:90%;
    max-width:750px;
    max-height: 95vh;
    overflow-y: auto;
    border-radius:12px;
    box-shadow:0 15px 40px rgba(0,0,0,0.25);
}

/* ===== HEADER ===== */

.modal-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:20px 25px;
    border-bottom:1px solid #eee;
}

.modal-header h2{
    margin:0;
    font-size:24px;
    color:#333;
}

.modal-close{
    background:none;
    border:none;
    font-size:28px;
    cursor:pointer;
    color:#666;
    width:30px;
    height:30px;
    display:flex;
    align-items:center;
    justify-content:center;
}

.modal-close:hover{
    color:#333;
}

/* ===== FORMULARIO ===== */

.modal-form{
    padding:25px;
}

.form-group{
    margin-bottom:20px;
}

.form-group label{
    display:block;
    margin-bottom:5px;
    font-weight:500;
    color:#555;
}

.form-group input,
.form-group textarea{
    width:100%;
    padding:12px;
    border:1px solid #ddd;
    border-radius:6px;
    font-size:16px;
    box-sizing:border-box;
}

.form-group textarea{
    resize:vertical;
    min-height:80px;
}

/* ===== CHECKBOX ===== */

.checkbox-group{
    display:flex;
    align-items:flex-start;
    gap:10px;
}

.checkbox-group input[type="checkbox"]{
    width:auto;
    margin-top:3px;
}

.checkbox-group label{
    margin-bottom:0;
    font-weight:normal;
    line-height:1.4;
}

.checkbox-group label a{
    color:#3b82f6;
    text-decoration:none;
}

.checkbox-group label a:hover{
    text-decoration:underline;
}

/* ===== BOTONES FORMULARIO ===== */

.form-actions{
    display:flex;
    gap:15px;
    justify-content:flex-end;
    margin-top:30px;
}

.btn-cancel,
.btn-submit{
    padding:12px 25px;
    border:none;
    border-radius:6px;
    font-size:16px;
    cursor:pointer;
    transition:0.3s;
}

.btn-cancel{
    background:#f5f5f5;
    color:#666;
    border:1px solid #ddd;
}

.btn-cancel:hover{
    background:#e9e9e9;
}

.btn-submit{
    background: #ff9800;
    color:white;
}

.btn-submit:hover{
    background: #3a9de0;
}

.modal-action-panel{
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    gap:18px;
    text-align:right;
}

.modal-action-panel .modal-checkbox-label{
    display:flex;
    flex-wrap:wrap;
    align-items:flex-start;
    justify-content:flex-end;
    gap:10px;
    width:100%;
}

.modal-action-panel .modal-checkbox-label input[type="checkbox"]{
    margin-top:3px;
}

.button-group{
    display:flex;
    flex-wrap:wrap;
    justify-content:flex-end;
    gap:10px;
    width:100%;
}

.button-group .btn-cancel,
.button-group .btn-submit{
    flex:0 1 auto;
    min-width:120px;
}

@media (max-width: 767px) {
    .modal-action-panel{
        align-items:flex-start;
        text-align:left;
    }

    .modal-action-panel .modal-checkbox-label{
        justify-content:flex-start;
    }

    .button-group{
        justify-content:flex-start;
    }
}

/* ===== MODAL COOKIES ===== */

.modal-body{
    padding:22px 24px;
    color:#444;
    line-height:1.6;
    font-size:15px;
}

.modal-body h3{
    margin-top:20px;
    margin-bottom:10px;
    font-size:17px;
    color:#333;
}

.modal-body ul{
    margin:10px 0 20px 20px;
}

.modal-body li{
    margin-bottom:6px;
}

/* ===== TABLA COOKIES ===== */

.tabla-cookies{
    width:100%;
    border-collapse:collapse;
    margin-top:10px;
    font-size:14px;
}

.tabla-cookies th{
    text-align:left;
    padding:10px;
    border-bottom:2px solid #e5e5e5;
    font-weight:600;
}

.tabla-cookies td{
    padding:10px;
    border-bottom:1px solid #eee;
}

/* ===== NOTA ===== */

.nota{
    margin-top:12px;
    font-size:13px;
    color:#777;
}

/* ===== FOOTER MODAL COOKIES ===== */

.modal-footer{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    padding:18px 24px;
    border-top:1px solid #e5e5e5;
}

/* BOTONES COOKIES */

.btn-config{
    padding:10px 18px;
    border-radius:6px;
    border:1px solid #3b82f6;
    background:white;
    color:#3b82f6;
    cursor:pointer;
    text-align: center;
}

.btn-config:hover{
    background:#f5f9ff;
}

.btn-cerrar{
    padding:10px 18px;
    border-radius:6px;
    border:none;
    background:#6c757d;
    color:white;
    cursor:pointer;
}

.btn-cerrar:hover{
    background:#5a6268;
}

/* ===== RESPONSIVE ===== */

@media (max-width:768px){

    .modal-content{
        width:95%;
        margin:20px;
    }

    .modal-header{
        padding:15px 20px;
    }

    .modal-header h2{
        font-size:20px;
    }

    .modal-form{
        padding:20px;
    }

    .form-actions{
        flex-direction:column;
    }

    .btn-cancel,
    .btn-submit{
        width:100%;
    }

    .modal-footer{
        flex-direction:column;
    }

}
/* ===== Accesibilidad general ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn-cancel, .btn-submit,
  .modal-close,
  .modal-content,
  .slide { transition: none !important; }
}

/* ===== Mejoras modales: desktop por defecto ===== */
.modal-overlay {
  padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom) 12px; /* notch friendly */
}
.modal-content {
  max-height: calc(100vh - 48px); /* que no crezca más que la ventana */
  overflow: hidden;               /* el scroll va al body del modal */
}

/* Hacemos scroll interno cuando el contenido es largo */
.modal-body,
.modal-form {
  max-height: calc(100vh - 56px - 64px - 48px); /* header + footer + márgenes aprox */
  overflow: auto;
}


.modal-body::-webkit-scrollbar,
.modal-form::-webkit-scrollbar { width: 10px; }
.modal-body::-webkit-scrollbar-thumb,
.modal-form::-webkit-scrollbar-thumb {
  background: #e5e7eb; border-radius: 8px;
}


.tabla-cookies-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px #eef2f7;
}
.tabla-cookies-wrap::-webkit-scrollbar { height: 10px; }
.tabla-cookies-wrap::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 8px; }


.modal-header {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
.modal-footer {
  position: sticky;
  bottom: 0;
  background: #fff;
  z-index: 2;
}


@media (max-width: 1024px) {
  .modal-content {
    width: 96%;
    max-width: 720px;
    border-radius: 12px;
  }
}


@media (max-width: 768px){
  /* Ya tenías parte, completamos: */
  .modal-overlay { padding: 12px; }

  .modal-content{
    width: 100%;
    max-width: 640px;
    margin: 0;              /* centrado por overlay */
    border-radius: 12px;
    max-height: calc(100vh - 24px);
  }

  .modal-header{
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
  }
  .modal-header h2{
    font-size: 18px;
    line-height: 1.2;
  }
  .modal-close{
    font-size: 26px;
    width: 36px; height: 36px;
  }

  .modal-body,
  .modal-form{
    padding: 16px;
    max-height: calc(100vh - 56px - 64px); /* header + footer aprox */
  }

  .form-group input,
  .form-group textarea{
    font-size: 16px;          /* evita zoom iOS */
    padding: 12px;
    min-height: 44px;         /* target táctil */
  }

  .checkbox-group { gap: 12px; }
  .checkbox-group input[type="checkbox"]{
    margin-top: 2px; min-width: 18px; min-height: 18px;
  }

  .form-actions{
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
  }
  .btn-cancel, .btn-submit{
    width: 100%;
    padding: 12px 16px;
    min-height: 44px;
    font-size: 16px;
  }

  /* Tabla: contenedor con desplazamiento horizontal */
  .tabla-cookies-wrap { margin: 10px 0; }
  .tabla-cookies { min-width: 520px; } /* permite scroll si la pantalla es estrecha */
}

@media (max-width: 480px){

  .modal-content{
    border-radius: 10px;
    max-height: calc(100vh - 16px);
    overflow: visible !important; /* IMPORTANTÍSIMO */
    padding-top: 8px;             /* separa el header del borde */
  }

  .modal-header {
    padding: 28px 16px 16px 16px !important; /* más espacio arriba */
    position: relative;
    z-index: 10;
    background: #fff;
  }

  .modal-header h2 {
    font-size: 17px;
    line-height: 1.3;
    white-space: normal;
  }

  .modal-close {
    font-size: 24px;
    width: 32px;
    height: 32px;
  }

  .modal-body, 
  .modal-form {
    padding: 14px;
  }

  .tabla-cookies { 
    font-size: 13px;
    min-width: 520px;
  }
}

#modal-cookies .modal-content {
    padding-top: 18px !important;
    overflow: visible !important;           /* NO recorta nada */
    max-height: calc(100vh - 20px) !important;
    border-radius: 14px !important;
}

/* HEADER */
#modal-cookies .modal-header {
    padding: 28px 20px 18px 20px !important; /* más aire arriba */
    position: relative !important;
    top: auto !important;
    z-index: 10;
    background: #fff;
}

/* TÍTULO */
#modal-cookies .modal-header h2 {
    font-size: 20px !important;
    line-height: 1.3 !important;
    margin-top: 0 !important;
    overflow: visible !important;
    white-space: normal !important;
}


#modal-cookies .modal-close {
    font-size: 26px !important;
    width: 34px !important;
    height: 34px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}


#modal-cookies .modal-body {
    padding: 20px !important;
    overflow: visible !important;
}

#modal-cookies .tabla-cookies {
    font-size: 14px;
    min-width: 520px;
}

@media (max-width: 480px){

  #modal-cookies .modal-content {
      padding-top: 20px !important;
      max-height: calc(100vh - 15px) !important;
      border-radius: 12px !important;
  }

  #modal-cookies .modal-header {
      padding: 30px 16px 16px 16px !important;
  }

  #modal-cookies .modal-header h2 {
      font-size: 17px !important;
  }

  #modal-cookies .modal-close {
      width: 34px !important;
      height: 34px !important;
  }

  #modal-cookies .modal-body {
      padding: 14px !important;
  }
}

#modal-cookies .modal-content {
    overflow-y: auto !important;     /* scroll vertical */
    overflow-x: hidden !important;    /* no cortar por defecto */
    padding-top: 16px !important;     /* asegura que el título NO se corta */
    max-height: calc(100vh - 20px) !important;
    border-radius: 14px !important;
}


#modal-cookies .modal-body {
    overflow-x: auto !important;      /* scroll horizontal */
    overflow-y: visible !important;   /* deja que crezca verticalmente */
    width: 100%;
    padding-bottom: 20px;
}


#modal-cookies .tabla-cookies-wrap {
    width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}


#modal-cookies .tabla-cookies {
    min-width: 520px; /* scroll right OK */
}


@media (max-width: 480px){

  #modal-cookies .modal-content {
      max-height: calc(100vh - 12px) !important;
      padding-top: 18px !important;
  }

  #modal-cookies .modal-header {
      padding: 26px 16px 14px 16px !important; /* no corta título */
  }

  #modal-cookies .modal-body {
      padding: 14px !important;
      overflow-x: auto !important; /* scroll horizontal funcionando */
  }

  #modal-cookies .modal-header h2{
      font-size: 17px !important;
      line-height: 1.3 !important;
  }
}
/* =========================
   COOKIES / GDPR
========================= */

.gdpr-settings {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 900px;

    background: linear-gradient(135deg, rgba(5, 22, 60, 0.92), rgba(8, 18, 40, 0.92));
    backdrop-filter: blur(12px);

    color: #cfd6e0;
    padding: 26px 32px;

    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);

    z-index: 9999;
    animation: slideUp 0.45s ease;
}

/* Texto */
.gdpr-settings p {
    font-size: 15px;
    line-height: 1.55;
    margin-bottom: 10px;
}

.gdpr-settings a {
    text-decoration: none;
    font-weight: 600;
    color: #00ADAB;
}

.gdpr-settings a:hover {
    text-decoration: underline;
}

/* =========================
   BOTÓN ACEPTAR (estilo GDPR)
========================= */
.gdpr-settings .btn-outline-warning,
.gdpr-settings .abrir-config-cookies {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 210px;
    max-width: 100%;
    min-width: 210px;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none !important;
    transition: 0.25s ease;
    cursor: pointer;
}

.gdpr-settings .btn-outline-warning {
    border: 1px solid #75a83d;
    color: #75a83d;
    background: transparent;
}

.gdpr-settings .btn-outline-warning:hover {
    background: #75a83d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.gdpr-settings .abrir-config-cookies {
    border: 1px solid #5EC2FF;
    color: #5EC2FF !important;
    background: transparent;
    margin-left: 12px;
}

.gdpr-settings .abrir-config-cookies:hover {
    background: #5EC2FF;
    color: #0c132c !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.gdpr-settings .btn-outline-warning,
.gdpr-settings .abrir-config-cookies {
    box-shadow: none;
}

.gdpr-settings .btn-outline-warning:hover,
.gdpr-settings .abrir-config-cookies:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* =========================
   ANIMACIÓN
========================= */
@keyframes slideUp {
    from { transform: translate(-50%, 30px); opacity: 0; }
    to   { transform: translate(-50%, 0); opacity: 1; }
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
    .gdpr-settings {
        width: calc(100% - 40px);
        padding: 20px;
        bottom: 20px;
    }

    .gdpr-settings .btn-outline-warning,
    .gdpr-settings .abrir-config-cookies {
        width: 100%;
        margin-bottom: 10px;
        margin-left: 0;
    }
}