/* ============================================================
   WEB BUILDER – Estilo Premium AS.GEST
   Arquivo: /css/webbuilder.css
   ============================================================ */

/* Layout base da página */
.page-comercial-web-builder {
  padding: 20px 30px;
  display: flex;
  flex-direction: column;
  gap: 25px;
  background: var(--cinza-claro, #f7f8fa);
  min-height: 100vh;
  font-family: "Inter", sans-serif;
}

/* Cabeçalho */
.page-header {
  margin-bottom: 10px;
}

.page-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-title-pill {
  background: #0369a1;
  padding: 5px 14px;
  color: #fff;
  border-radius: 14px;
  font-size: 13px;
  margin-right: 6px;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
}

.page-subtitle {
  font-size: 15px;
  color: #6b7280;
}

/* Layout principal */
.builder-layout {
  display: flex;
  gap: 25px;
}

/* Painéis */
.builder-panel {
  background: transparent;
}

/* Editor – 65% */
.builder-editor {
  flex: 0 0 65%;
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding-right: 10px;
  overflow-y: auto;
}

/* Preview – 35% */
.builder-preview {
  flex: 0 0 35%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Cards Premium */
.builder-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.05),
    0 8px 20px rgba(0, 0, 0, 0.06);
  padding: 22px 25px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card-header {
  margin-bottom: -8px;
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  color: #111827;
}

.card-subtitle {
  margin-top: 4px;
  font-size: 14px;
  color: #6b7280;
}

/* Inputs Premium */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 15px;
  outline: none;
  background: #f9fafb;
  transition: all 0.15s ease;
}

.input:focus {
  border-color: #0ea5e9;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

/* Color Picker */
.input-color {
  width: 60px;
  height: 40px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #d1d5db;
}

/* Linha de inputs */
.field-row {
  display: flex;
  gap: 20px;
}

/* Input com prefixo */
.input-group {
  display: flex;
  align-items: center;
  background: #f3f4f6;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #d1d5db;
}

.input-prefix {
  padding: 12px;
  background: #e5e7eb;
  color: #374151;
  font-size: 14px;
}

.input-group .input {
  border: none;
  background: transparent;
}

/* Listas visuais (carrossel, encartes, parceiros) */
.media-list,
.partners-list,
.encartes-list,
.buttons-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Mini-card para imagens */
.media-item {
  background: #f9fafb;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid #e5e7eb;
}

.media-item img {
  width: 100px;
  height: 58px;
  object-fit: cover;
  border-radius: 8px;
}

/* Botões */
.btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

/* Botão primário Premium (gradiente AS.GEST) */
.btn-primary {
  background: linear-gradient(90deg, #0369a1, #0ea5e9);
  color: white;
  font-weight: 600;
}

.btn-primary:hover {
  opacity: 0.9;
}

/* Secundário */
.btn-secondary {
  background: #e2e8f0;
  color: #1e293b;
  font-weight: 500;
}

.btn-secondary:hover {
  background: #cbd5e1;
}

/* Botão simples */
.btn-ghost {
  background: transparent;
  color: #334155;
  font-weight: 500;
}

/* Danger */
.btn-danger {
  background: #ef4444;
  color: white;
  font-weight: 600;
}

.btn-danger:hover {
  background: #dc2626;
}

/* Ações finais */
.builder-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 18px;
  margin-top: 10px;
}

.builder-actions-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Status de salvamento */
.builder-status {
  font-size: 22px;
  color: #0ea5e9;
  animation: pulse 1.2s infinite ease-in-out;
}

@keyframes pulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* Preview */
.builder-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-devices {
  display: flex;
  gap: 8px;
}

.preview-device-btn {
  padding: 8px 12px;
  border-radius: 8px;
  background: #e5e7eb;
  cursor: pointer;
  border: none;
}

.preview-device-btn.active {
  background: #0369a1;
  color: white;
}

.preview-frame-wrapper {
  background: #dfe3e8;
  padding: 18px;
  border-radius: 18px;
  height: calc(100vh - 220px);
  overflow: auto;
}

.preview-frame {
  background: white;
  border-radius: 14px;
  min-height: 100%;
  box-shadow:
    0 0 0 1px #e5e7eb,
    0 12px 28px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.preview-placeholder {
  padding: 40px;
  text-align: center;
  color: #64748b;
  font-size: 15px;
}

/* Modais */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal[aria-hidden="false"] {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.modal-dialog {
  background: white;
  border-radius: 16px;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.1),
    0 20px 48px rgba(0, 0, 0, 0.15);
  width: 520px;
  padding: 25px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-dialog-large {
  width: 720px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: #475569;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-footer-right {
  display: flex;
  gap: 10px;
}

/* Etapas do parceiro */
.modal-steps {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.modal-step {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px;
  cursor: pointer;
}

.modal-step.active {
  background: #0369a1;
  color: white;
  border-color: #0369a1;
}

.modal-step-content {
  display: none;
}

.modal-step-content.active {
  display: block;
}

/* Responsividade */
@media (max-width: 1024px) {
  .builder-layout {
    flex-direction: column;
  }
  .builder-editor, .builder-preview {
    flex: 0 0 100%;
  }
}