﻿/* =========================================================
   WHATSAPP SECTION — Real Phone UI
   ========================================================= */

/* Typing dots animation */
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Bubble entrance */
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Section */
.whatsapp {
  background: #f4faf5;
  padding: 80px 0 88px;
}

.whatsapp__container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 40px;
  box-sizing: border-box;
}

/* ---- 2-column layout ---- */
.whatsapp__content {
  display: grid;
  grid-template-columns: minmax(280px, 320px) 1fr;
  gap: 80px;
  align-items: center;
}

/* =========================================================
   PHONE FRAME
   ========================================================= */
.whatsapp__phone {
  position: relative;
  width: 280px;
  background: #111111;
  border-radius: 40px;
  padding: 14px 10px 18px;
  box-shadow:
    0 0 0 2px #2a2a2a,
    0 4px 6px rgba(0, 0, 0, 0.15),
    0 24px 64px rgba(0, 0, 0, 0.35),
    0 48px 96px rgba(0, 0, 0, 0.12);
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.32s ease;
  flex-shrink: 0;
  justify-self: center;
}

.whatsapp__phone:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 0 0 2px #2a2a2a,
    0 8px 12px rgba(0, 0, 0, 0.12),
    0 36px 80px rgba(0, 0, 0, 0.42),
    0 64px 120px rgba(0, 0, 0, 0.14);
}

/* Notch */
.whatsapp__phone-notch {
  width: 80px;
  height: 20px;
  background: #111111;
  border-radius: 0 0 14px 14px;
  margin: 0 auto 8px;
  position: relative;
  z-index: 10;
}

.whatsapp__phone-notch::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1d1d1d;
  top: 4px;
  right: 16px;
}

/* ---- Screen ---- */
.whatsapp__phone-screen {
  background: #e5ddd5;
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 460px;
}

/* ---- Chat Header ---- */
.whatsapp__chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #075e54 0%, #128c7e 100%);
  flex-shrink: 0;
}

.whatsapp__chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.whatsapp__chat-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.whatsapp__chat-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.whatsapp__chat-status {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1;
}

.whatsapp__chat-status::before {
  content: "";
}

/* ---- Chat Body ---- */
.whatsapp__chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -ms-overflow-style: none; /* IE/Edge */
  /* scrollbar-width: none; */ /* Firefox: handled by ::-webkit-scrollbar below */
}

.whatsapp__chat-body::-webkit-scrollbar {
  display: none;
}

/* ---- Bubbles ---- */
.whatsapp__bubble {
  display: inline-block;
  max-width: 80%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  line-height: 1.5;
  position: relative;
  animation: bubbleIn 0.35s ease both;
}

.whatsapp__bubble--in {
  background: #ffffff;
  color: #111111;
  align-self: flex-start;
  border-radius: 4px 12px 12px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  animation-delay: 0.1s;
}

.whatsapp__bubble--out {
  background: #dcf8c6;
  color: #111111;
  align-self: flex-end;
  border-radius: 12px 4px 12px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  animation-delay: 0.3s;
}

.whatsapp__bubble + .whatsapp__bubble--in { animation-delay: 0.5s; }
.whatsapp__bubble + .whatsapp__bubble--out { animation-delay: 0.7s; }

/* Bubble timestamp */
.whatsapp__bubble-time {
  display: block;
  font-size: 0.6rem;
  color: #888888;
  text-align: right;
  margin-top: 3px;
}

/* ---- Typing indicator ---- */
.whatsapp__typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #ffffff;
  border-radius: 4px 12px 12px 12px;
  align-self: flex-start;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  animation: bubbleIn 0.35s ease 0.9s both;
}

.whatsapp__typing span {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #90a4a0;
}

.whatsapp__typing span:nth-child(1) { animation: typingDot 1.2s 0s infinite ease; }
.whatsapp__typing span:nth-child(2) { animation: typingDot 1.2s 0.2s infinite ease; }
.whatsapp__typing span:nth-child(3) { animation: typingDot 1.2s 0.4s infinite ease; }

/* =========================================================
   TEXT + CTA (right column)
   ========================================================= */
.whatsapp__body {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.whatsapp__title {
  font-size: clamp(1.6rem, 2.8vw, 2.25rem);
  font-weight: 800;
  color: #111111;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0 0 16px;
}

.whatsapp__description {
  font-size: 0.975rem;
  color: #555555;
  line-height: 1.75;
  margin: 0;
  max-width: 420px;
}

/* ---- CTA Button (gradient + glow) ---- */
.whatsapp__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 50px;
  letter-spacing: 0.01em;
  box-shadow:
    0 4px 16px rgba(37, 211, 102, 0.38),
    0 8px 32px rgba(37, 211, 102, 0.2);
  transition:
    transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.24s ease;
  white-space: nowrap;
}

.whatsapp__btn:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow:
    0 8px 28px rgba(37, 211, 102, 0.52),
    0 16px 48px rgba(37, 211, 102, 0.24);
}

.whatsapp__btn:active {
  transform: scale(0.97);
}

.whatsapp__btn svg {
  flex-shrink: 0;
}

/* =========================================================
   FLOATING WHATSAPP BUTTON (all pages)
   ========================================================= */
.wa-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.5), 0 2px 8px rgba(0,0,0,.18);
  text-decoration: none;
  transition: transform .28s cubic-bezier(.34,1.56,.64,1), box-shadow .28s ease, background .22s ease;
}

.wa-float:hover {
  background: #1da851;
  transform: scale(1.14) translateY(-3px);
  box-shadow: 0 8px 32px rgba(37,211,102,.62), 0 4px 14px rgba(0,0,0,.18);
}

.wa-float:active { transform: scale(.96); }

.wa-float__icon {
  width: 30px;
  height: 30px;
  display: block;
  flex-shrink: 0;
}

.wa-float__tooltip {
  position: absolute;
  right: 66px;
  background: #111;
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(6px);
  transition: opacity .2s ease, transform .2s ease;
}

.wa-float__tooltip::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: #111;
}

.wa-float:hover .wa-float__tooltip {
  opacity: 1;
  transform: translateX(0);
}

.wa-float::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #25d366;
  opacity: .35;
  animation: wa-pulse 2.2s ease-out infinite;
}

@keyframes wa-pulse {
  0%   { transform: scale(1);   opacity: .35; }
  70%  { transform: scale(1.7); opacity: 0; }
  100% { transform: scale(1.7); opacity: 0; }
}

@media (max-width: 480px) {
  .wa-float { bottom: 18px; right: 18px; width: 52px; height: 52px; }
  .wa-float__icon { width: 26px; height: 26px; }
  .wa-float__tooltip { display: none; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 880px) {
  .whatsapp {
    padding: 60px 0 68px;
  }

  .whatsapp__container {
    padding: 0 24px;
  }

  .whatsapp__content {
    grid-template-columns: 1fr;
    gap: 48px;
    justify-items: center;
    text-align: center;
  }

  .whatsapp__phone {
    width: 260px;
  }

  .whatsapp__phone-screen {
    height: 420px;
  }

  .whatsapp__description {
    margin: 0 auto;
  }

  .whatsapp__action {
    display: flex;
    justify-content: center;
  }
}

@media (max-width: 400px) {
  .whatsapp__phone {
    width: 240px;
  }
}
