/* ==========================================================================
   Brinde Progressivo — Indicador flutuante de brinde
   ========================================================================== */

:root {
  --bp-size: 64px;
  --bp-bottom: 105px;
  --bp-track-color: #e0e0e0;
  --bp-progress-color: #7A4F01;
  --bp-complete-color: #7A4F01;
  --bp-shadow: 0 4px 20px rgba(0,0,0,0.15);
  --bp-shadow-complete: 0 0 24px 6px rgba(255, 215, 0, 0.55);
  --bp-stroke-width: 4px;
  --bp-transition: 0.6s ease-in-out;
  --bp-zindex: 99999;
}

.btn-whatsapp {
  z-index: 9998 !important;
}

/* Animação shimmer usada pelo strip do carrinho */
@keyframes bp-banner-shimmer {
  0%   { background-position: 100% 0; }
  50%  { background-position: 0% 0; }
  100% { background-position: 100% 0; }
}

#bp-widget {
  position: fixed;
  bottom: calc(var(--bp-bottom) + env(safe-area-inset-bottom, 0px));
  left: calc(10px + env(safe-area-inset-left, 0px));
  right: auto;
  width: var(--bp-size);
  height: var(--bp-size);
  z-index: var(--bp-zindex);
  cursor: grab;
  outline: none;
  border: none;
  background: transparent;
  padding: 0;
  touch-action: none;
}

#bp-widget:active {
  cursor: grabbing;
}

#bp-widget svg.bp-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

#bp-ring-track {
  fill: none;
  stroke: var(--bp-track-color);
  stroke-width: var(--bp-stroke-width);
}

#bp-ring-progress {
  fill: none;
  stroke: var(--bp-progress-color);
  stroke-width: var(--bp-stroke-width);
  stroke-linecap: round;
  transition: stroke-dashoffset var(--bp-transition), stroke var(--bp-transition);
  animation: bp-arc-glow 2s ease-in-out infinite;
}

@keyframes bp-arc-glow {
  0%, 100% { filter: drop-shadow(0 0 2px #c8860a) drop-shadow(0 0 4px #f5a800); }
  50%       { filter: drop-shadow(0 0 6px #c8860a) drop-shadow(0 0 14px #f5a800) drop-shadow(0 0 20px #ffe066); }
}

/* Bolinha central */
#bp-inner {
  position: absolute;
  inset: calc(var(--bp-stroke-width) * 1.5);
  border-radius: 50%;
  background: linear-gradient(135deg, #fff8e7 0%, #fde9a2 60%, #f5c842 100%);
  overflow: hidden;
  box-shadow: 0 0 18px 8px rgba(255, 210, 0, 0.55), 0 4px 20px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  transition: box-shadow var(--bp-transition), transform 0.2s ease;
  user-select: none;
  animation: bp-glow-pulse 2s ease-in-out infinite;
}

#bp-inner .bp-icon {
  display: block;
}

#bp-widget:hover #bp-inner {
  transform: scale(1.08);
}

@keyframes bp-glow-pulse {
  0%, 100% {
    box-shadow: 0 0 12px 5px rgba(255, 210, 0, 0.45), 0 4px 20px rgba(0,0,0,0.12);
  }
  50% {
    box-shadow: 0 0 28px 12px rgba(255, 210, 0, 0.75), 0 4px 20px rgba(0,0,0,0.12);
  }
}

/* Estado: brinde conquistado */
#bp-widget.bp-complete #bp-ring-progress {
  stroke: var(--bp-complete-color);
}

#bp-widget.bp-complete #bp-inner {
  box-shadow: var(--bp-shadow-complete);
}

#bp-widget.bp-complete .bp-icon {
  animation: bp-bounce 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes bp-bounce {
  0%, 100% { transform: translateY(0); }
  20%       { transform: translateY(-8px); }
  40%       { transform: translateY(-4px); }
  60%       { transform: translateY(-6px); }
  80%       { transform: translateY(-2px); }
}

/* Partículas */
.bp-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bp-complete-color);
  pointer-events: none;
  opacity: 0;
  animation: bp-particle-fly 1s ease-out forwards;
}

@keyframes bp-particle-fly {
  0%   { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--px), var(--py)) scale(0); }
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
#bp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  z-index: calc(var(--bp-zindex) + 1);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

#bp-overlay.bp-overlay-open  { display: flex; }
#bp-overlay.bp-overlay-visible { opacity: 1; }

#bp-modal {
  background: #f7f3ee;
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.22);
  max-width: 360px;
  width: 100%;
  overflow: hidden;
  transform: translateY(24px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
  opacity: 0;
  position: relative;
}

#bp-overlay.bp-overlay-visible #bp-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

#bp-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255,255,255,0.7);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 15px;
  cursor: pointer;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.2s;
}
#bp-modal-close:hover { background: #fff; color: #555; }

#bp-modal-img-wrap {
  padding: 28px 28px 0;
}

#bp-gift-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 18px;
  display: block;
  background: #eee;
  box-shadow:
    0 0 0 2px rgba(200, 169, 110, 0.4),
    0 0 16px 4px rgba(200, 169, 110, 0.3);
}

#bp-modal-body {
  padding: 20px 28px 0;
  text-align: center;
}

#bp-modal-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #C8A96E;
  margin: 0 0 6px;
  text-transform: uppercase;
}

#bp-modal-label-line {
  width: 32px;
  height: 1.5px;
  background: #C8A96E;
  margin: 0 auto 14px;
  border-radius: 2px;
}

#bp-gift-name {
  font-size: 1.9rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 16px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

#bp-modal-icon-wrap {
  width: 48px;
  height: 48px;
  background: #f0e8d8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

#bp-gift-desc {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.65;
  margin: 0 0 16px;
}

#bp-modal-status { margin-bottom: 4px; }

#bp-modal-progress-bar-wrap {
  background: #e8ddd0;
  border-radius: 999px;
  height: 7px;
  overflow: hidden;
  margin: 0 0 6px;
}

#bp-modal-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #C8A96E, #FFD700);
  border-radius: 999px;
  transition: width var(--bp-transition);
  width: 0%;
}

#bp-modal-remaining {
  font-size: 0.82rem;
  color: #999;
  text-align: center;
  margin: 0;
}

#bp-modal-congrats {
  display: none;
  margin: 16px 0 0;
  border-top: 1px solid #e8ddd0;
  padding: 14px 28px 20px;
}

#bp-modal-congrats-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#bp-congrats-text {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #C8A96E;
  text-transform: uppercase;
}

#bp-congrats-star {
  font-size: 0.8rem;
  color: #C8A96E;
}

/* Mobile */
@media (max-width: 480px) {
  :root {
    --bp-size: 56px;
    --bp-bottom: 105px;
  }

  #bp-modal {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    transform: translateY(40px) scale(1);
  }

  #bp-overlay {
    align-items: flex-end;
    padding: 0;
  }

  #bp-overlay.bp-overlay-visible #bp-modal {
    transform: translateY(0) scale(1);
  }
}

/* Esconde botoes +/- e input de quantidade do brinde no carrinho */
[data-store="cart-item-354005618"] .js-cart-quantity-btn {
  display: none !important;
}
[data-store="cart-item-354005618"] .js-cart-quantity-input {
  display: none !important;
}
[data-store="cart-item-354005618"] .js-cart-quantity-container {
  display: none !important;
}
[data-store="cart-item-354005618"] .form-quantity {
  pointer-events: none !important;
  visibility: hidden !important;
}
