/* WhatsApp contextual CTA — mobile bar + tablet/desktop card */
:root {
  --ph-wa-bar-h: 56px;
  --ph-wa-card-w: 340px;
}

.ph-wa-bar {
  position: fixed;
  z-index: 34;
  display: flex;
  align-items: stretch;
  font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.ph-wa-bar.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ===== Mobile: bottom bar ===== */
@media (max-width: 768px) {
  body.ph-wa-bar-visible {
    padding-bottom: calc(var(--ph-wa-bar-h) + env(safe-area-inset-bottom, 0px));
  }

  .ph-wa-bar {
    left: 0;
    right: 0;
    bottom: 0;
    min-height: var(--ph-wa-bar-h);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #3f5450;
    box-shadow: 0 -4px 24px rgba(47, 65, 62, 0.28);
    transform: translateY(110%);
  }

  .ph-wa-bar.is-visible {
    transform: translateY(0);
  }

  .ph-wa-bar__label {
    display: none;
  }
}

/* ===== Tablet + Desktop: floating card ===== */
@media (min-width: 769px) {
  .ph-wa-bar {
    left: auto;
    right: 24px;
    bottom: 24px;
    width: min(var(--ph-wa-card-w), calc(100vw - 48px));
    background: #3f5450;
    border-radius: 16px;
    box-shadow:
      0 12px 40px rgba(47, 65, 62, 0.28),
      0 2px 8px rgba(47, 65, 62, 0.12);
    transform: translateY(18px);
    overflow: hidden;
    position: fixed;
  }

  .ph-wa-bar.is-visible {
    transform: translateY(0);
  }

  .ph-wa-bar__link {
    min-height: auto;
    padding: 16px 44px 16px 16px;
    align-items: flex-start;
  }

  .ph-wa-bar__copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }

  .ph-wa-bar__text {
    font-size: 15px;
    line-height: 1.4;
    white-space: normal;
  }

  .ph-wa-bar__label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
    letter-spacing: 0.02em;
  }

  .ph-wa-bar__close {
    position: absolute;
    top: 8px;
    right: 4px;
    width: 36px;
    min-height: 36px;
  }

  .ph-wa-bar__link:hover {
    background: rgba(255, 255, 255, 0.05);
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .ph-wa-bar {
    right: 20px;
    bottom: 20px;
    width: min(320px, calc(100vw - 40px));
  }
}

/* ===== Shared parts ===== */
.ph-wa-bar__link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--ph-wa-bar-h);
  padding: 0 12px 0 16px;
  color: #fff;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.ph-wa-bar__link:active {
  background: rgba(255, 255, 255, 0.06);
}

.ph-wa-bar__copy {
  flex: 1;
  min-width: 0;
}

.ph-wa-bar__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: #25d366;
  background: #fff;
  border-radius: 50%;
  padding: 4px;
  box-sizing: content-box;
}

@media (min-width: 769px) {
  .ph-wa-bar__icon {
    margin-top: 2px;
  }
}

.ph-wa-bar__text {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.ph-wa-bar__label {
  display: none;
}

.ph-wa-bar__close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: var(--ph-wa-bar-h);
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ph-wa-bar__close:hover,
.ph-wa-bar__close:focus-visible {
  color: #fff;
  outline: none;
}

.ph-wa-bar__close svg {
  display: block;
  width: 18px;
  height: 18px;
}
