/* ========================================
   FCamargo — Detalhe do Pedido
   ======================================== */

.layout { display: flex; min-height: calc(100vh - 6px); width: 100%; }

/* ---- Sidebar (compartilhada com dashboard) ---- */
.sidebar {
  width: 240px;
  background: var(--dark);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.sidebar-logo {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo-name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 20px;
  background: linear-gradient(90deg, var(--accent1), var(--accent4));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-logo-sub {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.nav-item:hover  { background: rgba(255, 255, 255, 0.07); color: rgba(255, 255, 255, 0.85); }
.nav-item.active { background: rgba(255, 255, 255, 0.1);  color: var(--white); }
.nav-icon        { font-size: 16px; }

.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 16px;
}

/* ---- Área principal ---- */
.main { flex: 1; min-width: 0; padding: 32px; overflow-y: auto; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray);
  text-decoration: none;
  margin-bottom: 20px;
  transition: color 0.15s;
}

.back-btn:hover { color: var(--dark); }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.pedido-titulo {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 28px;
  color: var(--dark);
}

.pedido-titulo span {
  color: var(--gray);
  font-weight: 500;
  font-size: 16px;
  margin-right: 8px;
}

.badge {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
}

.badge-producao  { background: var(--badge-producao-bg);  color: var(--badge-producao-text); }
.badge-concluido { background: var(--badge-concluido-bg); color: var(--badge-concluido-text); }
.badge-entregue  { background: var(--badge-entregue-bg);  color: var(--badge-entregue-text); }

.btn-entregar {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  background: var(--accent3);
  color: var(--white);
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-entregar:hover    { background: #1a7a40; }
.btn-entregar:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---- Grid de conteúdo ---- */
.grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }

.card {
  background: var(--white);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--dark);
  margin-bottom: 20px;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title-row .card-title { margin-bottom: 0; }

.btn-imagens {
  padding: 6px 14px;
  background: var(--bg-blue);
  color: var(--accent4);
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-imagens:hover { background: #d1eaf9; }

/* ---- Galeria de Imagens ---- */
.modal-galeria {
  background: var(--dark);
  border-radius: 24px;
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: popIn 0.2s ease;
  overflow: hidden;
}

.modal-galeria-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.modal-galeria-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--white);
}

.modal-galeria-close {
  background: rgba(255,255,255,0.1);
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.modal-galeria-close:hover { background: rgba(255,255,255,0.2); color: var(--white); }

.galeria-lista {
  overflow-y: auto;
  padding: 20px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.galeria-item { display: flex; flex-direction: column; gap: 10px; }

.galeria-item-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.galeria-img {
  width: 100%;
  border-radius: 14px;
  display: block;
  object-fit: contain;
  max-height: 480px;
  background: rgba(255,255,255,0.05);
}

.galeria-link-externo {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  align-self: flex-end;
  transition: color 0.15s;
}

.galeria-link-externo:hover { color: rgba(255,255,255,0.8); }

.galeria-img-erro {
  width: 100%;
  padding: 24px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1.5px dashed rgba(255,255,255,0.15);
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.galeria-img-erro a {
  color: var(--accent4);
  text-decoration: none;
  font-weight: 600;
}

.galeria-img-erro a:hover { text-decoration: underline; }

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.info-row:last-of-type { border-bottom: none; }
.info-label { color: var(--gray); }
.info-value { font-weight: 600; color: var(--dark); }

/* ---- Card de etapa atual ---- */
.etapa-card {
  background: var(--dark);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

.etapa-card .card-title { color: rgba(255, 255, 255, 0.6); margin-bottom: 8px; }

.etapa-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  margin-top: 16px;
  overflow: hidden;
}

.etapa-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent3), var(--accent4));
  border-radius: 3px;
  transition: width 0.4s ease;
}

.step-btn-desfazer {
  flex-shrink: 0;
  margin-left: auto;
  padding: 5px 12px;
  background: var(--bg-orange);
  color: var(--text-orange);
  border: none;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.step-btn-desfazer:hover { background: #fde8b0; }

.step-btn-concluir {
  flex-shrink: 0;
  margin-left: auto;
  padding: 5px 12px;
  background: var(--bg-green);
  color: var(--accent3);
  border: none;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.step-btn-concluir:hover { background: #c8f0da; }

.etapa-atual-nome {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 22px;
  color: var(--white);
  margin-bottom: 8px;
}

.etapa-numero {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 4px;
}

/* ---- Peças do pedido ---- */
.peca-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}

.peca-row:last-of-type { border-bottom: none; }
.peca-label  { font-weight: 600; color: var(--dark); }
.peca-detail { color: var(--gray); }
.peca-valor  { font-family: 'Montserrat', sans-serif; font-weight: 700; color: var(--dark); text-align: right; }

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid #f0f0f0;
}

.total-label { font-size: 14px; font-weight: 700; color: var(--dark); }
.total-value { font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 18px; color: var(--dark); }

/* ---- Timeline ---- */
.timeline { display: flex; flex-direction: column; }

.step { display: flex; align-items: center; gap: 14px; position: relative; }

.step:not(:last-child) .step-line {
  position: absolute;
  left: 13px;
  top: 28px;
  width: 2px;
  height: calc(100% + 4px);
  background: #eee;
}

.step-done .step-line { background: var(--accent3); }

.step-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.step-done .step-icon    { background: var(--accent3); color: white; }
.step-current .step-icon { background: var(--accent4); color: white; }
.step-pending .step-icon { background: #eee; color: #ccc; }

.step-body             { flex: 1; padding-bottom: 18px; }
.step-name             { font-size: 13px; font-weight: 600; color: var(--dark); }
.step-pending .step-name { color: #bbb; }
.step-date             { font-size: 11px; color: var(--gray); margin-top: 2px; }
.step-current-label    { font-size: 11px; font-weight: 700; color: var(--accent4); margin-top: 2px; }

/* ---- Modal de confirmação ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.visible { display: flex; }

.modal {
  background: var(--white);
  border-radius: 24px;
  padding: 36px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  animation: popIn 0.2s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-icon  { font-size: 48px; margin-bottom: 16px; }
.modal-title { font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 20px; color: var(--dark); margin-bottom: 8px; }
.modal-sub   { font-size: 14px; color: var(--gray); margin-bottom: 28px; line-height: 1.5; }

.modal-actions { display: flex; gap: 12px; }

.modal-btn {
  flex: 1;
  padding: 13px;
  border-radius: 12px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}

.modal-btn-cancel         { background: #f0f0f0; color: var(--gray); }
.modal-btn-cancel:hover   { background: #e5e5e5; color: var(--dark); }
.modal-btn-confirm        { background: var(--accent3); color: var(--white); }
.modal-btn-confirm:hover  { background: #1e8449; }

.header-acoes { display: flex; gap: 10px; align-items: flex-start; }

.btn-editar-pedido {
  padding: 8px 16px;
  background: var(--bg-blue);
  color: var(--accent4);
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  align-self: flex-start;
}
.btn-editar-pedido:hover { background: #cce4f7; }

.btn-excluir-pedido {
  padding: 8px 16px;
  background: var(--bg-red);
  color: var(--accent1);
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  transition: background 0.15s;
  align-self: flex-start;
}
.btn-excluir-pedido:hover { background: #f5b7b1; }

.pedido-left-col  { display: flex; flex-direction: column; gap: 20px; }
.pedido-badge-wrap { margin-top: 8px; }
.pedido-nao-encontrado { padding: 32px; color: #999; }
.etapa-concluida  { color: var(--accent3); }

/* ---- Produto (novo formato) ---- */
.produto-row {
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
}

.produto-row:last-of-type { border-bottom: none; }

.produto-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.produto-tipo {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--dark);
}

.produto-subtotal {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--dark);
}

.produto-detalhes { font-size: 13px; color: var(--gray); margin-bottom: 4px; }
.produto-estampa  { font-size: 12px; color: var(--accent4); margin-bottom: 4px; }
.produto-obs      { font-size: 12px; color: var(--gray); font-style: italic; margin-bottom: 4px; }
.produto-meta     { font-size: 11px; color: #bbb; margin-top: 6px; }

.btn-ver-imagem {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 12px;
  background: var(--bg-blue);
  color: var(--accent4);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-ver-imagem:hover { background: #d1eaf9; }

.produto-tamanhos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}

.tam-item {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--gray-light);
  border-radius: 6px;
  padding: 3px 8px;
}

.tam-label { font-size: 11px; font-weight: 700; color: var(--dark); }
.tam-qty   { font-size: 11px; color: var(--gray); }

/* ---- Grid de informações do pedido ---- */
.pedido-infos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.info-card {
  background: var(--white);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.info-valor {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  margin-top: 4px;
}

/* ---- Section card (timeline, peças) ---- */
.section-card {
  background: var(--white);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.section-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--dark);
  margin-bottom: 20px;
}

/* ---- Lista de peças ---- */
.pecas-lista { display: flex; flex-direction: column; }

.peca-item {
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
}
.peca-item:last-child { border-bottom: none; }

.peca-tipo {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--dark);
  margin-bottom: 4px;
}

.peca-detalhes {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 4px;
}

.peca-detalhes span:not(:last-child)::after { content: ' ·'; }

.peca-tamanhos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tamanho-badge {
  background: var(--gray-light);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--dark);
}

.peca-valor {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--accent4);
  margin-top: 6px;
}

.peca-obs {
  font-size: 12px;
  color: #666;
  background: #f8f8f8;
  border-left: 3px solid #ddd;
  padding: 4px 8px;
  margin-top: 6px;
  border-radius: 0 4px 4px 0;
}

/* ---- Responsivo ---- */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .grid    { grid-template-columns: 1fr; }
  .main    { padding: 20px 16px; }

  .pedido-infos-grid { grid-template-columns: 1fr 1fr; }
}
