/* Quick-connect widget. Extracted verbatim from component/quickconnect.php (P1-11)
   so it is cached instead of re-sent inside every page's HTML.
   Depends on --blue, which is defined in css/style.css (loaded earlier). */
/* ---------- Floating Action Buttons (stack) ---------- */
  .cn-cb-fab-stack {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: flex-end;
  }

  .cn-cb-fab {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue) 0%, #3a6593 100%);
    border: 2px solid rgba(255, 255, 255, 0.85);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 22px rgba(35, 71, 106, 0.35), 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }

  .cn-cb-fab--wa {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    box-shadow: 0 8px 22px rgba(37, 211, 102, 0.35), 0 2px 6px rgba(0, 0, 0, 0.12);
  }

  .cn-cb-fab--wa:hover {
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.5), 0 4px 10px rgba(0, 0, 0, 0.15);
  }

  .cn-cb-fab--wa .cn-cb-fab-pulse {
    background: #25D366;
  }

  .cn-cb-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 30px rgba(35, 71, 106, 0.5), 0 4px 10px rgba(0, 0, 0, 0.15);
  }

  .cn-cb-fab:active {
    transform: scale(0.96);
  }

  .cn-cb-fab svg {
    width: 26px;
    height: 26px;
    position: relative;
    z-index: 2;
  }

  /* Tooltip label on hover */
  .cn-cb-fab[data-label]::before {
    content: attr(data-label);
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    background: #0f172a;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 7px 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  }

  .cn-cb-fab[data-label]::after {
    content: '';
    position: absolute;
    right: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    border: 6px solid transparent;
    border-left-color: #0f172a;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .cn-cb-fab[data-label]:hover::before,
  .cn-cb-fab[data-label]:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }

  .cn-cb-fab-pulse {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: var(--blue);
    opacity: 0.45;
    animation: cnCbPulse 2.4s ease-out infinite;
    z-index: 0;
  }

  .cn-cb-fab--wa .cn-cb-fab-pulse {
    animation-delay: 1.2s;
  }

  @keyframes cnCbPulse {
    0% {
      transform: scale(1);
      opacity: 0.45;
    }

    100% {
      transform: scale(1.35);
      opacity: 0;
    }
  }

  /* ---------- Overlay ---------- */
  .cn-cb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    animation: cnCbFadeIn 0.25s ease forwards;
  }

  .cn-cb-overlay[hidden] {
    display: none;
  }

  @keyframes cnCbFadeIn {
    from {
      opacity: 0;
    }

    to {
      opacity: 1;
    }
  }

  /* ---------- Modal Container ---------- */
  .cn-cb-modal {
    background: #0f172a;
    border-radius: 16px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overscroll-behavior: contain;
    max-width: 460px;
    margin: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #f1f5f9;
    animation: cnCbSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    background-image:
      radial-gradient(circle at 20% 0%, rgba(58, 101, 147, 0.18) 0%, transparent 45%),
      radial-gradient(circle at 80% 100%, rgba(245, 166, 35, 0.10) 0%, transparent 45%);
    flex-shrink: 0;
  }

  @keyframes cnCbSlideUp {
    from {
      opacity: 0;
      transform: translateY(20px) scale(0.96);
    }

    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  .cn-cb-modal {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  }

  .cn-cb-modal::-webkit-scrollbar {
    width: 6px;
  }

  .cn-cb-modal::-webkit-scrollbar-track {
    background: transparent;
  }

  .cn-cb-modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
  }

  .cn-cb-modal::-webkit-scrollbar-button {
    display: none;
    height: 0;
    width: 0;
  }

  /* ---------- Close button ---------- */
  .cn-cb-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    z-index: 10;
  }

  .cn-cb-close:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
  }

  /* ---------- Tabs ---------- */
  .cn-cb-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 58px 22px 0;
  }

  .cn-cb-tab {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 12px 6px;
    cursor: pointer;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    transition: color 0.2s, background 0.2s;
    text-align: center;
    line-height: 1.2;
  }

  .cn-cb-tab svg {
    transition: transform 0.2s;
  }

  .cn-cb-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
  }

  .cn-cb-tab.is-active {
    color: #3a6593;
    background: rgba(58, 101, 147, 0.18);
  }

  .cn-cb-tab.is-active svg {
    transform: translateY(-2px);
  }

  /* ---------- Header ---------- */
  .cn-cb-header {
    padding: 24px 28px 16px;
    text-align: center;
  }

  .cn-cb-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
  }

  .cn-cb-brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue), #3a6593);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(35, 71, 106, 0.35);
  }

  .cn-cb-brand-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: #fff;
  }

  .cn-cb-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.3px;
    color: #fff;
  }

  /* ---------- Body ---------- */
  .cn-cb-body {
    padding: 8px 28px 24px;
    position: relative;
  }

  .cn-cb-pane {
    display: none;
  }

  .cn-cb-pane.is-active {
    display: block;
    animation: cnCbPaneIn 0.3s ease forwards;
  }

  @keyframes cnCbPaneIn {
    from {
      opacity: 0;
      transform: translateY(6px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* ---------- Form fields ---------- */
  .cn-cb-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    margin: 10px 0 6px;
  }

  .cn-cb-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s;
    outline: none;
  }

  .cn-cb-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
  }

  .cn-cb-input:focus {
    border-color: #3a6593;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0 3px rgba(58, 101, 147, 0.18);
  }

  .cn-cb-input.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
  }

  .cn-cb-textarea {
    resize: vertical;
    min-height: 88px;
    font-family: inherit;
  }

  .cn-cb-input[type="date"],
  .cn-cb-input[type="time"] {
    color-scheme: dark;
  }

  .cn-cb-phone-wrap {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px;
  }

  .cn-cb-cc {
    padding: 13px 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
  }

  .cn-cb-cc:focus {
    border-color: #3a6593;
  }

  .cn-cb-cc option {
    background: #1e293b;
    color: #fff;
  }

  .cn-cb-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* ---------- Submit ---------- */
  .cn-cb-submit {
    width: 100%;
    margin-top: 22px;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--blue) 0%, #3a6593 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 6px 18px rgba(35, 71, 106, 0.3);
    letter-spacing: 0.2px;
  }

  .cn-cb-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(35, 71, 106, 0.45);
  }

  .cn-cb-submit:active:not(:disabled) {
    transform: translateY(0);
  }

  .cn-cb-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
  }

  .cn-cb-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cnCbSpin 0.7s linear infinite;
    display: inline-block;
  }

  @keyframes cnCbSpin {
    to {
      transform: rotate(360deg);
    }
  }

  /* ---------- Fine print ---------- */
  .cn-cb-fineprint {
    font-size: 11.5px;
    color: #94a3b8;
    text-align: center;
    margin: 14px 0 0;
    line-height: 1.5;
  }

  .cn-cb-fineprint a {
    color: #3a6593;
    text-decoration: none;
  }

  .cn-cb-fineprint a:hover {
    text-decoration: underline;
  }

  /* ---------- Success state ---------- */
  .cn-cb-success {
    text-align: center;
    padding: 32px 16px;
    animation: cnCbPaneIn 0.4s ease;
  }

  .cn-cb-success-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cnCbPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .cn-cb-success-icon svg {
    stroke: #10b981;
  }

  @keyframes cnCbPop {
    0% {
      transform: scale(0);
    }

    100% {
      transform: scale(1);
    }
  }

  .cn-cb-success h3 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #fff;
  }

  .cn-cb-success-msg {
    margin: 0;
    color: #94a3b8;
    font-size: 14.5px;
    line-height: 1.55;
  }

  /* ---------- Error banner ---------- */
  .cn-cb-error-banner {
    margin-top: 16px;
    padding: 12px 14px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 10px;
    color: #fecaca;
    font-size: 13.5px;
    text-align: center;
  }

  /* ---------- Mobile ---------- */
  @media (max-width: 480px) {
    .cn-cb-fab-stack {
      bottom: 12px;
      right: 12px;
      left: 12px;
      gap: 10px;
      flex-direction: row;
      align-items: stretch;
      justify-content: stretch;
    }

    .cn-cb-fab {
      flex: 1 1 50%;
      width: auto;
      height: 46px;
      border-radius: 999px;
      border: 1.5px solid rgba(255, 255, 255, 0.25);
      gap: 8px;
      padding: 0 12px;
      box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2), 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .cn-cb-fab:active {
      transform: scale(0.97);
    }

    .cn-cb-fab:hover {
      transform: none;
      box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.12);
    }

    .cn-cb-fab svg {
      width: 18px;
      height: 18px;
      flex-shrink: 0;
    }

    .cn-cb-fab[data-label]::before {
      position: static;
      transform: none;
      background: transparent;
      box-shadow: none;
      padding: 0;
      opacity: 1;
      color: #fff;
      font-size: 12.5px;
      font-weight: 700;
      letter-spacing: 0.2px;
    }

    #cnCbFab[data-label]::before {
      content: 'Call Us';
    }

    #cnCbWaFab[data-label]::before {
      content: 'WhatsApp';
    }

    .cn-cb-fab[data-label]::after {
      display: none;
    }

    .cn-cb-fab-pulse {
      display: none;
    }

    .cn-cb-modal {
      max-width: 100%;
    }

    .cn-cb-tab span {
      font-size: 11px;
    }

    .cn-cb-title {
      font-size: 18px;
    }

    .cn-cb-header {
      padding: 20px 20px 12px;
    }

    .cn-cb-body {
      padding: 6px 20px 20px;
    }

    .cn-cb-phone-wrap {
      grid-template-columns: 100px 1fr;
    }

    .footer__copyright {
      padding-bottom: 60px;
    }
  }

  /* Reduced motion */
  @media (prefers-reduced-motion: reduce) {

    .cn-cb-fab-pulse,
    .cn-cb-modal,
    .cn-cb-overlay,
    .cn-cb-pane,
    .cn-cb-success-icon,
    .cn-cb-spinner {
      animation: none !important;
    }
  }
