/* Poste de barbearia. Usado no site e no painel.
   .loader + .pole  : poste grande, tela cheia (abertura)
   .pole-sm         : poste pequeno, inline, para esperas curtas (botões, listas) */

.loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-content: center; justify-items: center; gap: 22px;
  background: var(--paper, #100e0c);
  transition: opacity .45s ease, visibility .45s;
}
.loader.out { opacity: 0; visibility: hidden; }
.loader p {
  margin: 0;
  font-family: var(--serif);
  color: var(--ink-2, #cfc4b3);
  font-size: 15px;
  letter-spacing: .04em;
}

.pole { display: grid; justify-items: center; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .55)); }
.pole-cap {
  width: 46px; height: 16px;
  background: linear-gradient(90deg, #6b4d22, #e9c98f 35%, #fff2d6 48%, #c49a55 65%, #5a3f19);
}
.pole-cap-top { border-radius: 23px 23px 4px 4px; height: 20px; }
.pole-cap-bottom { border-radius: 4px 4px 23px 23px; }
.pole-ball {
  width: 20px; height: 20px; border-radius: 50%; margin-bottom: -3px;
  background: radial-gradient(circle at 35% 35%, #fff4dc, #d2a862 45%, #6b4d22 100%);
}
.pole-glass {
  position: relative;
  width: 36px; height: 120px;
  overflow: hidden;
  background: #f4f1ec;
}
.pole-stripes {
  position: absolute; left: 0; right: 0; top: -68px; bottom: 0;
  background: repeating-linear-gradient(
    -45deg,
    #b8261d 0 12px, #f7f4ef 12px 24px, #1f3f91 24px 36px, #f7f4ef 36px 48px
  );
  animation: pole-spin 1.1s linear infinite;
}
/* sombra e reflexo do vidro, dão volume de cilindro */
.pole-glass::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    rgba(0, 0, 0, .45) 0%, rgba(0, 0, 0, .05) 22%, rgba(255, 255, 255, .55) 38%,
    rgba(255, 255, 255, 0) 52%, rgba(0, 0, 0, .1) 75%, rgba(0, 0, 0, .5) 100%);
}
/* 48px por ciclo na diagonal = 48 × √2 ≈ 67.88px na vertical: o laço fica sem emenda */
@keyframes pole-spin { to { transform: translateY(67.88px); } }

/* ---------- poste pequeno ---------- */
/* Mesmas listras, em 1/3 do tamanho: ciclo de 16px = 22.63px na vertical.
   O anel escuro de 1px mantém o contorno no fundo claro; no escuro ele some. */
.pole-sm {
  position: relative; display: inline-block; flex: none;
  width: 11px; height: 24px; vertical-align: -6px;
  border-top: 3px solid #c49a55; border-bottom: 3px solid #c49a55;
  border-radius: 6px 6px 4px 4px;
  background: #f4f1ec;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(29, 26, 22, .4);
}
.pole-sm i {
  position: absolute; left: 0; right: 0; top: -23px; bottom: 0;
  background: repeating-linear-gradient(
    -45deg,
    #b8261d 0 4px, #f7f4ef 4px 8px, #1f3f91 8px 12px, #f7f4ef 12px 16px
  );
  animation: pole-spin-sm .8s linear infinite;
}
.pole-sm::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .4), rgba(255, 255, 255, .5) 38%, rgba(255, 255, 255, 0) 55%, rgba(0, 0, 0, .4));
}
@keyframes pole-spin-sm { to { transform: translateY(22.63px); } }

/* texto + poste lado a lado (listas e botões) */
.is-loading { display: flex; align-items: center; justify-content: center; gap: 12px; }
.btn .pole-sm { height: 20px; width: 9px; vertical-align: middle; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); }
.btn .pole-sm i { top: -23px; }
.btn[aria-busy="true"] { opacity: 1; cursor: progress; }

@media (prefers-reduced-motion: reduce) {
  .pole-stripes { animation-duration: 4s; }
  .pole-sm i { animation: none; }
  .loader { transition: none; }
}
