:root{
  --dpc-brand:#2d4569;
  --dpc-brand-strong:#213551;
  --dpc-text:#172333;
  --dpc-muted:#56657a;
  --dpc-border:#d8dee8;
  --dpc-surface:#ffffff;
  --dpc-surface-soft:#f6f8fb;
  --dpc-overlay:rgba(10,18,31,.46);
  --dpc-shadow:0 18px 46px rgba(15,27,44,.22);
  --dpc-radius:16px;
}

.dpc-cookie-banner,
.dpc-cookie-drawer{
  font-family:Arial,sans-serif;
  background:var(--dpc-surface);
  color:var(--dpc-text);
  box-shadow:var(--dpc-shadow);
  z-index:99999;
  line-height:1.5;
}

.dpc-cookie-banner-backdrop,
.dpc-cookie-drawer-backdrop:not([hidden]){
  position:fixed;
  inset:0;
  background:var(--dpc-overlay);
}
.dpc-cookie-banner-backdrop{z-index:99997;}
.dpc-cookie-drawer-backdrop:not([hidden]){z-index:99998;}

/* Banner compacto esquina inferior izquierda */
.dpc-cookie-banner{
  position:fixed;
  left:16px;
  bottom:16px;
  width:min(100vw - 32px, 430px);
  border:1px solid rgba(15,27,44,.12);
  border-radius:0;
  padding:20px 20px 18px;
}

.dpc-cookie-banner__header,
.dpc-cookie-drawer__brand{
  display:flex;
  align-items:flex-start;
  gap:14px;
}

.dpc-cookie-banner__brand-copy,
.dpc-cookie-drawer__brand-copy{min-width:0;}

.dpc-cookie-banner__logo,
.dpc-cookie-drawer__logo{
  width:auto;
  max-width:118px;
  max-height:30px;
  object-fit:contain;
  flex:0 0 auto;
}

.dpc-cookie-banner__eyebrow{display:none;}
.dpc-cookie-drawer__eyebrow{
  display:block;
  color:var(--dpc-brand);
  font-weight:700;
  font-size:12px;
  line-height:1.2;
  letter-spacing:.08em;
  text-transform:uppercase;
  margin:2px 0 6px;
}

.dpc-cookie-banner h2{
  margin:0;
  color:#111;
  font-size:25px;
  line-height:1.05;
  font-weight:700;
}

.dpc-cookie-drawer h2{
  margin:0;
  color:#111;
  font-size:34px;
  line-height:1.05;
  font-weight:800;
}

.dpc-cookie-banner p,
.dpc-cookie-drawer p{margin:0;}

.dpc-cookie-banner__description{
  margin-top:16px;
  color:#444;
  font-size:14px;
  max-width:360px;
}

.dpc-cookie-drawer__intro{
  margin-top:0;
  color:var(--dpc-muted);
  font-size:16px;
  max-width:620px;
}

.dpc-cookie-banner__links,
.dpc-cookie-drawer__legal{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  margin-top:14px;
  font-size:14px;
}

.dpc-cookie-banner__links a,
.dpc-cookie-drawer__legal a{
  color:#444;
  text-decoration:none;
  border-bottom:1px solid rgba(0,0,0,.45);
  padding-bottom:1px;
}
.dpc-cookie-banner__links a:hover,
.dpc-cookie-drawer__legal a:hover{color:#000;border-bottom-color:#000;}

.dpc-cookie-message{
  color:#b42318;
  font-size:13px;
  margin-top:10px;
  min-height:18px;
}

.dpc-cookie-banner__actions{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:18px;
}

.dpc-cookie-drawer__footer{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
}

.dpc-cookie-button{
  appearance:none;
  cursor:pointer;
  min-height:42px;
  padding:0 16px;
  border:1px solid #2e2e2e;
  background:#fff;
  color:#111;
  border-radius:0;
  font-size:14px;
  font-weight:700;
  transition:background-color .18s ease,color .18s ease,border-color .18s ease,opacity .18s ease;
}
.dpc-cookie-button:hover{opacity:.92;}
.dpc-cookie-button:focus-visible{outline:3px solid rgba(45,69,105,.18);outline-offset:2px;}

.dpc-cookie-button--primary{
  background:#111;
  color:#fff;
  border-color:#111;
}
.dpc-cookie-button--primary:hover{background:#000;border-color:#000;}

.dpc-cookie-button--outline{
  background:#fff;
  color:#111;
  border-color:#2e2e2e;
}
.dpc-cookie-button--outline:hover{background:#f7f7f7;}

.dpc-cookie-button--ghost,
.dpc-cookie-button--link{
  background:transparent;
  color:#111;
  border:none;
  text-decoration:underline;
  justify-content:center;
  min-height:auto;
  padding:4px 0 0;
}

.dpc-cookie-button--wide{width:100%;}

/* Drawer / configuración */
.dpc-cookie-drawer{
  position:fixed;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  width:min(calc(100vw - 32px), 760px);
  max-height:min(86vh,820px);
  border-radius:18px;
  overflow:hidden;
  display:none;
  border:1px solid rgba(45,69,105,.12);
}
.dpc-cookie-drawer[aria-hidden="false"]{display:flex;flex-direction:column;}

.dpc-cookie-drawer__header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  padding:28px 30px 18px;
  border-bottom:1px solid var(--dpc-border);
}

.dpc-cookie-drawer__close{
  appearance:none;
  background:#f3f6fa;
  color:var(--dpc-brand);
  border:1px solid #dde6f2;
  width:42px;
  height:42px;
  border-radius:999px;
  cursor:pointer;
  font-size:28px;
  line-height:1;
}

.dpc-cookie-drawer__body{
  padding:22px 30px 26px;
  overflow:auto;
}

.dpc-cookie-preferences{
  margin-top:20px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

.dpc-cookie-preference{
  display:flex;
  justify-content:space-between;
  gap:20px;
  padding:18px 20px;
  border:1px solid var(--dpc-border);
  border-radius:14px;
  background:var(--dpc-surface-soft);
}
.dpc-cookie-preference h3{
  margin:0 0 6px;
  font-size:18px;
  color:#111b2d;
}
.dpc-cookie-preference p{
  color:var(--dpc-muted);
  font-size:15px;
}
.dpc-cookie-preference__fixed{
  display:flex;
  align-items:center;
  font-size:14px;
  font-weight:700;
  white-space:nowrap;
  color:var(--dpc-brand);
}

.dpc-cookie-switch{display:inline-flex;align-items:center;}
.dpc-cookie-switch input{
  appearance:none;
  width:52px;
  height:30px;
  border-radius:999px;
  background:#cfd8e6;
  border:1px solid #bcc7d9;
  position:relative;
  margin:0;
  cursor:pointer;
  transition:background-color .18s ease,border-color .18s ease;
}
.dpc-cookie-switch input::after{
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:22px;
  height:22px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 2px 8px rgba(0,0,0,.18);
  transition:transform .18s ease;
}
.dpc-cookie-switch input:checked{background:var(--dpc-brand);border-color:var(--dpc-brand);}
.dpc-cookie-switch input:checked::after{transform:translateX(22px);}
.dpc-cookie-switch__track{display:none;}

.dpc-cookie-drawer__footer{
  margin-top:0;
  padding:18px 30px 28px;
  border-top:1px solid var(--dpc-border);
  justify-content:flex-end;
  background:#fff;
}

.dpc-legal-links{display:flex;flex-wrap:wrap;justify-content:center;gap:16px;padding:16px;font-size:13px}
.dpc-legal-links a,.dpc-legal-links button{color:inherit}
.dpc-legal-links button{background:none;border:0;text-decoration:underline;cursor:pointer}
.dpc-form-notice{font-size:13px;line-height:1.5;margin:8px 0}
body.dpc-cookie-modal-open{overflow:hidden;}

@media (max-width: 640px){
  .dpc-cookie-banner{
    left:10px;
    right:10px;
    bottom:10px;
    width:auto;
    padding:18px 16px 16px;
  }
  .dpc-cookie-banner h2{font-size:22px;}
  .dpc-cookie-banner__description{font-size:13px;max-width:none;}
  .dpc-cookie-banner__logo{max-width:108px;max-height:28px;}
  .dpc-cookie-drawer,
  .dpc-cookie-drawer__header,
  .dpc-cookie-drawer__body,
  .dpc-cookie-drawer__footer{border-radius:0;}
  .dpc-cookie-drawer{
    width:calc(100vw - 16px);
    max-height:90vh;
  }
  .dpc-cookie-drawer__header{padding:20px 18px 14px;}
  .dpc-cookie-drawer__body{padding:16px 18px 18px;}
  .dpc-cookie-drawer__footer{padding:16px 18px 20px;flex-direction:column;}
  .dpc-cookie-drawer h2{font-size:28px;}
  .dpc-cookie-preference{flex-direction:column;align-items:flex-start;}
  .dpc-cookie-drawer__footer .dpc-cookie-button{width:100%;}
}

/* DPC: logotipo en la primera línea y título en la segunda (panel de configuración). */
.dpc-cookie-drawer__brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.dpc-cookie-drawer__logo {
  display: block;
  width: auto;
  max-width: 145px;
  max-height: 42px;
}
.dpc-cookie-drawer__brand-copy {
  width: 100%;
}
.dpc-cookie-drawer__eyebrow {
  margin: 0 0 7px;
}
@media (max-width: 640px) {
  .dpc-cookie-drawer__brand { gap: 10px; }
  .dpc-cookie-drawer__logo { max-width: 125px; max-height: 38px; }
}

/* Banner compacto: logotipo en fila propia y título debajo. */
.dpc-cookie-banner__header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.dpc-cookie-banner__logo {
  display: block;
  width: auto;
  max-width: 145px;
  max-height: 42px;
  object-fit: contain;
}
.dpc-cookie-banner__brand-copy { width: 100%; }
.dpc-cookie-banner__brand-copy h2 { margin: 0; }
.dpc-cookie-banner__description { margin-top: 12px; }
@media (max-width: 640px) {
  .dpc-cookie-banner__header { gap: 8px; }
  .dpc-cookie-banner__logo { max-width: 125px; max-height: 38px; }
}

/* =============================================================
   DPC · Ajuste responsive del panel de configuración (2026-11-12)
   No modifica el banner compacto ni el sistema de preferencias.
   ============================================================= */

/* El panel y su fondo deben estar por encima de widgets flotantes
   como el acceso a WhatsApp, incluso si usan z-index elevados. */
.dpc-cookie-drawer-backdrop:not([hidden]) {
  z-index: 2147483645 !important;
}
.dpc-cookie-drawer[aria-hidden="false"] {
  z-index: 2147483646 !important;
}

/* Evitar que un texto largo estire la cabecera. */
.dpc-cookie-drawer__brand,
.dpc-cookie-drawer__brand-copy,
.dpc-cookie-preference__text {
  min-width: 0;
}

@media (max-width: 640px) {
  /* Un único marco que aprovecha la altura visible del navegador móvil.
     svh es el fallback estable y dvh considera las barras del navegador. */
  .dpc-cookie-drawer[aria-hidden="false"] {
    position: fixed;
    inset: 8px !important;
    top: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    left: 8px !important;
    width: auto !important;
    height: calc(100vh - 16px);
    height: calc(100svh - 16px);
    height: calc(100dvh - 16px);
    max-height: none !important;
    transform: none !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    border-radius: 14px !important;
    overflow: hidden;
  }

  /* La cabecera y las acciones permanecen visibles; solo el centro se desplaza. */
  .dpc-cookie-drawer__header {
    flex: 0 0 auto;
    padding: 13px 15px 12px !important;
    gap: 8px;
    align-items: flex-start;
  }
  .dpc-cookie-drawer__brand {
    gap: 6px !important;
    flex: 1 1 auto;
  }
  .dpc-cookie-drawer__logo {
    max-width: 112px !important;
    max-height: 29px !important;
  }
  .dpc-cookie-drawer__eyebrow {
    margin: 0 0 4px;
    font-size: 10px;
    letter-spacing: .07em;
  }
  .dpc-cookie-drawer h2 {
    font-size: clamp(21px, 6vw, 27px) !important;
    line-height: 1.08;
    overflow-wrap: normal;
  }
  .dpc-cookie-drawer__close {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    font-size: 23px;
  }

  .dpc-cookie-drawer__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 13px 15px 16px !important;
  }
  .dpc-cookie-drawer__intro {
    font-size: 13px;
    line-height: 1.5;
  }
  .dpc-cookie-preferences {
    gap: 9px;
    margin-top: 13px;
  }
  .dpc-cookie-preference {
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px;
    padding: 12px;
    border-radius: 11px;
  }
  .dpc-cookie-preference h3 {
    font-size: 15px;
    margin: 0 0 4px;
  }
  .dpc-cookie-preference p {
    font-size: 12px;
    line-height: 1.5;
  }
  .dpc-cookie-preference__fixed {
    font-size: 11px;
    white-space: normal;
    max-width: 74px;
    text-align: right;
  }
  .dpc-cookie-switch {flex: 0 0 auto;}
  .dpc-cookie-switch input {width: 45px;height: 26px;}
  .dpc-cookie-switch input::after {width: 18px;height: 18px;}
  .dpc-cookie-switch input:checked::after {transform: translateX(19px);}
  .dpc-cookie-drawer__legal {gap: 8px;margin-top: 12px;font-size: 12px;}

  .dpc-cookie-drawer__footer {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0;
    padding: 10px 15px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    border-top: 1px solid var(--dpc-border);
    background: #fff;
  }
  .dpc-cookie-drawer__footer .dpc-cookie-button {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 6px 8px;
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
  }
}

/* Pantallas pequeñas o apaisadas con muy poca altura. */
@media (max-width: 640px) and (max-height: 540px) {
  .dpc-cookie-drawer__header {padding-top: 8px !important;padding-bottom: 8px !important;}
  .dpc-cookie-drawer__logo {max-height: 22px !important;}
  .dpc-cookie-drawer h2 {font-size: 20px !important;}
  .dpc-cookie-drawer__footer {padding-top: 6px !important;padding-bottom: 6px !important;}
  .dpc-cookie-drawer__footer .dpc-cookie-button {min-height: 36px;}
}
