/* ============================================================
   Tu Desvío — Aviso de cookies (RGPD / art. 22.2 LSSI)
   Mismo funcionamiento que el de blisshomes.es, con la paleta de Tu Desvío.
   ============================================================ */
.td-cc {
  position: fixed; left: 20px; right: 20px; bottom: 20px; z-index: 9998;
  max-width: 960px; margin: 0 auto;
  background: #3E481F; color: #FAF6E8;
  border-radius: 18px; padding: 20px 24px;
  font-family: 'Poppins', system-ui, -apple-system, sans-serif; font-size: 14px; line-height: 1.5;
  box-shadow: 0 12px 40px rgba(43,42,31,.32);
  display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center;
  transform: translateY(calc(100% + 40px)); transition: transform .45s cubic-bezier(.2,.7,.2,1);
}
.td-cc.open { transform: translateY(0); }
.td-cc h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: #FFFFFF; }
.td-cc p { margin: 0; color: rgba(250,246,232,.86); }
.td-cc a { color: #F3EBCB; text-decoration: underline; text-underline-offset: 2px; }
.td-cc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.td-cc-btn {
  font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  border: 1.5px solid rgba(250,246,232,.45); background: transparent; color: #FAF6E8;
  transition: background .2s, border-color .2s, color .2s;
}
.td-cc-btn:hover { border-color: #FAF6E8; }
.td-cc-btn.primary { background: #F3EBCB; border-color: #F3EBCB; color: #3E481F; }
.td-cc-btn.primary:hover { background: #FFFFFF; border-color: #FFFFFF; }
.td-cc-btn:focus-visible, .td-cc-reopen:focus-visible { outline: 3px solid #F3EBCB; outline-offset: 3px; }

@media (max-width: 720px) {
  .td-cc { grid-template-columns: 1fr; padding: 16px 18px; left: 12px; right: 12px; bottom: 12px; gap: 14px; }
  .td-cc-actions { justify-content: space-between; }
  .td-cc-btn { flex: 1; padding: 10px 12px; font-size: 13px; }
}
/* Pantallas bajas (plegable cerrado, móvil en horizontal) */
@media (max-height: 700px) {
  .td-cc { padding: 12px 16px; gap: 10px; left: 10px; right: 10px; bottom: 8px; max-height: 62vh; overflow-y: auto; }
  .td-cc h3 { font-size: 13.5px; }
  .td-cc p { font-size: 12.5px; line-height: 1.4; }
  .td-cc-btn { padding: 8px 12px; font-size: 12.5px; }
}

/* Preferencias */
.td-cc-modal {
  position: fixed; inset: 0; z-index: 9999; display: none; align-items: center; justify-content: center;
  padding: 20px; background: rgba(43,42,31,.6); opacity: 0; transition: opacity .3s;
}
.td-cc-modal.open { display: flex; opacity: 1; }
.td-cc-modal-card {
  background: #FAF6E8; color: #2B2A1F; border-radius: 22px; max-width: 560px; width: 100%;
  max-height: 85vh; overflow-y: auto; padding: 30px; font-family: 'Poppins', system-ui, sans-serif;
  box-shadow: 0 12px 34px rgba(43,42,31,.2);
}
.td-cc-modal-card h2 { margin: 0 0 8px; font-family: 'Caveat', cursive; font-size: 34px; line-height: 1; color: #535F34; }
.td-cc-modal-card > p { margin: 0 0 20px; color: #5C5A48; font-size: 14px; line-height: 1.6; }
.td-cc-modal-card a { color: #935B27; text-decoration: underline; text-underline-offset: 2px; }
.td-cc-row { display: flex; align-items: flex-start; gap: 16px; padding: 16px 0; border-top: 1px solid #D9CFA9; }
.td-cc-row:last-of-type { border-bottom: 1px solid #D9CFA9; }
.td-cc-row-body { flex: 1; }
.td-cc-row-body strong { display: block; font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.td-cc-row-body span { display: block; color: #5C5A48; font-size: 13px; line-height: 1.55; }
.td-cc-row-body em { font-style: normal; font-weight: 500; color: #535F34; font-size: 12px; margin-left: 6px; }
.td-cc-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; margin-top: 2px; }
.td-cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.td-cc-switch .track { position: absolute; inset: 0; border-radius: 999px; background: #D9CFA9; transition: background .2s; }
.td-cc-switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #FFFFFF; transition: transform .25s cubic-bezier(.2,.7,.2,1);
}
.td-cc-switch input:checked ~ .track { background: #62934C; }
.td-cc-switch input:checked ~ .track::after { transform: translateX(20px); }
.td-cc-switch input:disabled { cursor: not-allowed; }
.td-cc-switch input:disabled ~ .track { opacity: .6; }
.td-cc-switch input:focus-visible ~ .track { outline: 3px solid #535F34; outline-offset: 2px; }
.td-cc-modal-actions { display: flex; gap: 10px; margin-top: 22px; justify-content: flex-end; flex-wrap: wrap; }
.td-cc-modal .td-cc-btn { border-color: #535F34; color: #535F34; }
.td-cc-modal .td-cc-btn:hover { background: #F3EBCB; }
.td-cc-modal .td-cc-btn.primary { background: #535F34; border-color: #535F34; color: #FAF6E8; }
.td-cc-modal .td-cc-btn.primary:hover { background: #3E481F; }

/* Botón para volver a abrir las preferencias */
.td-cc-reopen {
  position: fixed; left: 16px; bottom: 16px; z-index: 45; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: #FAF6E8; color: #535F34; border: 1.5px solid #D9CFA9; box-shadow: 0 1px 2px rgba(43,42,31,.08);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s, border-color .2s;
}
.td-cc-reopen svg { width: 20px; height: 20px; }
.td-cc-reopen.show { opacity: 1; pointer-events: auto; }
.td-cc-reopen:hover { border-color: #535F34; transform: translateY(-2px); }

/* Fichas de alojamiento: por debajo de 960 px hay barra de reserva fija abajo */
@media (max-width: 960px) {
  body:has(.book-bar) .td-cc-reopen { bottom: calc(92px + env(safe-area-inset-bottom)); }
  body:has(.book-bar) .td-cc { bottom: calc(88px + env(safe-area-inset-bottom)); }
  body:has(.book-bar) .td-cc:not(.open) { transform: translateY(calc(100% + 140px)); }
}
