/* ==========================================================================
   PROMO DETAILS PAGE - REFEITO
   ========================================================================== */

/* --- Paleta de Cores e Variáveis Globais --- */
:root {
  --pd-primary-dark: #1F2937;
  --pd-primary-accent: #4A90E2;
  --pd-text-secondary: #6B7280;
  --pd-background-page: #F9FAFB;
  --pd-surface-card: #FFFFFF;
  --pd-border-color: #E5E7EB;
  --pd-success-color: #16a34a;
  --pd-warning-color: #d97706;
  --pd-font-sans: 'Inter', sans-serif;
  --pd-font-display: 'Montserrat', sans-serif;
  --pd-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

html[data-theme="dark"] {
  --pd-primary-dark: #F1F5F9;
  --pd-primary-accent: #5BA3FF;
  --pd-text-secondary: #CBD5E1;
  --pd-background-page: #0F172A;
  --pd-surface-card: #1E293B;
  --pd-border-color: #334155;
  --pd-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
}

/* --- Estrutura da Página --- */
.pd-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* --- Breadcrumb (Navegação) --- */
.pd-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.pd-breadcrumb a {
  color: var(--pd-text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.pd-breadcrumb a:hover {
  color: var(--pd-primary-accent);
}

.pd-breadcrumb .separator {
  color: var(--pd-text-secondary);
  transition: color 0.3s ease;
}

.pd-breadcrumb .current {
  color: var(--pd-primary-dark);
  font-weight: 500;
  transition: color 0.3s ease;
}

/* --- Layout Principal (Grid) --- */
.pd-content {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2.5rem;
  align-items: start;
}

.pd-main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* --- Galeria de Imagens --- */
.pd-gallery {
  background: var(--pd-surface-card);
  border-radius: 16px;
  border: 1px solid var(--pd-border-color);
  padding: 1rem;
}

.pd-main-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
  background-color: var(--pd-background-page);
}

.pd-main-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pd-discount-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #ef4444;
  color: #fff;
  padding: 0.75rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 8px 16px rgba(239, 68, 68, 0.3);
}

.pd-discount-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}

.pd-discount-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 2px;
}

.pd-thumbnail-gallery {
  display: flex;
  gap: 0.75rem;
}

.pd-thumbnail {
  width: 90px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--pd-border-color);
  transition: border-color 0.2s ease;
}

.pd-thumbnail.active,
.pd-thumbnail:hover {
  border-color: var(--pd-primary-accent);
}

.pd-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Bloco de Informações da Promoção --- */
.pd-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pd-title {
  font-family: var(--pd-font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--pd-primary-dark);
  line-height: 1.2;
}

.pd-company-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--pd-background-page);
  border: 1px solid var(--pd-border-color);
  border-radius: 12px;
}

.pd-company-card-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background-color: var(--pd-surface-card);
}

.pd-company-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pd-company-info {
  display: flex;
  flex-direction: column;
}

.pd-company-label {
  font-size: 0.8rem;
  color: var(--pd-text-secondary);
}

.pd-company-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--pd-primary-dark);
  text-decoration: none;
}

.pd-company-name:hover {
  color: var(--pd-primary-accent);
}


/* --- Seções de Preço, Cupom, Validade --- */
.pd-price-section {
  border: 1px solid var(--pd-border-color);
  border-radius: 16px;
  padding: 1.5rem;
}

.pd-price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.pd-price-row:last-child {
  margin-bottom: 0;
}

.pd-price-label {
  color: var(--pd-text-secondary);
  font-size: 1rem;
}

.pd-original-price {
  color: var(--pd-text-secondary);
  text-decoration: line-through;
  font-size: 1.25rem;
}

.pd-promotional-price {
  color: var(--pd-primary-dark);
  font-size: 2.25rem;
  font-weight: 700;
}

.pd-savings {
  text-align: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pd-border-color);
  color: var(--pd-text-secondary);
}

.pd-savings strong {
  color: var(--pd-success-color);
  font-weight: 600;
}

.pd-coupon-section {
  border: 1px dashed var(--pd-warning-color);
  background: #fffbeb;
  border-radius: 12px;
  padding: 1.25rem;
}

.pd-coupon-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--pd-warning-color);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.pd-coupon-code {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fef3c7;
  padding: 0.75rem 1rem;
  border-radius: 8px;
}

.pd-coupon-code code {
  flex: 1;
  font-family: monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: #b45309;
}

.pd-copy-btn {
  background: var(--pd-warning-color);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.pd-copy-btn.copied {
  background: var(--pd-success-color);
}

/* --- Seção de Validade (VERSÃO CORRIGIDA E APRIMORADA) --- */
.pd-validity-section {
  display: flex;
  align-items: center;
  /* Alinha o ícone verticalmente com o bloco de texto */
  gap: 1rem;
  /* Aumenta o espaço entre o ícone e o texto */
  background: var(--pd-background-page);
  /* Fundo cinza claro para destaque */
  border: 1px solid var(--pd-border-color);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1.5rem;
  /* Adiciona um espaço acima, separando dos outros elementos */
}

.pd-validity-section svg {
  flex-shrink: 0;
  color: var(--pd-primary-accent);
  width: 24px;
  height: 24px;
}

/* Seleciona a <div> que agrupa o label e a data */
.pd-validity-section>div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  /* Pequeno espaço entre o label e a data */
}

.pd-validity-label {
  font-size: 0.8rem;
  color: var(--pd-text-secondary);
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.pd-validity-date {
  color: var(--pd-primary-dark);
  font-weight: 600;
  /* Deixa a data com mais destaque */
  font-size: 1rem;
}

/* --- Botão CTA Principal (VERSÃO APRIMORADA) --- */
.pd-cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(45deg, var(--pd-primary-accent) 0%, #3579C6 100%);
  color: #fff;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);

  /* APLICA AS DUAS ANIMAÇÕES AO MESMO TEMPO */
  animation:
    pulse-animation 1.5s infinite,
    breathing-animation 1.5s infinite ease-in-out;
}

.pd-cta-button:hover,
.pd-cta-button:focus {
  animation: none;
  /* PARA a animação contínua no hover */
  transform: translateY(-3px) scale(1.05);
  /* Aumenta um pouco mais no hover */
  box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
  outline: none;
}

.pd-content .pd-info .pd-cta-button {
  background-image: linear-gradient(45deg, var(--pd-primary-accent) 0%, #3579C6 100%);
  background-color: var(--pd-primary-accent);
  /* Cor sólida como fallback */
  color: #fff;
  /* Garante que o texto seja branco */
}

.pd-content .pd-info .pd-cta-button:hover {
  background-image: linear-gradient(45deg, #5a9ce6, #4589d6);
  background-color: #3579C6;
}

/* Animação de Pulso na Sombra */
@keyframes pulse-animation {
  0% {
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
  }

  50% {
    box-shadow: 0 4px 25px rgba(74, 144, 226, 0.5);
  }

  100% {
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
  }
}

/* --- ANIMAÇÃO DE RESPIRAÇÃO (NOVA) --- */
@keyframes breathing-animation {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
    /* Aumenta o tamanho em 2% no meio da animação */
  }

  100% {
    transform: scale(1);
  }
}

/* Estilo para o ícone dentro do botão */
.pd-cta-button svg {
  width: 22px;
  height: 22px;
}

/* --- Sidebar --- */
.pd-sidebar {
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pd-info-card {
  background: var(--pd-surface-card);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--pd-border-color);
}

.pd-info-card .card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--pd-primary-dark);
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pd-description-text,
.pd-rules-text {
  color: var(--pd-text-secondary);
  line-height: 1.7;
}

.pd-rules-card {
  background: #fffbeb;
  border-color: #fde68a;
}

.pd-rules-card .card-title {
  color: var(--pd-warning-color);
}

.pd-share-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pd-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease;
  color: #fff;
}

.pd-share-btn:hover {
  transform: translateY(-2px);
}

.pd-share-btn.whatsapp {
  background: #25D366;
}

.pd-share-btn.facebook {
  background: #1877F2;
}

.pd-share-btn.copy {
  background: var(--pd-text-secondary);
}

.pd-share-btn.copy.copied {
  background: var(--pd-success-color);
}


/* --- Responsividade --- */
@media (max-width: 1024px) {
  .pd-content {
    grid-template-columns: 1fr;
  }

  .pd-sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .pd-container {
    padding: 1.5rem 1rem;
  }
}
/* ─── Countdown na página de detalhe da promoção ──────────────────────────── */
.pd-countdown-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 6px 0;
  font-size: 0.85rem;
  color: var(--text-secondary, #6b7280);
}
.pd-countdown-row svg { flex-shrink: 0; }
.pd-countdown-label   { font-weight: 500; }

.countdown-timer {
  display: inline-flex;
  align-items: center;
  font-size: 1rem;
  font-weight: 800;
  color: #22c55e;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  transition: color 0.3s ease;
}
.countdown-timer.is-urgent   { color: #f59e0b; }
.countdown-timer.is-critical { color: #ef4444; animation: countdown-pulse 1s ease-in-out infinite; }
.countdown-timer.is-expired  { color: #9ca3af; font-weight: 500; }

@keyframes countdown-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}
