/* ============================================================
   CiCC Contact Buttons 3.0 — FAB Collapse
   ============================================================ */

/* ── FAB Root ── */
#cicc-contact-root {
  position: fixed;
  bottom: 28px;
  z-index: 9997;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#cicc-contact-root[data-pos="right"] {
  right: 20px;
  left: auto;
}
#cicc-contact-root[data-pos="left"] {
  left: 20px;
  right: auto;
}

/* ── Main FAB ── */
.cicc-fab {
  position: relative;
  display: flex;
  align-items: center;
}

.cicc-fab--right { justify-content: flex-end; }
.cicc-fab--left  { justify-content: flex-start; }

.cicc-fab__main {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0057a3, #3b82f6);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,87,163,0.35);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.3s ease;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.cicc-fab__main:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 28px rgba(0,87,163,0.45);
}

.cicc-fab__main svg {
  width: 26px;
  height: 26px;
  display: block;
  transition: transform 0.35s ease;
}

.cicc-fab--open .cicc-fab__main svg {
  transform: rotate(45deg);
}

.cicc-fab__label {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15,23,42,0.95);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 10px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.cicc-fab--left .cicc-fab__label {
  right: auto;
  left: calc(100% + 12px);
}

.cicc-fab:hover .cicc-fab__label {
  opacity: 1;
}

.cicc-fab__pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3px solid rgba(0,87,163,0.25);
  animation: ciccPulse 2.5s infinite;
  z-index: 0;
}

@keyframes ciccPulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ── Channels Container ── */
.cicc-fab__channels {
  display: flex;
  gap: 10px;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 1;
}

/* Horizontal: channels bên cạnh */
.cicc-fab--horizontal .cicc-fab {
  flex-direction: row;
}
.cicc-fab--horizontal .cicc-fab__channels {
  flex-direction: row;
}

.cicc-fab--right.cicc-fab--horizontal .cicc-fab__channels {
  flex-direction: row-reverse;
}

/* Vertical: channels bên trên */
.cicc-fab--vertical .cicc-fab {
  flex-direction: column-reverse;
}
.cicc-fab--vertical .cicc-fab__channels {
  flex-direction: column;
}
.cicc-fab--right.cicc-fab--vertical .cicc-fab__channels {
  align-items: flex-end;
}
.cicc-fab--left.cicc-fab--vertical .cicc-fab__channels {
  align-items: flex-start;
}

/* Collapsed: ẩn channels */
.cicc-fab__channels.cicc-collapsed {
  width: 0 !important;
  height: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.cicc-fab__channels:not(.cicc-collapsed) {
  opacity: 1;
  pointer-events: auto;
}

/* ── Channel Button ── */
.cicc-fab__channel {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: none;
  cursor: pointer;
  color: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
  transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.25s ease;
  position: relative;
  font-size: 0;
  flex-shrink: 0;
}

.cicc-fab__channel:hover {
  transform: scale(1.15) translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.cicc-fab__channel:active {
  transform: scale(0.92);
}

.cicc-fab__channel svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* Tooltip */
.cicc-fab__channel::after {
  content: attr(data-label);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15,23,42,0.95);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 3;
}

.cicc-fab--right .cicc-fab__channel::after {
  right: calc(100% + 10px);
}
.cicc-fab--left .cicc-fab__channel::after {
  left: calc(100% + 10px);
}

.cicc-fab__channel:hover::after { opacity: 1; }

/* ── Scroll to top — nhẹ nhàng ── */
.cicc-fab__scroll {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255,255,255,0.3);
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(4px);
  transition: opacity 0.3s ease, background 0.2s;
  flex-shrink: 0;
}

.cicc-fab__scroll.is-visible {
  display: flex;
}

.cicc-fab__scroll:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.cicc-fab__scroll svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* ── Lead Capture Drawer ── */
.cicc-lead-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99999;
  align-items: flex-end;
  justify-content: center;
}
.cicc-lead-overlay.open { display: flex; }

.cicc-lead-drawer {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 28px 24px calc(env(safe-area-inset-bottom,16px)+24px);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  max-height: 90vh;
  overflow-y: auto;
}
.open .cicc-lead-drawer { transform: translateY(0); }

.cicc-lead-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: background 0.2s;
}
.cicc-lead-close:hover { background: #e2e8f0; }

.cicc-lead-header { text-align: center; margin-bottom: 24px; }
.cicc-lead-header h3 { font-size: 18px; font-weight: 700; color: #0f172a; margin: 0 0 6px; }
.cicc-lead-header p { font-size: 13px; color: #64748b; margin: 0; }

.cicc-lead-form { display: flex; flex-direction: column; gap: 14px; }

.cicc-lead-field label {
  display: block; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 4px;
}
.cicc-lead-field input,
.cicc-lead-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #f8fafc;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.cicc-lead-field input:focus,
.cicc-lead-field textarea:focus {
  outline: none;
  border-color: #0057a3;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,87,163,0.1);
}

.cicc-lead-submit {
  padding: 13px 24px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #0057a3, #3b82f6);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.cicc-lead-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,87,163,0.3); }
.cicc-lead-submit:disabled { opacity: 0.6; transform: none; cursor: not-allowed; }

.cicc-lead-success { display: none; text-align: center; padding: 24px 0; }
.cicc-lead-success.show { display: block; }

.cicc-lead-note {
  text-align: center; font-size: 11px; color: #94a3b8; margin: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .cicc-fab__main { width: 50px; height: 50px; }
  .cicc-fab__main svg { width: 22px; height: 22px; }
  .cicc-fab__channel { width: 44px; height: 44px; }
  .cicc-fab__channel svg { width: 20px; height: 20px; }
  .cicc-fab__channel::after { display: none; }
  .cicc-fab__label { display: none; }
}
