/* Port of src/components/shared/CookieBanner.astro,
   src/components/ui/FloatingWhatsApp.astro and
   src/components/sections/StickyContact.astro styles. */

/* ─── Cookie banner ─────────────────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 0 16px 16px;
  pointer-events: none;
}

@media (min-width: 768px) {
  .cookie-banner { padding: 0 24px 24px; }
}

.cookie-banner__inner {
  max-width: 960px;
  margin: 0 auto;
  background: rgba(20, 27, 38, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  pointer-events: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transform: translateY(0);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

@media (min-width: 768px) {
  .cookie-banner__inner {
    flex-direction: row;
    align-items: center;
    gap: 24px;
    padding: 20px 28px;
  }
}

.cookie-banner--hidden .cookie-banner__inner {
  transform: translateY(120%);
  opacity: 0;
}

.cookie-banner__content {
  flex: 1;
  min-width: 0;
}

.cookie-banner__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.cookie-icon {
  color: #E8B820;
  flex-shrink: 0;
}

.cookie-banner__heading {
  font-size: 15px;
  font-weight: 700;
  color: #EDF2F7;
  margin: 0;
  line-height: 1.3;
}

.cookie-banner__text {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(237, 242, 247, 0.75);
  margin: 0;
}

.cookie-banner__link {
  color: #4B8AF5;
  text-decoration: underline;
  text-decoration-color: rgba(75, 138, 245, 0.4);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.cookie-banner__link:hover {
  color: #6fa0f7;
  text-decoration-color: rgba(111, 160, 247, 0.6);
}

.cookie-banner__actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

@media (max-width: 767px) {
  .cookie-banner__actions { width: 100%; }
}

.cookie-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease, transform 0.1s ease;
  white-space: nowrap;
}

.cookie-btn:active { transform: scale(0.97); }

@media (max-width: 767px) {
  .cookie-btn {
    flex: 1;
    text-align: center;
  }
}

.cookie-btn--secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #EDF2F7;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.cookie-btn--secondary:hover { background: rgba(255, 255, 255, 0.18); }

.cookie-btn--primary {
  background: #1B54D8;
  color: #ffffff;
}

.cookie-btn--primary:hover { background: #1648BE; }

/* ─── Floating WhatsApp widget ──────────────────────────────────────────── */
.wa-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

@supports (bottom: env(safe-area-inset-bottom)) {
  .wa-widget { bottom: calc(24px + env(safe-area-inset-bottom)); }
}

@media (max-width: 767px) {
  .wa-widget {
    right: 18px;
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    z-index: 1001;
    display: flex;
  }

  .wa-popup { display: none; }

  .wa-fab {
    width: 54px;
    height: 54px;
    border: 2px solid rgba(255, 255, 255, 0.16);
    box-shadow:
      0 16px 34px rgba(37, 211, 102, 0.34),
      0 0 0 8px rgba(37, 211, 102, 0.08);
  }
}

.wa-fab {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
  pointer-events: auto;
}

.wa-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.55);
}

.wa-fab:active { transform: scale(0.96); }

.wa-popup {
  width: 320px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  margin-bottom: 12px;
  transform: translateY(12px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
  transform-origin: bottom right;
}

.wa-popup.is-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.wa-popup__header {
  background: #075E54;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.wa-popup__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wa-popup__meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wa-popup__name {
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
}

.wa-popup__status {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.78rem;
  line-height: 1.2;
}

.wa-popup__close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.wa-popup__close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.wa-popup__body {
  background: #ECE5DD;
  padding: 20px 16px;
  min-height: 80px;
}

.wa-popup__footer {
  background: #fff;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #f0f0f0;
}

.wa-bubble {
  background: #fff;
  border-radius: 12px 12px 12px 4px;
  padding: 10px 14px;
  display: inline-block;
  max-width: 90%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wa-bubble p {
  margin: 0;
  font-size: 0.88rem;
  color: #1a1a1a;
  line-height: 1.45;
}

.wa-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.88rem;
  font-family: inherit;
  color: #333;
  background: transparent;
  padding: 6px 4px;
}

.wa-input::placeholder { color: #aaa; }

.wa-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: transform 0.15s, opacity 0.15s;
}

.wa-send:hover { transform: scale(1.08); }
.wa-send:active { transform: scale(0.93); }

/* ─── Sticky contact bar (mobile) ───────────────────────────────────────── */

/* ── Keyframes ── */

/* Entrance: bar slides up with spring */
@keyframes stickySlideUp {
  0%   { transform: translateY(110%); opacity: 0; }
  65%  { transform: translateY(-6px); opacity: 1; }
  82%  { transform: translateY(3px); }
  100% { transform: translateY(0); }
}

/* WhatsApp: balanced ripple ring */
@keyframes waRipple1 {
  0%   { box-shadow: 0 0 0 0px rgba(37,211,102,0.5),  0 0 0 0px rgba(37,211,102,0.25); }
  70%  { box-shadow: 0 0 0 6px rgba(37,211,102,0),    0 0 0 12px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0px rgba(37,211,102,0),    0 0 0 0px rgba(37,211,102,0); }
}

/* WhatsApp: shimmer sweep across button */
@keyframes waShimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* WhatsApp: breathing scale */
@keyframes waBreathe {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.025); }
}

/* Calendar: flip like turning a page */
@keyframes calFlip {
  0%, 80%, 100% { transform: rotateY(0deg); }
  88%           { transform: rotateY(-25deg) scale(0.95); }
  94%           { transform: rotateY(10deg) scale(1.02); }
}

/* Phone: realistic ring shake */
@keyframes phoneRing {
  0%, 60%, 100%  { transform: rotate(0deg); }
  62%            { transform: rotate(-18deg) scale(1.08); }
  66%            { transform: rotate(18deg)  scale(1.08); }
  70%            { transform: rotate(-14deg); }
  74%            { transform: rotate(14deg); }
  78%            { transform: rotate(-8deg); }
  82%            { transform: rotate(0deg); }
}

/* Notification dot pop */
@keyframes dotPop {
  0%, 70%, 100% { transform: scale(1); }
  75%           { transform: scale(1.5); }
  82%           { transform: scale(0.85); }
  88%           { transform: scale(1.2); }
}

/* ── Bar ── */
.sticky-contact-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 7px 10px;
  padding-bottom: calc(7px + env(safe-area-inset-bottom, 0px));
  background: var(--sticky-bar-bg);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
  animation: stickySlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

@media (min-width: 768px) {
  .sticky-contact-bar { display: none; }
}

/* ── WhatsApp button ── */
.sticky-primary {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  min-width: 0;
  position: relative;
  overflow: hidden;

  /* Shimmer gradient background */
  background: linear-gradient(
    105deg,
    #25d366 0%,
    #20c25d 30%,
    #5fffa0 48%,
    #20c25d 55%,
    #128c7e 100%
  );
  background-size: 200% auto;

  /* Layer: breathe + ripple + shimmer */
  animation:
    waBreathe  5s ease-in-out 0.2s infinite,
    waRipple1  5s ease-out   0.2s infinite,
    waShimmer  6s linear     0.2s infinite;

  transition: transform 0.2s ease;
}

.sticky-label {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Calendar & Call buttons ── */
.sticky-booking,
.sticky-call {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--heading);
  border: 1px solid var(--border);
  text-decoration: none;
  flex-shrink: 0;
  position: relative;
  transition: transform 0.2s ease, border-color 0.25s ease;
}

/* Calendar flip every 4s */
.sticky-booking {
  animation: calFlip 4s ease-in-out 0.3s infinite;
}

/* Phone ring every 5s */
.sticky-call {
  animation: phoneRing 5s ease-in-out 0.4s infinite;
}

/* Notification dot on calendar */
.sticky-booking::after {
  content: '';
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  border: 1.5px solid var(--surface-2);
  animation: dotPop 4s ease-in-out 0.3s infinite;
}

/* Active states */
.sticky-primary:active { transform: scale(0.95); animation: none; }
.sticky-booking:active { transform: scale(0.93); }
.sticky-call:active    { transform: scale(0.93); }

/* Mobile bottom navigation overrides */
@keyframes stickySlideUp {
  0% { transform: translate3d(-50%, 120%, 0); opacity: 0; }
  100% { transform: translate3d(-50%, 0, 0); opacity: 1; }
}

.sticky-contact-bar {
  left: 50%;
  right: auto;
  bottom: calc(4px + env(safe-area-inset-bottom, 0px));
  z-index: 1000;
  width: calc(100% - 20px);
  max-width: 420px;
  min-height: 62px;
  display: grid;
  grid-template-columns: 1fr 1fr 62px 1fr 1fr;
  align-items: end;
  gap: 2px;
  padding: 7px 9px 8px;
  background: rgba(10, 15, 25, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: stickySlideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

.sticky-nav-link {
  min-width: 0;
  min-height: 47px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 2px 0;
  color: rgba(255, 255, 255, 0.64);
  text-decoration: none;
  border-radius: 15px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.sticky-nav-link svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.sticky-nav-link span {
  max-width: 100%;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticky-nav-link.active,
.sticky-nav-link:active {
  color: #0d8dff;
  background: transparent;
}

.sticky-call {
  align-self: start;
  justify-self: center;
  width: 62px;
  height: 62px;
  min-height: 62px;
  margin-top: -28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #ffffff;
  text-decoration: none;
  background: linear-gradient(135deg, #0d8dff 0%, #0574e9 100%);
  border: 5px solid rgba(10, 15, 25, 0.94);
  box-shadow:
    0 18px 30px rgba(13, 141, 255, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  animation: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sticky-call svg {
  width: 26px;
  height: 26px;
}

.sticky-call:active {
  transform: scale(0.95);
  box-shadow:
    0 12px 24px rgba(13, 141, 255, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

@media (max-width: 767px) {
  .wa-fab {
    width: 54px;
    height: 54px;
    border: 2px solid rgba(255, 255, 255, 0.16);
    box-shadow:
      0 16px 34px rgba(37, 211, 102, 0.34),
      0 0 0 8px rgba(37, 211, 102, 0.08);
  }

  .wa-popup {
    display: block;
    width: min(calc(100vw - 32px), 320px);
    margin-bottom: 10px;
    border-radius: 14px;
  }

  .wa-popup__header {
    padding: 13px 14px;
  }

  .wa-popup__avatar {
    width: 38px;
    height: 38px;
  }

  .wa-popup__body {
    min-height: 70px;
    padding: 16px 14px;
  }

  .wa-popup__footer {
    padding: 8px 10px;
  }

  .wa-send {
    width: 34px;
    height: 34px;
  }
}

@media (min-width: 768px) {
  .sticky-contact-bar { display: none; }
}
