/* ================================================================
   La Brocheriana — Botón WhatsApp Flotante
   ================================================================ */

/* ── Variables ─────────────────────────────────────────────────── */
:root {
  --wa-green:     #25D366;
  --wa-green-dk:  #128C7E;
  --wa-green-lt:  #DCF8C6;
  --broch-tierra: #3F352E;
  --broch-arena:  #C0B599;
  --broch-arena-l:#F5F0E8;
  --radius:       14px;
  --shadow:       0 8px 32px rgba(0,0,0,.22);
  --transition:   .25s cubic-bezier(.34,1.56,.64,1);
}

/* ── Widget Container ──────────────────────────────────────────── */
#broch-wa-widget {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

/* ── Floating Button ───────────────────────────────────────────── */
#broch-wa-btn {
  width:  58px;
  height: 58px;
  border-radius: 50%;
  background: var(--wa-green);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.45);
  transition: transform var(--transition), background .2s, box-shadow .2s;
  position: relative;
  flex-shrink: 0;
}

#broch-wa-btn:hover {
  transform: scale(1.1);
  background: var(--wa-green-dk);
  box-shadow: 0 6px 28px rgba(37,211,102,.55);
}

#broch-wa-btn:active {
  transform: scale(.96);
}

/* Pulse ring */
#broch-wa-btn::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2.5px solid var(--wa-green);
  opacity: 0;
  animation: broch-pulse 2.4s ease-out infinite;
}

@keyframes broch-pulse {
  0%   { opacity: .7; transform: scale(1);   }
  70%  { opacity: 0;  transform: scale(1.5); }
  100% { opacity: 0;  transform: scale(1.5); }
}

/* Icons */
.broch-wa-icon-wa,
.broch-wa-icon-close {
  width: 28px;
  height: 28px;
  color: #fff;
  transition: opacity .2s, transform .2s;
  position: absolute;
}

.broch-wa-icon-close {
  opacity: 0;
  transform: rotate(-90deg);
}

/* Open state */
#broch-wa-widget.is-open #broch-wa-btn {
  background: var(--broch-tierra);
  box-shadow: 0 4px 20px rgba(63,53,46,.35);
}

#broch-wa-widget.is-open #broch-wa-btn::before {
  animation: none;
}

#broch-wa-widget.is-open .broch-wa-icon-wa {
  opacity: 0;
  transform: rotate(90deg);
}

#broch-wa-widget.is-open .broch-wa-icon-close {
  opacity: 1;
  transform: rotate(0);
}

/* ── Tooltip ───────────────────────────────────────────────────── */
#broch-wa-tooltip {
  background: var(--broch-tierra);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 100px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity .3s, transform .3s;
  box-shadow: 0 3px 12px rgba(0,0,0,.2);
  order: -1; /* appears above the button row */
  margin-right: 10px;
}

/* Show tooltip after 2s delay, hide when open */
#broch-wa-widget:not(.is-open) #broch-wa-tooltip {
  animation: broch-tooltip-appear 3s ease-out forwards;
}

@keyframes broch-tooltip-appear {
  0%   { opacity: 0; transform: translateX(10px); }
  15%  { opacity: 1; transform: translateX(0);    }
  75%  { opacity: 1; transform: translateX(0);    }
  100% { opacity: 0; transform: translateX(10px); }
}

#broch-wa-widget.is-open #broch-wa-tooltip {
  display: none;
}

/* ── Panel ─────────────────────────────────────────────────────── */
#broch-wa-panel {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 320px;
  overflow: hidden;
  transform-origin: bottom right;
  transform: scale(.85) translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .3s cubic-bezier(.34,1.2,.64,1);
}

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

/* Panel header */
.broch-wa-panel-header {
  background: var(--wa-green-dk);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.broch-wa-panel-avatar {
  width: 46px;
  height: 46px;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.broch-wa-panel-title {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.broch-wa-panel-sub {
  color: rgba(255,255,255,.75);
  font-size: 12px;
  margin-top: 2px;
}

.broch-wa-close {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}

.broch-wa-close:hover {
  background: rgba(255,255,255,.15);
  color: #fff;
}

/* Options */
.broch-wa-options {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.broch-wa-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  transition: background .15s, transform .15s;
  cursor: pointer;
}

.broch-wa-option:hover {
  transform: translateX(-2px);
  text-decoration: none;
}

.broch-wa-caminantes { background: #EBF9EF; }
.broch-wa-caminantes:hover { background: #D4F1DC; }

.broch-wa-cabalgantes { background: var(--broch-arena-l); }
.broch-wa-cabalgantes:hover { background: #EDE5D5; }

.broch-wa-canal { background: #EEF5FF; }
.broch-wa-canal:hover { background: #DDE9FF; }

.broch-wa-option-icon {
  font-size: 22px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,.7);
  flex-shrink: 0;
}

.broch-wa-option-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.broch-wa-option-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--broch-tierra);
  line-height: 1.2;
}

.broch-wa-option-desc {
  font-size: 12px;
  color: #888;
  line-height: 1.2;
}

.broch-wa-option-arrow {
  color: #aaa;
  font-size: 16px;
  transition: transform .15s, color .15s;
}

.broch-wa-option:hover .broch-wa-option-arrow {
  transform: translateX(3px);
  color: var(--wa-green);
}

/* Panel footer */
.broch-wa-panel-footer {
  padding: 10px 18px 12px;
  text-align: center;
  font-size: 11px;
  color: #aaa;
  border-top: 1px solid #f0f0f0;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  #broch-wa-widget {
    bottom: 18px;
    right: 14px;
  }

  #broch-wa-panel {
    width: calc(100vw - 28px);
    max-width: 320px;
  }
}
