/**
 * CMP — tarjeta flotante ancha (estilo referencia CookieGuard-like)
 */
.mp-consent {
  --mp-cmp-z: 10060;
  --mp-cmp-text: #111;
  --mp-cmp-muted: #555;
  --mp-cmp-border: #d8d8d8;
  --mp-cmp-bg: #fff;
  --mp-cmp-radius: 22px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--mp-cmp-text);
}

.mp-consent__banner {
  position: fixed;
  z-index: var(--mp-cmp-z);
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 920px;
  pointer-events: none;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mp-consent__box {
  pointer-events: auto;
  background: var(--mp-cmp-bg);
  border: 1px solid #ebebeb;
  border-radius: var(--mp-cmp-radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14), 0 2px 10px rgba(0, 0, 0, 0.06);
  padding: 28px 32px;
}

.mp-consent__layout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 28px;
}

.mp-consent__main {
  flex: 1 1 280px;
  min-width: 0;
  max-width: 640px;
}

.mp-consent__heading {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.mp-consent__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--mp-cmp-muted);
}

.mp-consent__legal {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.4;
}

.mp-consent__legal-link {
  color: var(--mp-cmp-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mp-consent__legal-link:hover,
.mp-consent__legal-link:focus-visible {
  color: #000;
}

.mp-consent__legal-sep {
  margin: 0 8px;
  color: #999;
}

.mp-consent__aside {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.mp-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.mp-consent__btn {
  margin: 0;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.mp-consent__btn:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.mp-consent__btn--pill {
  padding: 11px 22px;
  background: #fff;
  color: var(--mp-cmp-text);
  border: 1px solid var(--mp-cmp-border);
  border-radius: 999px;
}

.mp-consent__btn--pill:hover,
.mp-consent__btn--pill:focus-visible {
  background: #fafafa;
  border-color: #c8c8c8;
}

.mp-consent__btn--pill-accent {
  font-weight: 600;
}

/* Modal */
.mp-consent__overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--mp-cmp-z) + 1);
  background: rgba(0, 0, 0, 0.4);
}

.mp-consent__modal {
  position: fixed;
  inset: 0;
  z-index: calc(var(--mp-cmp-z) + 2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.mp-consent__modal[hidden] {
  display: none !important;
}

.mp-consent__overlay[hidden] {
  display: none !important;
}

.mp-consent__modal-panel {
  width: min(100%, 480px);
  max-height: min(88vh, 560px);
  overflow: auto;
  background: var(--mp-cmp-bg);
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.16);
  border: 1px solid #ebebeb;
}

.mp-consent__modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid #eee;
}

.mp-consent__modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.mp-consent__modal-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid var(--mp-cmp-border);
  border-radius: 50%;
  background: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.mp-consent__modal-body {
  padding: 8px 22px 12px;
}

.mp-consent__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #eee;
}

.mp-consent__row:last-child {
  border-bottom: none;
}

.mp-consent__row--static {
  opacity: 0.9;
}

.mp-consent__row-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}

.mp-consent__row-desc {
  margin: 0;
  font-size: 13px;
  color: var(--mp-cmp-muted);
  line-height: 1.45;
}

.mp-consent__row-note {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--mp-cmp-muted);
}

.mp-consent__switch {
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
}

.mp-consent__switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.mp-consent__switch-ui {
  position: relative;
  display: block;
  width: 46px;
  height: 26px;
  background: #d1d5db;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.mp-consent__switch-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.mp-consent__switch-input:checked + .mp-consent__switch-ui {
  background: #111;
}

.mp-consent__switch-input:checked + .mp-consent__switch-ui::after {
  transform: translateX(20px);
}

.mp-consent__modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 22px 20px;
  border-top: 1px solid #eee;
}

.mp-consent-modal-open {
  overflow: hidden;
}

.mp-consent-policy {
  margin-top: 2rem;
}

.mp-consent-policy__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.mp-consent-policy__table-wrap {
  overflow-x: auto;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
}

.mp-consent-policy__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.mp-consent-policy__table th,
.mp-consent-policy__table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  text-align: left;
  vertical-align: top;
}

.mp-consent-policy__table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  background: #fafafa;
  color: var(--mp-cmp-muted);
}

@media (max-width: 720px) {
  .mp-consent__box {
    padding: 22px 20px;
  }

  .mp-consent__aside {
    width: 100%;
    justify-content: stretch;
  }

  .mp-consent__actions {
    width: 100%;
    justify-content: stretch;
  }

  .mp-consent__btn--pill {
    flex: 1 1 calc(50% - 5px);
    text-align: center;
    padding: 12px 14px;
  }

  .mp-consent__btn--pill-accent {
    flex: 1 1 100%;
  }
}
