/* DigiBook Store - Cookie Consent & Settings Styling */
:root {
  --consent-bg: #ffffff;
  --consent-text: #171717;
  --consent-muted: #6b7280;
  --consent-accent: #10B981;
  --consent-line: #168BFF;
  --consent-glow: rgba(22, 139, 255, 0.12);
  --consent-soft: #faf8f3;
  --consent-radius: 12px;
}

/* --- Banner --- */
.consent-banner-wrapper {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(23, 23, 23, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  padding: 16px 20px;
  animation: consentFadeIn 0.25s ease-out;
}

.consent-banner {
  max-width: 1180px;
  width: 100%;
  background: var(--consent-bg);
  border: 1.5px solid var(--consent-line);
  border-radius: var(--consent-radius);
  box-shadow: 0 10px 35px var(--consent-glow);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.consent-banner-text {
  flex: 1;
}

.consent-banner-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--consent-text);
}

.consent-banner-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--consent-muted);
  margin: 0;
}

.consent-banner-desc a {
  color: #2563EB;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.consent-banner-desc a:hover {
  color: #1d4ed8;
}

.consent-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Buttons */
.consent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  white-space: nowrap;
  text-decoration: none;
}

.consent-btn-primary {
  background: #10B981;
  color: #ffffff;
  border-color: #10B981;
}

.consent-btn-primary:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.consent-btn-secondary {
  background: #ffffff;
  color: var(--consent-text);
  border: 1.5px solid var(--consent-line);
}

.consent-btn-secondary:hover {
  background: var(--consent-soft);
  border-color: #0d76e0;
}

.consent-btn-link {
  background: transparent;
  color: var(--consent-muted);
  border-color: transparent;
  padding: 11px 14px;
}

.consent-btn-link:hover {
  color: var(--consent-text);
  text-decoration: underline;
}

/* --- Modal Dialog --- */
.consent-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(18, 18, 18, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: consentFadeIn 0.2s ease-out;
}

.consent-modal {
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  background: var(--consent-bg);
  border: 1.5px solid var(--consent-line);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(22, 139, 255, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: consentScaleIn 0.22s ease-out;
}

.consent-modal-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--consent-line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.consent-modal-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
  color: var(--consent-text);
}

.consent-modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--consent-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s;
}

.consent-modal-close:hover {
  color: var(--consent-text);
}

.consent-modal-body {
  padding: 20px 28px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.55;
  color: var(--consent-muted);
}

.consent-modal-intro {
  margin: 0 0 20px 0;
}

.consent-category-card {
  border: 1px solid var(--consent-line);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: var(--consent-soft);
}

.consent-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.consent-category-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--consent-text);
  margin: 0;
}

.consent-category-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #e9e4d8;
  color: #4a453b;
}

.consent-category-desc {
  font-size: 13px;
  color: var(--consent-muted);
  margin: 0;
  line-height: 1.5;
}

/* Custom Toggle Switch */
.consent-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.consent-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #d1cbbf;
  transition: 0.2s;
  border-radius: 24px;
}

.consent-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.consent-switch input:checked + .consent-slider {
  background-color: var(--consent-accent);
}

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

.consent-switch input:disabled + .consent-slider {
  opacity: 0.65;
  cursor: not-allowed;
}

.consent-modal-footer {
  padding: 18px 28px;
  border-top: 1px solid var(--consent-line);
  background: #ffffff;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* Animations */
@keyframes consentFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes consentScaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* Responsive */
@media (max-width: 800px) {
  .consent-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    gap: 16px;
  }
  .consent-banner-actions {
    flex-direction: column;
    gap: 8px;
  }
  .consent-banner-actions .consent-btn {
    width: 100%;
    text-align: center;
  }
  .consent-modal {
    max-height: 95vh;
  }
  .consent-modal-header,
  .consent-modal-body,
  .consent-modal-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  .consent-modal-footer {
    flex-direction: column;
  }
  .consent-modal-footer .consent-btn {
    width: 100%;
  }
}
