/* Aroma Real Estate UI Components — Strictly 0px Radius, Architectural Discipline */

/* Published area carousel on the homepage */
.area-carousel { --area-carousel-gap: var(--gutter-desktop); }
.area-carousel-viewport { overflow: hidden; }
.area-carousel-track {
  display: flex; align-items: stretch; gap: var(--area-carousel-gap);
  transition: transform 560ms cubic-bezier(.22, .68, 0, 1); will-change: transform;
}
.area-carousel-card {
  flex: 0 0 calc((100% - (2 * var(--area-carousel-gap))) / 3); min-width: 0; overflow: hidden;
  display: flex; flex-direction: column; background: var(--color-surface-container-lowest); border: var(--border-hairline);
}
.area-carousel-image { height: 220px; overflow: hidden; background: var(--color-surface-stone); }
.area-carousel-image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 650ms cubic-bezier(.2,.65,.3,1); }
.area-carousel-card:hover .area-carousel-image img { transform: scale(1.035); }
.area-carousel-image-placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: var(--color-secondary); }
.area-carousel-card-content { flex: 1 0 auto; display: flex; flex-direction: column; align-items: flex-start; padding: var(--space-xl) var(--space-lg) var(--space-lg); }
.area-carousel-category { color: var(--color-secondary); margin: 4px 0 8px; }
.area-carousel-title { margin: 0 0 var(--space-xs); font-size: var(--text-2xl); font-weight: 700; }
.area-carousel-description { flex: 1 0 auto; color: var(--color-on-surface-variant); margin: 0 0 var(--space-md); }
.area-carousel-action { margin-top: auto; }
.area-carousel-action .material-symbols-outlined { font-size: var(--text-base); }
.area-carousel-controls { display: flex; justify-content: space-between; align-items: center; gap: var(--space-md); margin-top: var(--space-lg); }
.area-carousel-arrows { display: flex; gap: 8px; }
.area-carousel-arrow {
  display: grid; width: 44px; height: 44px; place-items: center; padding: 0; color: var(--color-on-surface);
  background: var(--color-surface-container-lowest); border: var(--border-hairline); border-radius: 50%; cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.area-carousel-arrow:hover { color: #fff; background: var(--color-primary); border-color: var(--color-primary); transform: translateY(-1px); }
.area-carousel-arrow:focus-visible, .area-carousel-dot:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 3px; }
.area-carousel-arrow:disabled { opacity: .45; cursor: default; transform: none; }
.area-carousel-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.area-carousel-pagination { display: flex; align-items: center; gap: 8px; }
.area-carousel-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: var(--color-outline-variant, #b6b1a9); cursor: pointer; transition: width 220ms ease, background-color 220ms ease; }
.area-carousel-dot[aria-current="true"] { width: 26px; border-radius: 8px; background: var(--color-primary); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
@media (max-width: 1024px) {
  .area-carousel { --area-carousel-gap: var(--gutter-tablet); }
  .area-carousel-card { flex-basis: calc((100% - var(--area-carousel-gap)) / 2); }
}
@media (max-width: 640px) {
  .area-carousel { --area-carousel-gap: var(--gutter-mobile); }
  .area-carousel-card { flex-basis: 100%; }
  .area-carousel-image { height: 210px; }
  .area-carousel-card-content { padding: var(--space-lg); }
}
@media (prefers-reduced-motion: reduce) {
  .area-carousel-track, .area-carousel-image img, .area-carousel-arrow, .area-carousel-dot { transition: none !important; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-surface);
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
  color: #ffffff;
}

.btn-secondary, .btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-outline-variant);
}

.btn-secondary:hover, .btn-outline:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

.btn-white {
  background-color: #ffffff;
  color: var(--color-primary);
  border-color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.btn-white:hover {
  background-color: var(--color-surface-container);
  border-color: var(--color-surface-container);
  transform: translateY(-1px);
}

.btn-outline-inverted {
  background-color: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-outline-inverted:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: #ffffff;
  color: #ffffff;
}

.btn-stone {
  background-color: var(--color-surface-container);
  color: var(--color-on-surface);
  border-color: var(--color-outline-variant);
}

.btn-stone:hover {
  background-color: var(--color-surface-container-high);
}

.btn-sm {
  padding: 8px 16px;
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
}

.btn-lg {
  padding: 14px 28px;
  min-height: 52px;
  height: 52px;
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
}

/* Editorial Link with Arrow */
.editorial-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: var(--color-tertiary);
  text-underline-offset: 4px;
  transition: color 0.2s ease, gap 0.2s ease;
}

.editorial-link:hover {
  color: var(--color-secondary);
  gap: 0.625rem;
}

.editorial-link-light {
  color: var(--color-surface);
  text-decoration-color: var(--color-tertiary-fixed);
}

.editorial-link-light:hover {
  color: #ffffff;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  line-height: 1;
}

.badge-stone {
  background-color: var(--color-surface-stone);
  color: var(--color-on-surface);
  border: var(--border-hairline);
}

.badge-dark {
  background-color: var(--color-primary);
  color: #ffffff;
}

.badge-green {
  background-color: var(--color-secondary-container);
  color: var(--color-secondary);
}

.badge-brass {
  background-color: var(--color-surface-container-high);
  color: var(--color-tertiary);
  border: 1px solid var(--color-outline-variant);
}

.badge-sold {
  background-color: var(--color-error-container);
  color: var(--color-error);
}

/* Property Card — Clean, Flat & Stable with Soft Radius, No 3D Tilt */
.property-card {
  background-color: var(--color-surface-container-lowest);
  border: var(--border-hairline);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.property-card:hover {
  border-color: var(--color-outline);
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.08);
}

.property-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: var(--color-surface-container);
}

.property-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.property-card:hover .property-card-img {
  transform: scale(1.03);
}

.property-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

.property-card-badge .badge {
  background-color: rgba(18, 21, 19, 0.9);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 5px 10px;
}

.property-card-save-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.16);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  cursor: pointer;
  z-index: 5;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.property-card-save-btn:hover {
  background-color: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px) scale(1.06);
}

.property-card-save-btn.saved {
  background-color: var(--color-secondary);
  color: #ffffff;
  border-color: var(--color-secondary);
}

.property-card-content {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}

.property-card-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: var(--text-xs);
  color: var(--color-secondary);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.property-card-title {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-on-surface);
  margin-bottom: var(--space-xs);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.property-card-specs {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--color-on-surface-variant);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--color-surface-container);
}

.property-spec-divider {
  color: var(--color-outline-variant);
}

.property-card-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
  padding-top: var(--space-xs);
}

.property-card-price {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-on-surface);
  line-height: 1.2;
}

/* Search Filters Box */
.filter-bar-container {
  background-color: var(--color-surface-stone);
  border-top: var(--border-hairline);
  border-bottom: var(--border-hairline);
  padding: var(--space-xl) 0;
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, .9fr) minmax(190px, .85fr);
  gap: var(--space-md);
  align-items: flex-end;
  background-color: var(--color-surface-container-lowest);
  border: var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  padding: var(--space-lg);
}

.home-filter-submit { display: flex; align-items: flex-end; }
.home-filter-submit .btn { width: 100%; justify-content: center; }

@media (max-width: 960px) {
  .filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .filter-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
    padding: var(--space-md);
  }
}

/* Pagination Component */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-xl) 0;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: var(--border-hairline);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface-container-lowest);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-on-surface);
  transition: all 0.2s ease;
}

.pagination-link:hover {
  background-color: var(--color-surface-container);
}

.pagination-link.active {
  background-color: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

/* Callout / CTA Box */
.cta-band {
  background-color: var(--color-surface-stone);
  border-top: var(--border-hairline);
  border-bottom: var(--border-hairline);
  padding: var(--space-2xl) 0;
}

.cta-band-dark {
  background-color: var(--color-primary-container);
  color: #ffffff;
  border-top: none;
  border-bottom: none;
  padding: var(--space-2xl) 0;
}

/* Empty State */
.empty-state-box {
  padding: var(--space-2xl) var(--space-md);
  text-align: center;
  background-color: var(--color-surface-container-lowest);
  border: var(--border-hairline);
  border-radius: var(--radius-lg);
  max-width: 600px;
  margin: var(--space-xl) auto;
}

.empty-state-icon {
  font-size: var(--text-4xl);
  color: var(--color-outline);
  margin-bottom: var(--space-sm);
}

/* Flash Messages */
.flash-message {
  padding: 14px 20px;
  margin-bottom: var(--space-md);
  font-size: var(--text-sm);
  border-left: 4px solid;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flash-success {
  background-color: var(--color-secondary-container);
  border-color: var(--color-secondary);
  color: var(--color-secondary);
}

.flash-error {
  background-color: var(--color-error-container);
  border-color: var(--color-error);
  color: var(--color-error);
}

.flash-info {
  background-color: var(--color-surface-container-low);
  border-color: var(--color-primary);
  color: var(--color-on-surface);
}

/* ==========================================================================
   CINEMATIC FULL-BLEED HERO BACKGROUND & 3D PARALLAX
   ========================================================================== */

.hero-cinematic-stage {
  position: relative;
  width: 100%;
  min-height: 680px;
  height: 85vh;
  max-height: 880px;
  background-color: var(--color-primary-container);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

/* Backside Multi-Slide Background Container */
.hero-backside-slider {
  position: absolute;
  inset: -20px;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  perspective: 1000px;
}

.hero-bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 8s ease-out;
}

.hero-bg-slide > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-bg-slide.active {
  opacity: 0.65;
  transform: scale(1.02);
  will-change: opacity, transform;
}

/* Scrim Gradient Overlays for Absolute Readability */
.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 22, 21, 0.95) 0%, rgba(20, 22, 21, 0.45) 55%, rgba(20, 22, 21, 0.25) 100%);
  pointer-events: none;
  z-index: 2;
}

.hero-content-wrap {
  position: relative;
  z-index: 10;
  padding-bottom: var(--space-2xl);
  width: 100%;
}

.hero-copy-box {
  max-width: 780px;
}

/* Tagline & Coordinates */
.hero-tagline-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.hero-tagline-caps {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-tertiary-fixed);
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  animation: heroTaglineIn 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

.hero-coord-badge {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid rgba(226, 194, 138, 0.35);
  background: rgba(39, 25, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--color-tertiary-fixed-dim);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  animation: heroTaglineIn 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

/* Masked Split-Line Headline */
.hero-animated-headline {
  margin-bottom: var(--space-md);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.hero-anim-mask {
  display: block;
  overflow: hidden;
}

.hero-anim-line {
  display: block;
  opacity: 0;
  transform: translate3d(0, 105%, 0);
  animation: heroLineReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
}

.hero-anim-line.line-1 {
  animation-delay: 0.15s;
}

.hero-anim-line.line-2 {
  animation-delay: 0.32s;
}

/* Architectural Hairline Divider Rule */
.hero-hairline-rule {
  width: 100%;
  max-width: 440px;
  height: 1px;
  background: linear-gradient(90deg, rgba(226, 194, 138, 0.85) 0%, rgba(226, 194, 138, 0.3) 70%, transparent 100%);
  margin-bottom: var(--space-md);
  transform-origin: left;
  transform: scaleX(0);
  animation: hairlineExpand 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.48s forwards;
}

/* Narrative Subtitle */
.hero-anim-subtitle {
  margin-bottom: var(--space-lg);
  max-width: 620px;
  line-height: 1.6;
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  animation: heroFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards;
}

/* Staggered CTA Actions */
.hero-anim-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: var(--space-lg);
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  animation: heroFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.85s forwards;
}

.hero-cta-btn {
  transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.hero-cta-btn:hover {
  transform: translateY(-2px);
}

/* Scene Selector Bar & Label */
.hero-scene-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: var(--space-md);
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  animation: heroFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.98s forwards;
}

.hero-scene-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-scene-pill {
  width: 32px;
  height: 4px;
  padding: 0;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.3);
  border: none;
  cursor: pointer;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.hero-scene-pill:hover {
  background: rgba(255, 255, 255, 0.7);
}

.hero-scene-pill.active {
  width: 48px;
  background: var(--color-tertiary-fixed);
}

.hero-scene-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  transition: opacity 0.3s ease;
}

/* Keyframe Animations */
@keyframes heroTaglineIn {
  0% {
    opacity: 0;
    letter-spacing: 0.04em;
    transform: translate3d(0, 10px, 0);
  }
  100% {
    opacity: 1;
    letter-spacing: 0.08em;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes heroLineReveal {
  0% {
    opacity: 0;
    transform: translate3d(0, 105%, 0);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes hairlineExpand {
  0% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(1);
  }
}

@keyframes heroFadeUp {
  0% {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Reduced Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
  .hero-tagline-caps,
  .hero-coord-badge,
  .hero-anim-line,
  .hero-hairline-rule,
  .hero-anim-subtitle,
  .hero-anim-actions,
  .hero-scene-bar {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Hero Section Mobile Responsiveness */
@media (max-width: 768px) {
  .hero-cinematic-stage {
    min-height: 520px;
    height: auto;
  }

  .hero-content-wrap {
    padding-bottom: var(--space-xl);
  }

  .hero-animated-headline {
    font-size: clamp(2rem, 7.5vw, 2.75rem);
  }

  .hero-anim-subtitle {
    font-size: var(--text-base);
  }
}

@media (max-width: 480px) {
  .hero-cinematic-stage {
    min-height: 460px;
  }

  .hero-anim-actions {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
  }

  .hero-anim-actions .hero-cta-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   FLOATING WHATSAPP CONTACT WIDGET (ROUNDED BUBBLY ICON & SPRING ANIMATION)
   ========================================================================== */

/* Keyframe Animations */
@keyframes wa-bubble-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes wa-bubble-aura {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.65);
  }
  70% {
    transform: scale(1.12);
    box-shadow: 0 0 0 14px rgba(37, 211, 102, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

@keyframes wa-shockwave-burst {
  0% {
    transform: scale(0.75);
    opacity: 1;
    border-color: #3bfb84;
  }
  50% {
    opacity: 0.75;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
    border-color: #25d366;
  }
}

@keyframes wa-bubble-pop-bounce {
  0% {
    transform: scale(1);
  }
  20% {
    transform: scale(0.76, 1.25) rotate(-6deg);
  }
  45% {
    transform: scale(1.22, 0.82) rotate(5deg);
  }
  70% {
    transform: scale(0.92, 1.08) rotate(-2deg);
  }
  85% {
    transform: scale(1.05, 0.97) rotate(1deg);
  }
  100% {
    transform: scale(1, 1) rotate(0deg);
  }
}

@keyframes wa-status-blink {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.85);
  }
}

@keyframes wa-window-spring-in {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.72);
  }
  65% {
    opacity: 1;
    transform: translateY(-6px) scale(1.02);
  }
  85% {
    transform: translateY(2px) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Backdrop for Mobile Focus & Outside Dismiss */
.whatsapp-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(12, 24, 17, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.whatsapp-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Floating Root Container */
.whatsapp-widget-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--font-body);
  gap: 12px;
}

.phone-launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  padding: 0;
  border: 2px solid rgba(255,255,255,.45);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d8bf91 0%, #b49360 54%, #775a32 100%);
  color: #fff;
  box-shadow: 0 10px 26px rgba(112,82,40,.38), 0 4px 10px rgba(0,0,0,.2), inset 0 2px 4px rgba(255,255,255,.5), inset 0 -3px 5px rgba(0,0,0,.16);
  text-decoration: none;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s ease;
  animation: phone-bubble-float 3.5s ease-in-out infinite;
}
.phone-launcher:hover {
  transform: translateY(-6px) scale(1.08);
  box-shadow: 0 16px 34px rgba(112,82,40,.48), 0 6px 14px rgba(0,0,0,.24), inset 0 2px 4px rgba(255,255,255,.62);
}
.phone-launcher:focus-visible {
  outline: 3px solid #a88756;
  outline-offset: 4px;
}
.phone-launcher svg {
  position: relative;
  z-index: 1;
  width: 25px;
  height: 25px;
  fill: currentColor;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.2));
}
.phone-pulse-aura {
  position: absolute;
  inset: -5px;
  border: 2px solid rgba(177,145,93,.68);
  border-radius: 50%;
  pointer-events: none;
  animation: phone-bubble-aura 2.4s cubic-bezier(.2,.8,.4,1) infinite;
}
@keyframes phone-bubble-float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes phone-bubble-aura {
  0% { transform: scale(.95); box-shadow: 0 0 0 0 rgba(177,145,93,.5); }
  70% { transform: scale(1.12); box-shadow: 0 0 0 14px rgba(177,145,93,0); }
  100% { transform: scale(.95); box-shadow: 0 0 0 0 rgba(177,145,93,0); }
}
@media (prefers-reduced-motion: reduce) {
  .phone-launcher, .phone-pulse-aura { animation: none; }
}

/* Floating Action Launcher — Rounded Bubbly Icon */
.whatsapp-launcher {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  border-radius: 50% !important;
  background: radial-gradient(circle at 35% 30%, #3bfb84 0%, #25d366 52%, #0e8745 100%);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 10px 26px rgba(37, 211, 102, 0.45), 0 4px 10px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(255, 255, 255, 0.55), inset 0 -3px 5px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  user-select: none;
  outline: none;
  padding: 0;
  animation: wa-bubble-float 3.5s ease-in-out infinite;
}

.whatsapp-launcher:hover {
  transform: translateY(-6px) scale(1.08);
  box-shadow: 0 16px 36px rgba(37, 211, 102, 0.55), 0 6px 14px rgba(0, 0, 0, 0.25), inset 0 2px 4px rgba(255, 255, 255, 0.65);
}

.whatsapp-launcher:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.5), 0 12px 30px rgba(0, 0, 0, 0.3);
}

/* Click Animation State */
.whatsapp-launcher.anim-pop {
  animation: wa-bubble-pop-bounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.whatsapp-launcher[aria-expanded="true"] {
  background: radial-gradient(circle at 35% 30%, #29cb5f 0%, #1da851 52%, #096833 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32), 0 0 16px rgba(37, 211, 102, 0.35), inset 0 2px 3px rgba(255, 255, 255, 0.35);
  animation: none;
}

/* Ambient Pulse Aura */
.whatsapp-pulse-aura {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  pointer-events: none;
  border: 2px solid rgba(37, 211, 102, 0.6);
  animation: wa-bubble-aura 2.4s cubic-bezier(0.2, 0.8, 0.4, 1) infinite;
}

.whatsapp-launcher[aria-expanded="true"] .whatsapp-pulse-aura {
  display: none;
}

/* Click Shockwave Burst */
.whatsapp-click-shockwave {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 3px solid #25d366;
  pointer-events: none;
  opacity: 0;
}

.whatsapp-launcher.anim-pop .whatsapp-click-shockwave {
  animation: wa-shockwave-burst 0.55s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

/* Bubbly Notification Badge */
.whatsapp-bubble-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 14px;
  height: 14px;
  background-color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  z-index: 3;
}

.whatsapp-badge-dot {
  width: 8px;
  height: 8px;
  background-color: #25d366;
  border-radius: 50%;
  animation: wa-status-blink 1.8s infinite ease-in-out;
}

.whatsapp-launcher[aria-expanded="true"] .whatsapp-bubble-badge {
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s, transform 0.2s;
}

/* Desktop Hover Tooltip */
.whatsapp-bubble-tooltip {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  background: #0c1811;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(37, 211, 102, 0.3);
}

.whatsapp-bubble-tooltip::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: #0c1811;
}

.whatsapp-launcher:hover .whatsapp-bubble-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.whatsapp-launcher[aria-expanded="true"] .whatsapp-bubble-tooltip {
  display: none;
}

/* Dual Icon Wrap (Chat & Close Morph) */
.whatsapp-bubble-icons {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.whatsapp-icon-chat,
.whatsapp-icon-close {
  position: absolute;
  width: 30px;
  height: 30px;
  fill: #ffffff;
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.24s ease;
}

.whatsapp-icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.4);
}

.whatsapp-launcher[aria-expanded="true"] .whatsapp-icon-chat {
  opacity: 0;
  transform: rotate(90deg) scale(0.4);
}

.whatsapp-launcher[aria-expanded="true"] .whatsapp-icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Expandable Popover Window (Rounded Bubbly Theme) */
.whatsapp-popover {
  position: absolute;
  bottom: calc(100% + 16px);
  right: 0;
  width: 370px;
  max-width: calc(100vw - 28px);
  background-color: #ffffff;
  border: 1px solid var(--color-outline-variant, #e5e0d8);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(12, 24, 17, 0.22), 0 4px 16px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(24px) scale(0.72);
  transform-origin: bottom right;
  transition: opacity 0.26s ease, transform 0.26s ease, visibility 0.26s ease;
  z-index: 10000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.whatsapp-popover.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  animation: wa-window-spring-in 0.4s cubic-bezier(0.34, 1.45, 0.64, 1) forwards;
}

/* Popover Header */
.whatsapp-header {
  background: linear-gradient(135deg, #0c1811 0%, #15291c 100%);
  color: #ffffff;
  padding: 15px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px 20px 0 0;
}

.whatsapp-header-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.whatsapp-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #25d366;
  margin-bottom: 2px;
}

.whatsapp-status-dot {
  width: 6px;
  height: 6px;
  background-color: #25d366;
  border-radius: 50%;
  animation: wa-status-blink 1.8s infinite ease-in-out;
}

.whatsapp-header-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  letter-spacing: 0.02em;
}

.whatsapp-header-sub {
  font-size: 11px;
  color: var(--color-primary-fixed-dim, #b8c9bc);
}

.whatsapp-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  opacity: 0.85;
  transition: all 0.2s ease;
}

.whatsapp-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  opacity: 1;
  transform: rotate(90deg);
}

/* Popover Body (Direct Human Advisory Directory) */
.whatsapp-body {
  padding: 14px 14px 12px;
  background-color: var(--color-surface-container-lowest, #ffffff);
  display: flex;
  flex-direction: column;
}

.whatsapp-agents-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.whatsapp-agent-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--color-outline-variant, #e5e0d8);
  border-radius: 14px;
  background-color: #ffffff;
  text-decoration: none;
  color: var(--color-on-surface, #1b1c1b);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.whatsapp-agent-card:hover {
  border-color: #25d366;
  background-color: #f7fbf8;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.14);
}

.whatsapp-agent-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.whatsapp-agent-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--color-primary, #002d1d);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

.whatsapp-agent-avatar.avatar-gold {
  background-color: #8c6a28;
  color: #ffffff;
}

.whatsapp-agent-avatar.avatar-uk {
  background-color: #1a4269;
  color: #ffffff;
}

.whatsapp-agent-details {
  display: flex;
  flex-direction: column;
  text-align: left;
  flex: 1;
  min-width: 0;
  padding-right: 4px;
}

.whatsapp-agent-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  flex-wrap: nowrap;
}

.whatsapp-agent-name-row h5 {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-on-surface, #1b1c1b);
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
}

.whatsapp-tag-primary,
.whatsapp-tag-gold,
.whatsapp-tag-uk {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 1.5px 6px;
  border-radius: 6px;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
}

.whatsapp-tag-primary {
  background-color: #edf7ed;
  color: #1e4620;
  border: 1px solid #b7dfb9;
}

.whatsapp-tag-gold {
  background-color: #fcf6e8;
  color: #704f10;
  border: 1px solid #ebd7a3;
}

.whatsapp-tag-uk {
  background-color: #eaf1fa;
  color: #16406e;
  border: 1px solid #b6d0f0;
}

.whatsapp-agent-details p {
  font-size: 11px;
  color: var(--color-on-surface-variant, #53453b);
  margin: 0 0 3px 0;
  line-height: 1.2;
}

.whatsapp-agent-phone {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-secondary, #4a6350);
  line-height: 1;
}

.whatsapp-chat-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: linear-gradient(135deg, #2ae06c 0%, #20ba5a 100%);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 3px 8px rgba(37, 211, 102, 0.35);
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  flex-shrink: 0;
  cursor: pointer;
  margin-left: auto;
  transform-origin: right center;
}

.whatsapp-agent-card:hover .whatsapp-chat-action-btn {
  background: linear-gradient(135deg, #32dc70 0%, #179647 100%);
  color: #ffffff;
  box-shadow: 0 5px 14px rgba(37, 211, 102, 0.5);
  transform: scale(1.04) translateY(-1px);
}

.whatsapp-agent-card:active .whatsapp-chat-action-btn {
  transform: scale(0.96);
}

.whatsapp-action-svg {
  width: 13px;
  height: 13px;
  fill: #ffffff;
  flex-shrink: 0;
}

/* Grounded Physical Office Footer */
.whatsapp-footer-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px 12px;
  background-color: #fbf9f6;
  border-top: 1px solid var(--color-outline-variant, #e5e0d8);
  font-size: 11px;
  color: var(--color-on-surface-variant, #53453b);
  font-weight: 500;
  border-radius: 0 0 20px 20px;
}

/* Responsive Rules for Tablets and Phones */
@media (max-width: 768px) {
  /* Backdrops activate on small devices when modal opens */
  .whatsapp-backdrop {
    display: block;
  }

  /* Default Phone Position: Sits cleanly at bottom-right corner without blocking form controls */
  .whatsapp-widget-container {
    bottom: 20px;
    right: 18px;
  }

  /* Compact 58px Bubbly FAB on Mobile */
  .whatsapp-launcher {
    width: 58px;
    height: 58px;
  }

  .phone-launcher { width: 58px; height: 58px; }

  .whatsapp-bubble-tooltip {
    display: none !important;
  }

  /* Popover drawer sizing on mobile */
  .whatsapp-popover {
    width: calc(100vw - 28px);
    max-width: 360px;
    right: 0;
    bottom: calc(100% + 14px);
    border-radius: 18px;
  }
}

@media (max-width: 380px) {
  .whatsapp-widget-container {
    bottom: 16px;
    right: 14px;
  }

  .whatsapp-launcher {
    width: 54px;
    height: 54px;
  }

  .phone-launcher { width: 54px; height: 54px; }

  .whatsapp-popover {
    width: calc(100vw - 20px);
    right: -2px;
  }

  .whatsapp-agent-card {
    padding: 8px 10px;
    gap: 6px;
  }

  .whatsapp-chat-action-btn {
    padding: 5px 9px;
    font-size: 11px;
  }
}
