/* Sticky bar */
button#pma-bn-finish-btn { color: #fff!important;background: #7b6fe9!important;border-radius: 30px!important; }
button#pma-bn-trigger { color: #fff!important;background: #7b6fe9!important;border-radius: 30px!important; }
#pma-bn-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100009;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,0.98);
  box-shadow: 0 -15px 20px rgb(255 255 255)!important;
  backdrop-filter: saturate(180%) blur(8px);
  transform: translateY(110%);
  transition: transform .28s ease, opacity .2s ease;
  opacity: 0;
}
#pma-bn-sticky.visible {
  transform: translateY(0);
  opacity: 1;
}
#pma-bn-sticky.hidden { display: block; } /* Keep in DOM for animation but hidden via transform */
#pma-bn-sticky .pma-bn-sticky-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pma-bn-economy-label { display:block; font-size: 12px; color: #444; margin-bottom: 0!important; }
.pma-bn-economy-amount { font-weight: 700; font-size: 18px; color: #6a5df6; }

.pma-bn-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  background: #6a5df6;
  color: #fff;
  transition: background .2s ease, transform .06s ease;
  min-width: 180px;
}
.pma-bn-button:active { transform: translateY(1px); }
.pma-bn-button[disabled] { opacity: .5; cursor: not-allowed; }

/* Sheet */
/* IMPORTANT: pointer-events control prevents invisible backdrop from intercepting clicks */
.pma-bn-backdrop {
  position: fixed;
  inset: 0 0 var(--pma-bn-sticky-h, 80px) 0;
  background: rgba(0,0,0,.35);
  z-index: 10010;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none; /* <<< não intercepta cliques quando não visível */
}
.pma-bn-backdrop.visible { 
  opacity: 1;
  pointer-events: auto; /* <<< só recebe cliques quando visível */
}
.pma-bn-backdrop.hidden { display: none; }

.pma-bn-sheet {
  position: fixed;
  left: 0; right: 0; bottom: var(--pma-bn-sticky-h, 80px);
  z-index: 10040;
  background: #fff;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  max-height: 72vh;
  box-shadow: 0 -10px 30px rgba(0,0,0,.18);
  transform: translateY(102%);
  /* duração de entrada/saída: 3s */
  transition: transform 3s cubic-bezier(.2,.7,.2,1);
  display: flex;
  flex-direction: column;
}
.pma-bn-sheet.visible { transform: translateY(0); }
.pma-bn-sheet.closing { transform: translateY(102%); }
.pma-bn-sheet.hidden { display: none; }

.pma-bn-sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid #eee;
  font-weight: 600;
}
.pma-bn-close { border: 0; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; }

.pma-bn-sheet-body {
  overflow: auto; padding: 8px 12px 12px;
}
.pma-bn-attr {
  padding: 0!important; margin-bottom: 6px;
}
.pma-bn-attr-title {
  font-size: 12px; color: #555; margin: 0 0 4px 8px;
  text-transform: uppercase; letter-spacing: .02em;
}
.pma-bn-options {
  list-style: none; margin: 0; padding: 0; border-radius: 12px;
  border: none!important; overflow: hidden;
}
.pma-bn-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: none!important; cursor: pointer;
  background: #fff;
}
.pma-bn-option:last-child { border-bottom: 0; }
.pma-bn-option .label { font-size: 15px; color: #333; }
.pma-bn-option .radio {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid #cfd1f9;
  display: inline-block; position: relative; flex-shrink: 0;
}
.pma-bn-option.active .radio { border-color: #6a5df6; }
.pma-bn-option.active .radio:after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: #6a5df6;
}

/* Desktop: also show a non-sticky block if desired */
@media (min-width: 992px) {
  .pma-bn-summary-placeholder { display:block; }
}

/* When sheet is open, hide/push sticky below to avoid intercepting touches */

/* Extra buttons layout */
#pma-bn-sticky .pma-bn-sticky-inner { flex-wrap: wrap; }
#pma-bn-select-btn, #pma-bn-finish-btn, #pma-bn-more-btn { margin-left: 6px; }
.pma-bn-button.pma-bn-secondary { color: #fff!important;background: #7b6fe9!important;border-radius: 30px!important; }
.pma-bn-button.pma-bn-tertiary { background:#f2f3ff; color:#333; }
@media (max-width: 420px){
  .pma-bn-button { flex: 1 1 auto; min-width: auto; }
}

/* Drag handle for the bottom-sheet */
.pma-bn-sheet-header { position: relative; justify-content: center; gap: 8px; touch-action: none; }
.pma-bn-grabber { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 44px; height: 5px; border-radius: 999px; background: #d8dbe8; }
@media (prefers-reduced-motion: reduce){ .pma-bn-sheet { transition: none !important; } }
.pma-bn-sheet { will-change: transform; }
