/* ╔════════════════════════════════════════════════════════════╗
   ║  EXTRANO TILES — CONTACT WIDGET CSS                       ║
   ║  Self-contained component styling                        ║
   ╚════════════════════════════════════════════════════════════╝ */

:root {
  --ext-gold: #c4a06a;
  --ext-gold-dark: #9e7a4a;
  --ext-white: #ffffff;
  --ext-black: #000000;
  --ext-border: #e0d8d0;
  --ext-text-light: #8a7f7a;
  --ext-font-serif: 'Cormorant Garamond', serif;
  --ext-font-sans: 'Montserrat', sans-serif;
}

/* ─────────────────────────────────────────────────────────────
   WIDGET CONTAINER
─────────────────────────────────────────────────────────────── */
.ext-widget-container {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 9998;
  font-family: var(--ext-font-sans);
}

/* ─────────────────────────────────────────────────────────────
   FLOATING ACTION BUTTON (FAB)
─────────────────────────────────────────────────────────────── */
.ext-widget-fab {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ext-gold) 0%, var(--ext-gold-dark) 100%);
  border: none;
  color: var(--ext-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease;
  padding: 0;
  animation: ext-widget-breathe 2.8s ease-in-out infinite;
}

.ext-widget-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 28px rgba(196, 160, 106, 0.45);
  animation-play-state: paused;
}

.ext-widget-fab:active {
  transform: scale(0.95);
}

/* Subtle "breathing" scale on the button itself */
@keyframes ext-widget-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

/* Expanding halo rings — "live" ripple effect */
.ext-widget-fab-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--ext-gold);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
  animation: ext-widget-ripple 2.2s ease-out infinite;
}

.ext-widget-fab-ring-2 {
  animation-delay: 1.1s;
}

@keyframes ext-widget-ripple {
  0%   { transform: scale(1);    opacity: 0.55; }
  80%  { transform: scale(1.85); opacity: 0;    }
  100% { transform: scale(1.85); opacity: 0;    }
}

/* Small "live" indicator dot (top-right of FAB) */
.ext-widget-live-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--ext-white);
  z-index: 3;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: ext-widget-live-blink 1.6s ease-in-out infinite;
}

@keyframes ext-widget-live-blink {
  0%, 100% { box-shadow: 0 0 0 0   rgba(34, 197, 94, 0.7); }
  70%      { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);   }
}

.ext-widget-fab-icon {
  position: relative;
  z-index: 2;
}

/* ─────────────────────────────────────────────────────────────
   POPUP PANEL
─────────────────────────────────────────────────────────────── */
.ext-widget-panel {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 320px;
  background: var(--ext-white);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.ext-widget-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* Card Header */
.ext-widget-header {
  background: linear-gradient(135deg, var(--ext-gold-dark) 0%, var(--ext-gold) 100%);
  color: var(--ext-white);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.ext-widget-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-family: var(--ext-font-serif);
  line-height: 1.2;
}

.ext-widget-subtitle {
  margin: 4px 0 0 0;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.9;
  letter-spacing: 0.3px;
}

.ext-widget-close {
  background: transparent;
  border: none;
  color: var(--ext-white);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.ext-widget-close:hover {
  transform: rotate(90deg);
}

/* Contact Options List */
.ext-widget-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 400px;
  overflow-y: auto;
}

.ext-widget-list::-webkit-scrollbar {
  width: 6px;
}

.ext-widget-list::-webkit-scrollbar-track {
  background: transparent;
}

.ext-widget-list::-webkit-scrollbar-thumb {
  background: var(--ext-gold);
  border-radius: 3px;
}

/* Individual Option Row */
.ext-widget-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: transparent;
  text-decoration: none;
  color: var(--ext-black);
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.ext-widget-option:hover {
  background: rgba(196, 160, 106, 0.08);
  border-color: var(--ext-gold);
}

.ext-widget-option:focus {
  outline: 2px solid var(--ext-gold);
  outline-offset: -1px;
}

/* Option Icon */
.ext-widget-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ext-gold);
  color: var(--ext-white);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.ext-widget-option:hover .ext-widget-icon {
  transform: translateX(4px) scale(1.05);
}

/* Platform-specific icon colors */
.ext-widget-icon-whatsapp {
  background: #25d366 !important;
}

.ext-widget-icon-phone {
  background: var(--ext-gold) !important;
}

.ext-widget-icon-email {
  background: #ea4335 !important;
}

.ext-widget-icon-instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important;
}

.ext-widget-icon-facebook {
  background: #1877f2 !important;
}

.ext-widget-icon-twitter {
  background: #000000 !important;
}

.ext-widget-icon-form {
  background: var(--ext-gold) !important;
}

/* Option Text Content */
.ext-widget-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.ext-widget-text strong {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--ext-black);
  display: block;
}

.ext-widget-text span {
  font-size: 12px;
  color: var(--ext-text-light);
  font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────
   OVERLAY / BACKDROP (when panel is open)
─────────────────────────────────────────────────────────────── */
.ext-widget-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9997;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.ext-widget-backdrop.visible {
  pointer-events: all;
}

/* ─────────────────────────────────────────────────────────────
   MOBILE RESPONSIVE
─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .ext-widget-container {
    bottom: 20px;
    right: 20px;
  }

  .ext-widget-fab {
    width: 46px;
    height: 46px;
  }

  .ext-widget-fab-icon {
    width: 20px;
    height: 20px;
  }

  .ext-widget-live-dot {
    width: 8px;
    height: 8px;
    top: 3px;
    right: 3px;
  }

  .ext-widget-panel {
    width: calc(100vw - 40px);
    max-width: 320px;
    bottom: 64px;
  }

  .ext-widget-list {
    max-height: 50vh;
  }
}

/* Safe area support for notched devices */
@supports (padding: max(0px)) {
  .ext-widget-container {
    bottom: max(25px, env(safe-area-inset-bottom) + 10px);
    right: max(25px, env(safe-area-inset-right) + 10px);
  }
}

/* ─────────────────────────────────────────────────────────────
   ACCESSIBILITY
─────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ext-widget-fab,
  .ext-widget-fab-ring,
  .ext-widget-fab-icon,
  .ext-widget-live-dot,
  .ext-widget-panel,
  .ext-widget-option,
  .ext-widget-icon,
  .ext-widget-close {
    animation: none !important;
    transition: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: more) {
  .ext-widget-fab {
    border: 2px solid var(--ext-white);
  }

  .ext-widget-panel {
    border: 1px solid var(--ext-gold);
  }

  .ext-widget-option {
    border: 1px solid var(--ext-border);
  }

  .ext-widget-option:hover {
    border-color: var(--ext-gold);
  }
}
