/* ============================================================
   MUNDO RESEÑAS — Cookie Management Platform (CMP)
   Coherente con glass-morphism del site
   ============================================================ */

.mr-cmp *, .mr-cmp *::before, .mr-cmp *::after {
  box-sizing: border-box;
}

.mr-cmp {
  font-family: 'Montserrat', system-ui, sans-serif;
  color: #E2E8F0;
  font-size: 14px;
  line-height: 1.5;
}

/* ===== BANNER (bottom-right) ===== */
.mr-cmp-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 460px;
  max-width: calc(100vw - 32px);
  background: rgba(10, 26, 47, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.1) inset;
  z-index: 999990;
  opacity: 0;
  transform: translateY(20px);
  animation: mrCmpSlideUp 500ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes mrCmpSlideUp {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes mrCmpFadeOut {
  to { opacity: 0; transform: translateY(20px); }
}

.mr-cmp-banner.mr-cmp-closing {
  animation: mrCmpFadeOut 300ms ease-out forwards;
}

@media (max-width: 640px) {
  .mr-cmp-banner {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    border-bottom: none;
  }
}

.mr-cmp-banner-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.mr-cmp-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 194, 255, 0.2), rgba(0, 102, 255, 0.1));
  border: 1px solid rgba(0, 194, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.mr-cmp-banner h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.mr-cmp-banner-text {
  margin: 0 0 18px 0;
  font-size: 13px;
  line-height: 1.55;
  color: #94A3B8;
}

.mr-cmp-banner-text a {
  color: #00C2FF;
  text-decoration: none;
  border-bottom: 1px dotted rgba(0, 194, 255, 0.4);
  transition: border-color 200ms;
}

.mr-cmp-banner-text a:hover {
  border-bottom-color: #00C2FF;
}

.mr-cmp-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mr-cmp-btn {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 200ms ease;
  border: 1px solid transparent;
  text-align: center;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  outline: none;
}

.mr-cmp-btn:focus-visible {
  outline: 2px solid #00C2FF;
  outline-offset: 2px;
}

.mr-cmp-btn-accept {
  background: linear-gradient(135deg, #00C2FF 0%, #0066FF 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 194, 255, 0.25);
}

.mr-cmp-btn-accept:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 194, 255, 0.35);
}

.mr-cmp-btn-reject {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.mr-cmp-btn-reject:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.mr-cmp-btn-config {
  background: transparent;
  color: #94A3B8;
  border-color: rgba(255, 255, 255, 0.1);
  flex: 0 0 auto;
}

.mr-cmp-btn-config:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 480px) {
  .mr-cmp-buttons {
    flex-direction: column-reverse;
  }
  .mr-cmp-btn {
    width: 100%;
  }
}

/* ===== MODAL OVERLAY ===== */
.mr-cmp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 999998;
  opacity: 0;
  animation: mrCmpFadeIn 250ms ease-out forwards;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

@keyframes mrCmpFadeIn {
  to { opacity: 1; }
}

/* ===== MODAL CONFIG ===== */
.mr-cmp-modal {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  background: rgba(10, 26, 47, 0.98);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  z-index: 999999;
  opacity: 0;
  transform: scale(0.96) translateY(10px);
  animation: mrCmpModalIn 350ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes mrCmpModalIn {
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.mr-cmp-modal-header {
  padding: 24px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.mr-cmp-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mr-cmp-modal h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.mr-cmp-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94A3B8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-family: inherit;
  transition: all 200ms;
  padding: 0;
  line-height: 1;
}

.mr-cmp-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.mr-cmp-modal-body {
  padding: 20px 28px;
  overflow-y: auto;
  flex: 1;
}

.mr-cmp-modal-body::-webkit-scrollbar {
  width: 8px;
}

.mr-cmp-modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.mr-cmp-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.mr-cmp-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 194, 255, 0.3);
}

.mr-cmp-intro {
  margin: 0 0 20px 0;
  font-size: 13px;
  line-height: 1.6;
  color: #94A3B8;
}

/* ===== CATEGORÍAS ===== */
.mr-cmp-category {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 200ms;
}

.mr-cmp-category:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.mr-cmp-category-header {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}

.mr-cmp-category-info {
  flex: 1;
  min-width: 0;
}

.mr-cmp-category-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mr-cmp-required-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(0, 194, 255, 0.15);
  color: #00C2FF;
  border: 1px solid rgba(0, 194, 255, 0.3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mr-cmp-category-desc {
  font-size: 12px;
  color: #94A3B8;
  line-height: 1.45;
}

.mr-cmp-toggle-arrow {
  color: #64748B;
  font-size: 12px;
  transition: transform 250ms;
  flex-shrink: 0;
}

.mr-cmp-category.expanded .mr-cmp-toggle-arrow {
  transform: rotate(180deg);
}

/* ===== SWITCH iOS-STYLE ===== */
.mr-cmp-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.mr-cmp-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.mr-cmp-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 250ms;
  border-radius: 24px;
}

.mr-cmp-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.mr-cmp-switch input:checked + .mr-cmp-slider {
  background: linear-gradient(135deg, #00C2FF, #0066FF);
  border-color: rgba(0, 194, 255, 0.5);
  box-shadow: 0 0 12px rgba(0, 194, 255, 0.3);
}

.mr-cmp-switch input:checked + .mr-cmp-slider::before {
  transform: translateX(20px);
}

.mr-cmp-switch input:disabled + .mr-cmp-slider {
  opacity: 0.6;
  cursor: not-allowed;
}

.mr-cmp-switch input:focus-visible + .mr-cmp-slider {
  outline: 2px solid #00C2FF;
  outline-offset: 2px;
}

/* ===== TABLA DE COOKIES (expandida) ===== */
.mr-cmp-cookies-table {
  display: none;
  padding: 0 18px 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.mr-cmp-category.expanded .mr-cmp-cookies-table {
  display: block;
}

.mr-cmp-cookies-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  margin-top: 12px;
}

.mr-cmp-cookies-table thead th {
  font-weight: 600;
  color: #94A3B8;
  text-align: left;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mr-cmp-cookies-table tbody td {
  padding: 9px 12px 9px 0;
  color: #CBD5E1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: top;
}

.mr-cmp-cookies-table tbody td:first-child {
  font-family: 'JetBrains Mono', monospace;
  color: #00C2FF;
  font-size: 11px;
  white-space: nowrap;
  padding-right: 16px;
}

.mr-cmp-cookies-table tbody tr:last-child td {
  border-bottom: none;
}

.mr-cmp-empty-cookies {
  padding: 16px 0 4px 0;
  color: #64748B;
  font-size: 12px;
  font-style: italic;
}

/* ===== FOOTER MODAL ===== */
.mr-cmp-modal-footer {
  padding: 18px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 0 0 20px 20px;
}

.mr-cmp-modal-footer .mr-cmp-btn {
  flex: 1;
}

@media (max-width: 640px) {
  .mr-cmp-modal {
    max-height: 95vh;
    border-radius: 20px 20px 0 0;
  }
  .mr-cmp-modal-header,
  .mr-cmp-modal-body,
  .mr-cmp-modal-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  .mr-cmp-modal-footer {
    flex-direction: column-reverse;
  }
}

/* ===== FOOTER LINK (en el footer del site) ===== */
.mr-cmp-footer-link {
  color: #94A3B8;
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  padding: 0;
  text-decoration: none;
  transition: color 200ms;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mr-cmp-footer-link:hover {
  color: #00C2FF;
}

/* ===== ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
  .mr-cmp-banner,
  .mr-cmp-modal,
  .mr-cmp-overlay,
  .mr-cmp-toggle-arrow,
  .mr-cmp-slider::before {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
