/* ==========================================================================
   Componente: Offer Image Framer (Enquadramento, Zoom e Posicionamento de Banner)
   ========================================================================== */

.offer-image-framer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

/* ── Cabeçalho / Ações do Topo ── */
.offer-framer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.offer-framer-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.offer-framer-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-gray-800, #1e293b);
  margin: 0;
}

.offer-framer-subtitle {
  font-size: 0.8rem;
  color: var(--color-gray-500, #64748b);
  margin: 0;
}

.offer-framer-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.offer-framer-btn-change {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  background-color: var(--color-surface-card, #ffffff);
  border: 1px solid var(--color-gray-300, #d1d5db);
  color: var(--color-gray-700, #374151);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.offer-framer-btn-change:hover {
  background-color: var(--color-gray-100, #f3f4f6);
  border-color: var(--color-gray-400, #9ca3af);
  color: var(--color-gray-900, #111827);
}

/* ── Dropzone / Estado Vazio ── */
.offer-framer-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.25rem 1.5rem;
  border: 2px dashed var(--color-gray-300, #d1d5db);
  border-radius: 10px;
  background-color: var(--color-gray-50, #f9fafb);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.offer-framer-dropzone:hover,
.offer-framer-dropzone.is-dragover {
  border-color: var(--color-brand, #2e7d32);
  background-color: var(--color-brand-subtle, rgba(46, 125, 50, 0.04));
}

.offer-framer-dropzone-icon {
  font-size: 2.25rem;
  color: var(--color-gray-400, #9ca3af);
  margin-bottom: 0.5rem;
  transition: color 0.2s ease, transform 0.2s ease;
}

.offer-framer-dropzone:hover .offer-framer-dropzone-icon {
  color: var(--color-brand, #2e7d32);
  transform: translateY(-2px);
}

.offer-framer-dropzone-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-gray-700, #374151);
  margin-bottom: 0.25rem;
}

.offer-framer-dropzone-hint {
  font-size: 0.8rem;
  color: var(--color-gray-500, #6b7280);
}

/* ── Seção de Enquadramento ── */
.offer-framer-stage {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.offer-framer-stage-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-gray-800, #1f2937);
  margin: 0;
}

/* ── Viewport / Janela de Enquadramento ── */
.offer-framer-viewport {
  position: relative;
  width: 100%;
  max-width: 820px;
  aspect-ratio: 16 / 7;
  min-height: 220px;
  max-height: 380px;
  border-radius: 10px;
  border: 1px solid var(--color-gray-300, #d1d5db);
  background-color: #0b0f19;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: grab;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.06);
}

.offer-framer-viewport:focus-visible {
  outline: 2px solid var(--color-brand, #2e7d32);
  outline-offset: 2px;
}

.offer-framer-viewport.is-dragging {
  cursor: grabbing;
}

.offer-framer-img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  max-height: none;
  pointer-events: none;
  transform-origin: 0 0;
  will-change: transform;
}

/* Grade de enquadramento sutil */
.offer-framer-grid-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 33.333% 33.333%;
}

.offer-framer-viewport:hover .offer-framer-grid-overlay,
.offer-framer-viewport.is-dragging .offer-framer-grid-overlay {
  opacity: 1;
}

/* ── Legenda de Instrução ── */
.offer-framer-caption {
  font-size: 0.8rem;
  color: var(--color-gray-600, #4b5563);
  margin: 0.25rem 0 0.5rem 0;
}

/* ── Controle de Zoom ── */
.offer-framer-zoom-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 440px;
}

.offer-framer-zoom-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-gray-700, #374151);
  min-width: 40px;
}

.offer-framer-zoom-range {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--color-gray-200, #e5e7eb);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  accent-color: var(--color-brand, #2e7d32);
}

.offer-framer-zoom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-brand, #2e7d32);
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.offer-framer-zoom-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.offer-framer-zoom-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-brand, #2e7d32);
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.offer-framer-zoom-val {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-gray-700, #374151);
  min-width: 48px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Badges e botões auxiliares ── */
.offer-framer-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

@media (max-width: 576px) {
  .offer-framer-viewport {
    min-height: 180px;
    aspect-ratio: 16 / 9;
  }

  .offer-framer-zoom-row {
    max-width: 100%;
  }
}
