
/* Estilos Cookies 2026 */

/* --- Banner Principal --- */
.aviso-cookies {
	display: none;
	background: #fff;
	padding: 20px;
	width: calc(100% - 40px);
	max-width: 400px; /* Un poco más ancho para los 3 botones */
	line-height: 150%;
	border-radius: 10px;
	position: fixed;
	bottom: 20px;
	left: 20px;
	z-index: 10000;
	padding-top: 60px;
	box-shadow: 0px 2px 20px 10px rgba(222,222,222,.25);
	text-align: center;
}

.aviso-cookies.activo {
	display: block;
}

.aviso-cookies .galleta {
	max-width: 100px;
	position: absolute;
	top: -50px;
	left: calc(50% - 50px);
}

.aviso-cookies .titulo{
	margin-bottom: 15px;
	font-size: 18px;
}
.aviso-cookies .parrafo {
	margin-bottom: 15px;
	font-size: 12px;
}

/* Botones del Banner */
.botones-cookies {
    display: flex;
    flex-direction: column; /* Una debajo de la otra */
    gap: 10px;
    justify-content: center;
    width: 100%;
}

.aviso-cookies .boton {
	background: #595959;
	border: none;
	color: #fff;
	font-family: 'Roboto', sans-serif;
	text-align: center;
	padding: 12px 15px;
	font-weight: 700;
	cursor: pointer;
	transition: .3s ease all;
	border-radius: 5px;
	font-size: 14px;
    width: 100%;
    display: block;
}

.aviso-cookies .boton:hover {
	background: #000;
}

/* COMPLIANCE: Accept and Reject buttons are now IDENTICAL - no dark patterns */
.aviso-cookies .boton.rechazar {
    /* Same styling as accept button - AEPD compliance */
    background: #595959;
    color: #fff;
    border: none;
}
.aviso-cookies .boton.rechazar:hover {
    background: #000;
}

.aviso-cookies .boton.configurar {
    background: transparent;
    color: #595959;
    text-decoration: underline;
    font-weight: normal;
    font-size: 13px;
    margin-top: 5px;
    padding: 5px;
    border: none;
}

.aviso-cookies .enlace {
	color: #4DBFFF;
	text-decoration: none;
	font-size: 14px;
    display: block;
    margin-top: 10px;
}

.aviso-cookies .enlace:hover {
	text-decoration: underline;
}

/* Fondo Oscuro - Opacidad y Bloqueo Visual */
.fondo-aviso-cookies {
	display: none;
	background: rgba(0,0,0,.85);
    backdrop-filter: blur(5px);
	position: fixed;
	z-index: 9999;
	width: 100vw;
	height: 100vh;
	top: 0;
	left: 0;
}

/* Clase para bloquear el scroll del body */
body.bloquear-scroll {
    overflow: hidden !important;
    height: 100vh !important;
}

.fondo-aviso-cookies.activo {
	display: block;
}

/* --- Modal de Configuración --- */
.modal-cookies {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    width: 90%;
    max-width: 500px;
    z-index: 10001;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    overflow: hidden;
}

.modal-cookies.activo {
    display: block;
}

.modal-header {
    background: #f1f1f1;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.modal-header .titulo {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.btn-cerrar {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.cookie-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
}

.cookie-info h4 {
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: bold;
}
.cookie-info p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

/* Toggle Switch - Estilo Mejorado */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0; /* Evitar que se aplaste */
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #0d6efd; /* Azul Bootstrap */
}

input:focus + .slider {
  box-shadow: 0 0 1px #0d6efd;
}

input:checked + .slider:before {
  -webkit-transform: translateX(22px);
  -ms-transform: translateX(22px);
  transform: translateX(22px);
}

/* Slider Disabled (para técnicas) - COMPLIANCE: must look locked */
input:disabled + .slider {
  background-color: #d0d0d0; /* More gray, less blue */
  cursor: not-allowed;
  opacity: 0.5; /* More transparent */
  border: 1px solid #999; /* Add border to show it's locked */
}

input:disabled + .slider:before {
  background-color: #f0f0f0; /* Lighter knob */
}

.modal-footer {
    padding: 15px 20px;
    background: #f9f9f9;
    text-align: center;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Modal footer buttons */
.modal-footer .boton {
    flex: 1 1 auto;
    min-width: 140px;
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.modal-footer .btn-aceptar-modal {
    background: #595959;
    color: white;
}

.modal-footer .btn-aceptar-modal:hover {
    background: #000;
}

.modal-footer .btn-rechazar-modal {
    background: #595959;
    color: white;
}

.modal-footer .btn-rechazar-modal:hover {
    background: #000;
}

/* Botón Guardar Preferencias (Estilo Premium) */
.modal-footer .boton.btn-guardar {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.modal-footer .boton.btn-guardar:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #0b5ed7 0%, #0a58ca 100%);
}

/* ACCESSIBILITY: Hide banner when modal is open */
body.modal-open .aviso-cookies {
    pointer-events: none;
    opacity: 0.3;
}

/* --- Botón Flotante (Revocación) --- */
.btn-revocar-cookies {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    z-index: 9998;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    align-items: center;
    justify-content: center;
}

.btn-revocar-cookies.activo {
    display: flex;
}

.btn-revocar-cookies img {
    width: 20px;
    height: 20px;
}