:root {
  --brand-primary: #1a3c6e;
  --brand-accent: #ff6a13;
}

body { background-color: #f4f6f9; }

/* ---------- Pie de página siempre al final (sticky footer) ---------- */
html, body { height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; }
body > .container.py-4 { flex: 1 0 auto; }
.footer-tienda { flex-shrink: 0; }

/* ---------- Panel de administración ---------- */
#wrapper { min-height: 100vh; }

.sidebar {
  width: 260px;
  min-width: 260px;
  transition: margin-left .25s ease;
}
.sidebar-brand { font-size: 1.1rem; }

.sidebar-link, .accordion-button.sidebar-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #cfd8e3;
  text-decoration: none;
  padding: .65rem 1rem;
  font-size: .92rem;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
}
.accordion-button.sidebar-link::after { filter: invert(1); margin-left: auto; }
.sidebar-link:hover, .accordion-button.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-link.active { background: var(--brand-accent); color: #fff; }

.sidebar-sublink {
  display: block;
  padding: .5rem 1rem .5rem 2.7rem;
  color: #b8c2d1;
  text-decoration: none;
  font-size: .88rem;
}
.sidebar-sublink:hover { background: rgba(255,255,255,.06); color: #fff; }

@media (max-width: 991.98px) {
  .sidebar { position: fixed; z-index: 1030; height: 100%; margin-left: -260px; }
  .sidebar.show { margin-left: 0; }
}

.card { border: none; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stat-card { border-radius: .75rem; }

/* ---------- Tienda pública ---------- */
.navbar-tienda { background: var(--brand-primary); }
.producto-card img { height: 180px; object-fit: contain; background: #fff; }
.badge-iva { font-size: .7rem; }
.footer-tienda { background: #12233f; color: #cfd8e3; }

/* ---------- Contenido de páginas CMS (tienda/pagina.php) ---------- */
.pagina-contenido h2 { margin-top: 1.5rem; color: var(--brand-primary); }
.pagina-contenido h2:first-child { margin-top: 0; }
.pagina-contenido p { line-height: 1.7; }
.pagina-contenido img { max-width: 100%; height: auto; border-radius: .5rem; }
.pagina-contenido ul, .pagina-contenido ol { line-height: 1.8; }

/* ---------- Editor visual de bloques (admin/paginas/form.php) ---------- */
.campo-editor-visual .ql-editor { min-height: 140px; font-size: .95rem; }
.campo-editor-visual .ql-container { border-bottom-left-radius: .375rem; border-bottom-right-radius: .375rem; }
.campo-editor-visual .ql-toolbar { border-top-left-radius: .375rem; border-top-right-radius: .375rem; }

/* ---------- Editor visual de plantillas PDF ---------- */
#editorLienzo {
  position: relative;
  background: #fff;
  box-shadow: 0 0 8px rgba(0,0,0,.2);
  margin: 0 auto;
  overflow: hidden;
}
.pdf-elemento {
  position: absolute;
  cursor: move;
  padding: 2px 4px;
  border: 1px dashed transparent;
  white-space: nowrap;
  user-select: none;
}
.pdf-elemento:hover, .pdf-elemento.selected { border-color: var(--brand-accent); background: rgba(255,106,19,.08); }
.pdf-elemento.tipo-tabla { white-space: normal; border: 1px dashed #1a3c6e; background: rgba(26,60,110,.06); }
