/* =====================================================================
   DISCRA DISTRIBUIDORA — Folha de estilo principal
   Seções:
     1. Variáveis globais (:root)
     2. Reset / Base
     3. Layout e Iframe
     4. Botão flutuante do WhatsApp
     5. Acessibilidade e Responsividade
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Variáveis globais
   --------------------------------------------------------------------- */
:root {
  --bg: #0a0f0d;
  --fg: #e8f5e9;
  --accent: #25d366;
  --accent-dark: #128c42;
  --accent-glow: rgba(37, 211, 102, 0.4);
  --card: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.1);
}

/* ---------------------------------------------------------------------
   2. Reset / Base
   --------------------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* html e body ocupam 100% da altura e SEM scroll na página pai.
   O scroll da rolagem acontece dentro do iframe (próprio conteúdo dele). */
body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--fg);
}

/* ---------------------------------------------------------------------
   3. Layout e Iframe
   --------------------------------------------------------------------- */
/* Ajusta o iframe do Wix dentro do layout */
iframe {
  position: relative;
  top: -60px;
  width: 100%;
  height: calc(100% + 50px); /* Compensa o deslocamento */
  border: none;
}

/* ---------------------------------------------------------------------
   4. Botão flutuante do WhatsApp
   --------------------------------------------------------------------- */
/* Container fixo no canto inferior direito */
.whatsapp-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* Tooltip exibido ao passar o mouse */
.whatsapp-tooltip {
  background: var(--card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg);
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.whatsapp-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 24px;
  width: 12px;
  height: 12px;
  background: var(--card);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: rotate(45deg);
  backdrop-filter: blur(20px);
}

.whatsapp-container:hover .whatsapp-tooltip {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Anéis de pulso ao redor do botão */
.pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: pulse-animation 2s ease-out infinite;
}

.pulse-ring:nth-child(2) {
  animation-delay: 0.5s;
}

.pulse-ring:nth-child(3) {
  animation-delay: 1s;
}

@keyframes pulse-animation {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* Botão principal */
.whatsapp-btn {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent) 0%, var(--accent-dark) 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 20px rgba(37, 211, 102, 0.4),
    0 0 0 0 var(--accent-glow);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  overflow: hidden;
}

.whatsapp-btn::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
  pointer-events: none;
}

.whatsapp-btn:hover {
  transform: scale(1.1);
  box-shadow:
    0 8px 40px rgba(37, 211, 102, 0.5),
    0 0 0 8px var(--accent-glow);
}

.whatsapp-btn:active {
  transform: scale(0.95);
}

.whatsapp-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.whatsapp-btn svg {
  width: 32px;
  height: 32px;
  fill: white;
  transition: transform 0.3s ease;
}

.whatsapp-btn:hover svg {
  transform: rotate(-10deg) scale(1.1);
}

/* Brilho interno no hover */
.btn-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.whatsapp-btn:hover .btn-glow {
  opacity: 1;
}

/* ---------------------------------------------------------------------
   5. Acessibilidade e Responsividade
   --------------------------------------------------------------------- */
/* Reduz animações para usuários com preferência por menos movimento */
@media (prefers-reduced-motion: reduce) {
  .pulse-ring {
    animation: none;
  }
  .whatsapp-btn,
  .whatsapp-tooltip,
  .whatsapp-btn svg {
    transition: none;
  }
}

/* Ajustes para dispositivos móveis */
@media (max-width: 480px) {
  .whatsapp-container {
    bottom: 16px;
    right: 16px;
  }

  .whatsapp-btn {
    width: 56px;
    height: 56px;
  }

  .whatsapp-btn svg {
    width: 28px;
    height: 28px;
  }

  .whatsapp-tooltip {
    font-size: 0.85rem;
    padding: 10px 14px;
  }
}
