/* ESSAM · Círculo de Quintas · botón flotante, consulta e impresión */
.cp-quintas-float {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  min-height: 40px;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  border: 1px solid rgba(42, 90, 58, 0.5);
  background: rgba(255, 255, 255, 0.94);
  color: #203c2b;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 4px 14px rgba(42, 90, 58, 0.22);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.cp-quintas-float:hover {
  background: #f1f7f2;
  border-color: #8b9364;
  box-shadow: 0 6px 18px rgba(42, 90, 58, 0.3);
}
.cp-quintas-float:active { cursor: grabbing; }

#cpQuintasPrintRoot {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  pointer-events: none;
}
.cp-q-panel {
  position: fixed;
  z-index: 2147483002;
  max-width: calc(100vw - 20px);
  max-height: calc(100vh - 20px);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(42, 90, 58, 0.35);
  background: #fffef9;
  color: #203c2b;
  box-shadow: 0 12px 40px rgba(42, 90, 58, 0.3);
  animation: cp-q-in 0.22s ease-out;
  pointer-events: auto;
}
@keyframes cp-q-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.cp-q-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(42, 90, 58, 0.18);
}
.cp-q-title {
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 600;
  color: #203c2b;
  font-size: 1rem;
  letter-spacing: 0.04em;
}
.cp-q-close {
  border: none;
  background: transparent;
  color: #203c2b;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
}
.cp-q-close:hover { color: #8b5d35; }
.cp-q-body { padding: 0.9rem 1rem 1rem; }
.cp-q-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(42, 90, 58, 0.24);
}
.cp-q-desc {
  margin: 0.6rem 0 0.8rem;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 0.95rem;
  color: #405c49;
  line-height: 1.45;
}
.cp-q-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}
.cp-q-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  border: 1px solid #8b9364;
  background: #f4f7ed;
  color: #203c2b;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.cp-q-action:hover { background: #e7f0e6; }
.cp-q-btn-cerrar {
  width: 100%;
  border-color: rgba(42, 90, 58, 0.35);
  background: transparent;
}
.cp-q-exam-btn {
  white-space: nowrap;
  cursor: pointer;
}

@media (prefers-color-scheme: dark) {
  .cp-quintas-float { background: rgba(29, 51, 38, 0.96); color: #f4f1e6; }
  .cp-q-panel { background: #22332a; color: #f4f1e6; }
  .cp-q-title, .cp-q-close, .cp-q-action { color: #f4f1e6; }
  .cp-q-desc { color: #c8dacb; }
  .cp-q-action { background: #304b39; border-color: #a8b57d; }
  .cp-q-action:hover { background: #3d5f48; }
}
@media (max-width: 520px) {
  .cp-quintas-float { right: 0.7rem; bottom: 0.7rem; min-width: 78px; min-height: 38px; padding: 0.45rem 0.85rem; font-size: 0.85rem; }
  .cp-q-panel { max-width: calc(100vw - 1rem); max-height: calc(100vh - 1rem); }
  .cp-q-actions { grid-template-columns: 1fr; }
}

body.cp-q-printing { overflow: hidden; }

@media print {
  body * { visibility: hidden !important; }
  #cpQuintasPrintRoot, #cpQuintasPrintRoot * { visibility: visible !important; }
  #cpQuintasPrintRoot {
    position: static !important;
    inset: auto !important;
    z-index: auto !important;
  }
  .cp-q-panel {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }
  .cp-q-head { justify-content: center; border: 0; }
  .cp-q-close, .cp-q-desc, .cp-q-actions, .cp-q-btn-cerrar { display: none !important; }
  .cp-q-body { padding: 0 !important; }
  .cp-q-img { width: 100% !important; max-height: 90vh !important; object-fit: contain; border: 0 !important; }
}
