.print-poster-tool-page {
  background: #f3f4f6;
}

.print-poster-tool {
  margin-bottom: 2rem;
}

.print-poster-tool .row {
  align-items: flex-start;
}

/* Columna config: por encima del preview si algo se solapa */
.print-poster-tool__panel {
  position: relative;
  z-index: 20;
}

@media (min-width: 992px) {
  .print-poster-tool__panel {
    position: sticky;
    top: 1rem;
  }
}

.print-poster-tool__panel .card {
  border-radius: var(--theme-border-radius-2, 12px);
}

.print-poster-tool__field-select {
  position: relative;
  z-index: 30;
}

.print-poster-tool__intro {
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.45;
  margin-bottom: 0;
}

.print-poster-tool__section-title {
  color: #374151;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
}

.print-poster-tool__options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.print-poster-tool__option {
  align-items: flex-start;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--theme-border-radius-1, 10px);
  cursor: pointer;
  display: flex;
  gap: 0.65rem;
  margin: 0;
  padding: 0.75rem 0.85rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.print-poster-tool__option:hover {
  border-color: #d1d5db;
}

.print-poster-tool__option:has(.form-check-input:checked) {
  background: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.04);
  border-color: var(--bs-primary, #0d6efd);
  box-shadow: 0 0 0 1px var(--bs-primary, #0d6efd);
}

.print-poster-tool__option .form-check-input {
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.print-poster-tool__option-body {
  flex: 1;
  min-width: 0;
}

.print-poster-tool__option-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.print-poster-tool__option-meta {
  color: #6b7280;
  display: block;
  font-size: 0.8rem;
  line-height: 1.35;
  margin-top: 0.15rem;
}

.print-poster-tool__template-picker {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.print-poster-tool__template-option {
  align-items: stretch;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--theme-border-radius-1, 10px);
  cursor: pointer;
  display: flex;
  gap: 0.65rem;
  margin: 0;
  padding: 0.65rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.print-poster-tool__template-option:hover {
  border-color: #d1d5db;
}

.print-poster-tool__template-option:has(.form-check-input:checked) {
  background: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.04);
  border-color: var(--bs-primary, #0d6efd);
  box-shadow: 0 0 0 1px var(--bs-primary, #0d6efd);
}

.print-poster-tool__template-option .form-check-input {
  flex-shrink: 0;
  margin-top: 0.35rem;
}

.print-poster-tool__template-option-body {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 0.75rem;
  min-width: 0;
}

.print-poster-tool__template-thumb {
  background: #f3f4f6;
  border-radius: 6px;
  flex-shrink: 0;
  height: 72px;
  overflow: hidden;
  width: 48px;
}

.print-poster-tool__template-thumb-img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.print-poster-tool__template-thumb--mock {
  border: 1px solid #e5e7eb;
  position: relative;
}

.print-poster-tool__template-thumb--status1 {
  background: linear-gradient(180deg, #94a3b8 0 38%, #f3f4f6 38% 55%, #e5e7eb 55% 72%, #fff 72%);
}

.print-poster-tool__template-thumb--status1::after {
  background: var(--bs-primary, #881155);
  border-radius: 2px;
  content: "";
  height: 8px;
  left: 50%;
  position: absolute;
  top: 32%;
  transform: translateX(-50%);
  width: 70%;
}

.print-poster-tool__template-thumb--status2 {
  background: linear-gradient(180deg, #64748b 0 62%, #fff 62%);
}

.print-poster-tool__template-thumb--status2::after {
  background: #fff;
  border-radius: 2px;
  bottom: 18%;
  content: "";
  height: 6px;
  left: 12%;
  position: absolute;
  width: 50%;
}

.print-poster-tool__template-thumb--status3 {
  background: linear-gradient(180deg, #cbd5e1 0 40%, var(--bs-primary, #881155) 40% 52%, #f3f4f6 52%);
}

.print-poster-tool__template-option-text {
  flex: 1;
  min-width: 0;
}

/* Preview: no desbordar sobre la columna izquierda */
.print-poster-tool__preview-col {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.print-poster-tool__preview.card {
  border-radius: var(--theme-border-radius-2, 12px);
  overflow: visible;
}

.print-poster-tool__preview-toolbar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  border-radius: var(--theme-border-radius-2, 12px) var(--theme-border-radius-2, 12px) 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  justify-content: space-between;
  padding: 0.85rem 1.15rem;
}

.print-poster-tool__preview-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.print-poster-tool__preview-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.print-poster-tool__preview-badge {
  background: #f3f4f6;
  border-radius: 999px;
  color: #374151;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
}

.print-poster-tool__preview-hint {
  color: #9ca3af;
  font-size: 0.8rem;
  margin: 0;
}

.print-poster-tool__preview-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.print-poster-tool__preview-stage {
  background: linear-gradient(180deg, #eef1f6 0%, #e5e9f0 100%);
  border-radius: 0 0 var(--theme-border-radius-2, 12px) var(--theme-border-radius-2, 12px);
  min-height: min(75vh, 880px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1.5rem;
  position: relative;
}

.print-poster-tool__preview-stage-inner {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: min(70vh, 820px);
  width: 100%;
}

@media (min-width: 992px) {
  body.print-poster-tool-page {
    height: 100dvh;
    overflow: hidden;
  }

  .print-poster-tool-page > .container-fluid {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .print-poster-tool {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    margin-bottom: 0;
    min-height: 0;
    overflow: hidden;
    width: 100%;
  }

  .print-poster-tool > .row {
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .print-poster-tool__panel {
    align-self: stretch;
    max-height: 100%;
    overflow: hidden;
    position: relative;
    top: auto;
  }

  .print-poster-tool__panel .card {
    display: flex;
    flex-direction: column;
    max-height: 100%;
    overflow: hidden;
  }

  .print-poster-tool__panel .card-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .print-poster-tool__preview-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .print-poster-tool__preview.card {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .print-poster-tool__preview-stage {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .print-poster-tool__preview-stage-inner {
    height: 100%;
    min-height: 0;
  }
}

.print-poster-tool__iframe-wrap {
  background: #fff;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
  flex: 0 0 auto;
  line-height: 0;
  overflow: hidden;
  position: relative;
}

.print-poster-tool__iframe-scaler {
  transform-origin: 0 0;
}

#printPosterView {
  border: 0;
  display: block;
  max-width: none;
  vertical-align: top;
}

.print-poster-tool__preview-stage--loading .print-poster-tool__iframe-wrap {
  opacity: 0.55;
  pointer-events: none;
}

.print-poster-tool__loader {
  align-items: center;
  color: #4b5563;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  inset: 0;
  justify-content: center;
  pointer-events: none;
  position: absolute;
  z-index: 5;
}

.print-poster-tool__preview-stage--loading .print-poster-tool__loader {
  display: flex;
}

/* Dropdown del selectpicker en body */
body.print-poster-tool-page .bootstrap-select .dropdown-menu {
  max-width: min(520px, calc(100vw - 2rem));
  z-index: 1080 !important;
}

@media (max-width: 991.98px) {
  .print-poster-tool__panel {
    position: relative;
    z-index: 20;
  }

  .print-poster-tool__preview-stage {
    min-height: 45vh;
    padding: 1rem;
  }

  .print-poster-tool__preview-stage-inner {
    min-height: 40vh;
  }
}
