/* ==============================================================================
   Henny 3D • Card de Validade da Oferta & Contagem Regressiva em Tempo Real
   Design: Laranja de Alta Conversão, Bordas Arredondadas Superiores & Shimmer
   ============================================================================== */

.product-offer-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.42rem 0.95rem;
  background: linear-gradient(135deg, #ff4500 0%, #ff6a00 50%, #ea580c 100%);
  border-top-left-radius: 1.5rem;
  border-top-right-radius: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 14px -2px rgba(234, 88, 12, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #ffffff;
  transition: opacity 0.4s ease, transform 0.4s ease, max-height 0.4s ease;
  z-index: 5;
}

/* Encaixe perfeito no topo do card de compra em plugins */
.plugin-detail-panel > .product-offer-banner {
  margin: -1.15rem -1.25rem 1.25rem -1.25rem;
  width: calc(100% + 2.5rem);
}

/* Encaixe perfeito no card de recursos */
[data-product-purchase] .bg-white > .product-offer-banner {
  margin: -1.5rem -1.5rem 1.5rem -1.5rem;
  width: calc(100% + 3rem);
}

@media (min-width: 640px) {
  [data-product-purchase] .bg-white > .product-offer-banner {
    margin: -2rem -2rem 1.75rem -2rem;
    width: calc(100% + 4rem);
  }
}

/* Encaixe no card de preços de páginas estáticas */
.product-static-purchase .product-offer-banner,
#precos .product-offer-banner {
  border-radius: 1rem 1rem 0 0;
  margin-bottom: 0.75rem;
}

/* Shimmer Reflexivo animado passando suavemente */
.product-offer-banner::after {
  content: '';
  position: absolute;
  top: -60%;
  left: -70%;
  width: 50%;
  height: 220%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.28) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(25deg);
  animation: offerShimmer 5.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
}

@keyframes offerShimmer {
  0% { transform: translateX(-150%) rotate(25deg); }
  25%, 100% { transform: translateX(450%) rotate(25deg); }
}

/* Lado Esquerdo: Título & Ícone */
.product-offer-copy {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.product-offer-fire {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
  transform-origin: center bottom;
}

.product-offer-flame-svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  animation: flameLive 2.2s ease-in-out infinite;
  transform-origin: 50% 90%;
}

@keyframes flameLive {
  0%, 100% {
    transform: scale(1, 1) rotate(0deg);
    filter: drop-shadow(0 0 3px rgba(255, 170, 0, 0.45));
  }
  25% {
    transform: scale(0.95, 1.08) rotate(-4deg);
    filter: drop-shadow(0 0 6px rgba(255, 100, 0, 0.7));
  }
  50% {
    transform: scale(1.05, 0.96) rotate(3deg);
    filter: drop-shadow(0 0 4px rgba(255, 200, 0, 0.55));
  }
  75% {
    transform: scale(0.97, 1.04) rotate(-2deg);
    filter: drop-shadow(0 0 7px rgba(255, 80, 0, 0.75));
  }
}

.product-offer-title {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 800;
  font-size: 0.8rem;
  line-height: 1.25;
  color: #ffffff;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 640px) {
  .product-offer-title {
    font-size: 0.84rem;
  }
}

/* Lado Direito: Cronômetro Digital */
.product-offer-timer {
  display: inline-flex;
  align-items: center;
  gap: 0.16rem;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.product-offer-unit {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 1.72rem;
  padding: 0.15rem 0.22rem;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0.35rem;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 2px 4px rgba(0, 0, 0, 0.18);
}

.product-offer-val {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 800;
  font-size: 0.82rem;
  line-height: 1;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.product-offer-lbl {
  font-size: 0.46rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.78);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.08rem;
  line-height: 1;
}

.product-offer-sep {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 800;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1;
  margin: 0 -0.04rem;
  animation: sepBlink 1s step-start infinite;
}

@keyframes sepBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Transição de encerramento suave */
.product-offer-banner.is-expired {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

/* Urgência Máxima (< 6 horas restantes) */
.product-offer-banner.is-urgent {
  animation: urgentPulse 2s infinite ease-in-out;
}

@keyframes urgentPulse {
  0%, 100% { box-shadow: 0 4px 14px -2px rgba(234, 88, 12, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
  50% { box-shadow: 0 4px 22px 4px rgba(255, 69, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
}

/* Responsividade e Otimização Visual Mobile Ultra Compacta */
@media (max-width: 640px) {
  .product-offer-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
  }

  .plugin-detail-panel > .product-offer-banner {
    margin: -1.15rem -1.25rem 0.85rem -1.25rem;
  }

  .product-offer-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
    flex: 1 1 auto;
  }

  .product-offer-flame-svg {
    width: 1.05rem;
    height: 1.05rem;
  }

  .product-offer-title {
    font-size: 0.75rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .product-offer-timer {
    display: inline-flex;
    align-items: center;
    gap: 0.12rem;
    flex-shrink: 0;
  }

  .product-offer-unit {
    min-width: 1.62rem;
    padding: 0.14rem 0.18rem;
    border-radius: 0.28rem;
  }

  .product-offer-val {
    font-size: 0.78rem;
    line-height: 1;
  }

  .product-offer-lbl {
    font-size: 0.44rem;
    letter-spacing: 0.03em;
    margin-top: 0.05rem;
    line-height: 1;
  }

  .product-offer-sep {
    font-size: 0.72rem;
    margin: 0;
  }
}

/* Fallback para telas ultra estreitas (< 325px) */
@media (max-width: 325px) {
  .product-offer-banner {
    padding: 0.3rem 0.45rem;
  }
  .product-offer-title {
    font-size: 0.68rem;
  }
  .product-offer-unit {
    min-width: 1.45rem;
    padding: 0.12rem 0.12rem;
  }
  .product-offer-val {
    font-size: 0.72rem;
  }
}
