/* ═══════════════════════════════════
   Devron Cookies — Cookie Banner (compact portrait card)
   Frontend: hex puros (sem --dk-* tokens). Exceção docada no CLAUDE.md §9.
   ═══════════════════════════════════ */

.devron-cb {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 999999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  padding: 16px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.devron-cb--bottom,
.devron-cb--bottom-left,
.devron-cb--bottom-right { bottom: 0; align-items: flex-end; }

.devron-cb--bottom       { justify-content: center; }
.devron-cb--bottom-left  { justify-content: flex-start; }
.devron-cb--bottom-right { justify-content: flex-end; }

.devron-cb-card {
  pointer-events: auto;
  width: 100%;
  max-width: 433px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08), 0 2px 6px rgba(15, 23, 42, .04);
  overflow: hidden;
  animation: devron-cb-in .35s cubic-bezier(.2, .9, .3, 1);
}

@keyframes devron-cb-in {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ── Body (portrait stack) ── */
.devron-cb-body {
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Header: mark + título ── */
.devron-cb-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.devron-cb-mark {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex-shrink: 0;
}

.devron-cb-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: #0f172a;
  line-height: 1.3;
}

/* ── Conteúdo textual ── */
.devron-cb-content {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.devron-cb-text {
  margin: 0;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}

.devron-cb-text a {
  color: #0f172a;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.devron-cb-text a:hover { color: #000; }

/* ══════════════════════════════════
   Buttons (outlined neutral, rect 8px)
   ══════════════════════════════════ */
.devron-cb-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}

.devron-cb-btn {
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .12s ease;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.devron-cb-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.devron-cb-btn:active { transform: scale(.985); }

.devron-cb-btn:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}

/* Primary fill — usa --cb-primary injetado via PHP a partir de `btn_color` */
.devron-cb-btn--primary {
  background: var(--cb-primary, #1d2327);
  border-color: var(--cb-primary, #1d2327);
  color: #ffffff;
  font-weight: 600;
}

.devron-cb-btn--primary:hover {
  background: var(--cb-primary, #1d2327);
  border-color: var(--cb-primary, #1d2327);
  filter: brightness(1.12);
}

.devron-cb-btn--primary:focus-visible {
  outline-color: var(--cb-primary, #1d2327);
}

/* "Mais opções" — botão full-width abaixo da linha de ações */
.devron-cb-more {
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color .15s ease, border-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}

.devron-cb-more:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.devron-cb-more:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}

.devron-cb-more svg { flex-shrink: 0; }

/* ── Footer "Powered by Devron" ── */
.devron-cb-footer {
  padding: 8px 18px 10px;
  display: flex;
  justify-content: center;
  border-top: 1px solid #f1f5f9;
}

.devron-cb-powered {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  opacity: .8;
  transition: opacity .2s ease;
}

.devron-cb-powered:hover { opacity: 1; }

.devron-cb-powered small {
  font-size: 10px;
  color: #64748b;
  letter-spacing: .2px;
}

.devron-cb-powered img {
  height: 12px;
  width: auto;
  display: block;
}

/* ═══════════════════════════════════
   Cookie Modal (configuration)
   ═══════════════════════════════════ */

.devron-cb-modal {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding: 16px;
}

.devron-cb-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  cursor: pointer;
  backdrop-filter: blur(2px);
}

.devron-cb-modal-content {
  position: relative;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  width: 100%;
  max-width: 433px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
  animation: devron-cb-modal-in .25s ease;
  overflow: hidden;
}

@keyframes devron-cb-modal-in {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

.devron-cb-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  color: #475569;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  transition: all .15s;
  z-index: 1;
}

.devron-cb-modal-close:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}

.devron-cb-modal-body {
  padding: 22px 20px 16px;
  overflow-y: auto;
  flex: 1;
}

.devron-cb-modal-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
  letter-spacing: -.01em;
}

.devron-cb-modal-desc {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: #475569;
  line-height: 1.5;
}

.devron-cb-modal-subtitle {
  margin: 18px 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: 0;
}

/* ── Category cards ── */
.devron-cb-cat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.devron-cb-cat-item {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  transition: border-color .15s ease;
}

.devron-cb-cat-item.is-open {
  border-color: #cbd5e1;
}

.devron-cb-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 12px 2px 4px;
}

.devron-cb-cat-trigger {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 10px 8px;
  margin: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.devron-cb-cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 16px;
  font-weight: 400;
  color: #64748b;
  line-height: 1;
  transition: transform .2s ease;
  flex-shrink: 0;
}

.devron-cb-cat-item.is-open .devron-cb-cat-icon { transform: rotate(45deg); }

.devron-cb-cat-label { font-weight: 500; }

.devron-cb-always {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 400;
  white-space: nowrap;
}

.devron-cb-cat-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  padding: 0 14px;
}

.devron-cb-cat-item.is-open .devron-cb-cat-body {
  max-height: 400px;
  padding: 0 14px 12px;
}

.devron-cb-cat-desc {
  margin: 0 0 8px;
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
}

.devron-cb-services {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.devron-cb-service-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 500;
  color: #475569;
  background: #f1f5f9;
  border-radius: 12px;
  border: 1px solid transparent;
}

/* ── Toggle switch ── */
.devron-cb-cat-switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.devron-cb-cat-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.devron-cb-toggle-switch {
  position: relative;
  width: 34px;
  height: 20px;
  background: #cbd5e1;
  border-radius: 22px;
  transition: background .2s;
  flex-shrink: 0;
}

.devron-cb-toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

.devron-cb-cat-switch input:checked + .devron-cb-toggle-switch { background: #0f172a; }
.devron-cb-cat-switch input:checked + .devron-cb-toggle-switch::after { transform: translateX(14px); }
.devron-cb-cat-switch input:focus-visible + .devron-cb-toggle-switch {
  box-shadow: 0 0 0 3px rgba(15, 23, 42, .15);
}

/* ── Modal footer (Recusar + Salvar) ── */
.devron-cb-modal-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 20px 6px;
  background: transparent;
}

.devron-cb-modal-footer .devron-cb-btn {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
}

.devron-cb-footer--modal {
  background: transparent;
  border-top: none;
  padding: 4px 20px 14px;
}

/* ── Reopen button ── */
.devron-cb-reopen {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 9999999;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .1);
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.devron-cb-reopen:hover,
.devron-cb-reopen:active {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: scale(1.05);
}

/* ── Iframe placeholder (mantido) ── */
.devron-cb-iframe-placeholder {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px 0;
}

.devron-cb-iframe-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px;
  text-align: center;
  color: #475569;
}

.devron-cb-iframe-msg svg { color: #94a3b8; }
.devron-cb-iframe-msg span { font-size: 13px; }

.devron-cb-iframe-accept {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}

.devron-cb-iframe-accept:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .devron-cb { padding: 12px; }
  .devron-cb-card { max-width: 100%; }

  .devron-cb-modal { padding: 0; align-items: flex-end; }
  .devron-cb-modal-content {
    max-width: 100%;
    border-radius: 12px 12px 0 0;
    max-height: 92vh;
    border-bottom: none;
  }
}
