/* ===========================================
   COOKIE BANNER — Invisible en la Red
   =========================================== */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ===== BANNER ===== */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  z-index: 10000;
  background: #FFFFFF;
  border: 1px solid rgba(26, 26, 46, 0.1);
  border-radius: 24px;
  padding: 24px 28px;
  box-shadow: 0 30px 80px -20px rgba(26, 26, 46, 0.25),
              0 0 0 1px rgba(26, 26, 46, 0.04);
  max-width: 1200px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.5s cubic-bezier(0.2, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.2, 1, 0.3, 1);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  pointer-events: auto;
  cursor: auto;
}
.cookie-banner * { cursor: auto; }
.cookie-banner button,
.cookie-banner a,
.cookie-banner [data-cookie-action] { cursor: pointer !important; }
.cookie-banner--visible {
  opacity: 1;
  transform: translateY(0);
}

.cookie-banner-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
}
@media (max-width: 880px) {
  .cookie-banner {
    bottom: 12px;
    left: 12px;
    right: 12px;
    padding: 20px 22px;
    border-radius: 20px;
  }
  .cookie-banner-inner {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.cookie-banner-text {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.cookie-banner-icon {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .cookie-banner-icon { display: none; }
}
.cookie-banner-text h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 500;
  color: #1A1A2E;
  margin: 0 0 6px 0;
}
.cookie-banner-text p {
  font-size: 14px;
  line-height: 1.55;
  color: #4A4A5E;
  margin: 0;
}
.cookie-banner-text a {
  color: #FF4D6D;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
@media (max-width: 880px) {
  .cookie-banner-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .cookie-banner-actions .cookie-btn { flex: 1; min-width: 100px; }
}

/* ===== BUTTONS ===== */
.cookie-btn {
  font-family: 'DM Sans', -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 1, 0.3, 1);
  white-space: nowrap;
  letter-spacing: 0.01em;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}
.cookie-btn-config {
  background: transparent;
  color: #1A1A2E;
  border: 1.5px solid rgba(26, 26, 46, 0.15);
}
.cookie-btn-config:hover {
  background: rgba(26, 26, 46, 0.05);
  border-color: rgba(26, 26, 46, 0.3);
}
.cookie-btn-reject {
  background: #F5EFE6;
  color: #1A1A2E;
}
.cookie-btn-reject:hover {
  background: #EAE0CD;
}
.cookie-btn-accept,
.cookie-btn-save {
  background: #1A1A2E;
  color: #FAF7F2;
  position: relative;
  overflow: hidden;
}
.cookie-btn-accept:hover,
.cookie-btn-save:hover {
  background: #FF4D6D;
  transform: translateY(-1px);
  box-shadow: 0 12px 30px -10px rgba(255, 77, 109, 0.4);
}

/* ===== MODAL ===== */
.cookie-modal[hidden] { display: none !important; }
.cookie-banner[hidden] { display: none !important; }

.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: 'DM Sans', -apple-system, sans-serif;
  pointer-events: auto;
  cursor: auto;
}
.cookie-modal * { cursor: auto; }
.cookie-modal button,
.cookie-modal a,
.cookie-modal label,
.cookie-modal [data-cookie-action] { cursor: pointer !important; }
.cookie-modal input[disabled] + label { cursor: not-allowed !important; }
.cookie-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 46, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cookie-modal--visible .cookie-modal-backdrop {
  opacity: 1;
}
.cookie-modal-box {
  position: relative;
  background: #FAF7F2;
  border-radius: 28px;
  padding: 48px 40px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.3s cubic-bezier(0.2, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.2, 1, 0.3, 1);
}
.cookie-modal--visible .cookie-modal-box {
  opacity: 1;
  transform: translateY(0) scale(1);
}
@media (max-width: 600px) {
  .cookie-modal-box {
    padding: 36px 24px;
    border-radius: 24px;
  }
}

.cookie-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(26, 26, 46, 0.06);
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #1A1A2E;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.cookie-modal-close:hover {
  background: rgba(26, 26, 46, 0.12);
}

.cookie-modal h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 400;
  color: #1A1A2E;
  margin: 0 0 12px 0;
  padding-right: 40px;
}
.cookie-modal-lead {
  font-size: 15px;
  line-height: 1.6;
  color: #4A4A5E;
  margin: 0 0 28px 0;
}

.cookie-category {
  padding: 20px 22px;
  background: #FFFFFF;
  border: 1px solid rgba(26, 26, 46, 0.08);
  border-radius: 16px;
  margin-bottom: 14px;
}
.cookie-category-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}
.cookie-category-head h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 500;
  color: #1A1A2E;
  margin: 0;
}
.cookie-required,
.cookie-optional {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
  display: inline-block;
  margin-top: 4px;
}
.cookie-required {
  color: #B8E0D2;
  background: #1A1A2E;
  padding: 3px 8px;
  border-radius: 999px;
}
.cookie-optional {
  color: #7A7A8E;
}
.cookie-category p {
  font-size: 13px;
  line-height: 1.55;
  color: #4A4A5E;
  margin: 0;
}

/* Toggle switch */
.cookie-toggle {
  flex-shrink: 0;
}
.cookie-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.cookie-toggle label {
  display: block;
  width: 46px;
  height: 26px;
  background: #D4D4D8;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
}
.cookie-toggle label::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.2, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.cookie-toggle input:checked + label {
  background: #1A1A2E;
}
.cookie-toggle input:checked + label::after {
  transform: translateX(20px);
}
.cookie-toggle input:disabled + label {
  background: #1A1A2E;
  opacity: 0.7;
  cursor: not-allowed;
}

.cookie-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.cookie-modal-actions .cookie-btn {
  flex: 1;
  min-width: 140px;
}
@media (max-width: 600px) {
  .cookie-modal-actions { flex-direction: column; }
  .cookie-modal-actions .cookie-btn { width: 100%; }
}

.cookie-modal-foot {
  font-size: 12px;
  line-height: 1.5;
  color: #7A7A8E;
  margin: 20px 0 0 0;
  text-align: center;
}
.cookie-modal-foot a {
  color: #FF4D6D;
  text-decoration: underline;
}
.cookie-modal-foot em {
  font-style: italic;
  color: #1A1A2E;
}
