/* ═══════════════════════════════════════════════════
   KAVE — Sales Widget (Global)
   ═══════════════════════════════════════════════════ */

/* ── Floating Contact Button — bottom right ── */
.floating-contact {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 800;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.floating-contact .fc-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(17, 29, 41, 0.15);
  transition: transform var(--duration-base) var(--ease), box-shadow var(--duration-base) var(--ease);
}

.floating-contact .fc-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(17, 29, 41, 0.2);
}

.floating-contact .fc-wa {
  background: #25d366;
  color: #fff;
}

.floating-contact .fc-wa:hover {
  background: #1fb855;
  box-shadow: 0 8px 28px rgba(37, 211, 102, 0.35);
}

.floating-contact .fc-btn svg {
  width: 24px;
  height: 24px;
}

/* Pulse ring on WhatsApp */
.floating-contact .fc-wa::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #25d366;
  opacity: 0;
  animation: fc-pulse 3s ease infinite;
}

@keyframes fc-pulse {
  0%, 100% { transform: scale(1); opacity: 0; }
  50% { transform: scale(1.15); opacity: 0.4; }
}

@media (max-width: 760px) {
  .floating-contact { bottom: 20px; right: 16px; }
  .floating-contact .fc-btn { width: 50px; height: 50px; }
  .floating-contact .fc-btn svg { width: 22px; height: 22px; }
}

/* ── Trigger Button — right wall ── */
.sales-trigger {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 800;
  display: flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  border: none;
  background: var(--color-text);
  color: #fff;
  padding: 16px 14px 16px 16px;
  border-radius: 12px 0 0 12px;
  box-shadow: -4px 4px 24px rgba(17, 29, 41, 0.18);
  transition: padding var(--duration-base) var(--ease), box-shadow var(--duration-base) var(--ease), transform 0.5s var(--ease);
  writing-mode: vertical-lr;
  text-orientation: mixed;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
}

.sales-trigger::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff;
  transform: translateX(101%);
  transition: transform var(--duration-slow) var(--ease);
  z-index: -1;
  border-radius: 12px 0 0 12px;
}

.sales-trigger:hover::before { transform: translateX(0); }
.sales-trigger:hover { color: var(--color-text); box-shadow: -6px 6px 32px rgba(17, 29, 41, 0.25); }

.sales-trigger .trigger-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34c759;
  margin-bottom: 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(52, 199, 89, 0); }
}

.sales-trigger .trigger-text {
  position: relative;
  z-index: 2;
}

/* Hide trigger when panel is open */
.sales-trigger.hidden {
  transform: translateY(-50%) translateX(100%);
  pointer-events: none;
}

/* ── Overlay ── */
.sales-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 29, 41, 0.35);
  z-index: 9990;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-slow) var(--ease);
  backdrop-filter: blur(6px);
}

.sales-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Panel ── */
.sales-panel {
  position: fixed;
  top: 0;
  right: -560px;
  width: 100%;
  max-width: 520px;
  height: 100vh;
  height: 100dvh;
  z-index: 9995;
  background: #fff;
  box-shadow: -16px 0 60px rgba(17, 29, 41, 0.12);
  transition: right var(--duration-slow) var(--ease);
  display: flex;
  flex-direction: column;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--color-line) transparent;
}

.sales-panel::-webkit-scrollbar { width: 4px; }
.sales-panel::-webkit-scrollbar-track { background: transparent; }
.sales-panel::-webkit-scrollbar-thumb { background: var(--color-line); border-radius: 8px; }
.sales-panel.active { right: 0; }

/* Close button */
.sales-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: background var(--duration-base) var(--ease), border-color var(--duration-base) var(--ease);
  cursor: pointer;
}

.sales-close:hover { background: var(--color-text); border-color: var(--color-text); }
.sales-close span {
  position: absolute;
  width: 16px;
  height: 1.5px;
  background: var(--color-text);
  transition: background var(--duration-base) var(--ease);
}
.sales-close:hover span { background: #fff; }
.sales-close span:nth-child(1) { transform: rotate(45deg); }
.sales-close span:nth-child(2) { transform: rotate(-45deg); }

/* ── Manager Card ── */
.sales-manager {
  padding: 48px 36px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.manager-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-line);
  flex-shrink: 0;
}

.manager-info {
  flex: 1;
}

.manager-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 2px;
}

.manager-role {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-text-muted);
  letter-spacing: 0.5px;
}

.manager-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-family: var(--font-body);
  font-size: 11px;
  color: #34c759;
  font-weight: 500;
}

.manager-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34c759;
}

/* ── Quick Actions ── */
.sales-quick {
  padding: 0 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 28px;
}

.quick-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 14px;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  background: transparent;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  text-align: center;
  transition: background var(--duration-base) var(--ease), border-color var(--duration-base) var(--ease), color var(--duration-base) var(--ease), transform var(--duration-base) var(--ease), box-shadow var(--duration-base) var(--ease);
  cursor: pointer;
}

.quick-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.quick-btn:hover {
  background: var(--color-text);
  border-color: var(--color-text);
  color: #fff;
}

.quick-btn.wa {
  background: #25d366;
  border-color: #25d366;
  color: #fff;
  font-weight: 600;
}
.quick-btn.wa svg { filter: brightness(10); }
.quick-btn.wa:hover {
  background: #1fb855;
  border-color: #1fb855;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
}

/* ── Divider ── */
.sales-divider {
  height: 1px;
  background: var(--color-line);
  margin: 0 36px 28px;
}

/* ── Interest Selector ── */
.sales-interest {
  padding: 0 36px 24px;
}

.interest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.interest-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0;
}

/* ── Skip Checkbox ── */
.interest-skip-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
}

.interest-skip-wrap input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--color-line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: background var(--duration-fast), border-color var(--duration-fast);
  flex-shrink: 0;
}

.interest-skip-wrap input[type="checkbox"]:checked {
  background: var(--color-text);
  border-color: var(--color-text);
}

.interest-skip-wrap input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.interest-skip-wrap span {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--color-text-muted);
  transition: color var(--duration-fast);
}

.interest-skip-wrap:hover span { color: var(--color-text); }

.interest-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.interest-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 10px;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: border-color var(--duration-base) var(--ease), background var(--duration-base) var(--ease), transform 0.2s var(--ease);
  text-align: center;
}

.interest-item svg,
.interest-item img {
  width: 60px;
  height: 40px;
  object-fit: contain;
  transition: transform 0.3s var(--ease), filter var(--duration-base) var(--ease);
  filter: grayscale(0.3) opacity(0.7);
}

.interest-item span {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--color-text);
}

.interest-item:hover {
  border-color: var(--color-text);
  transform: translateY(-2px);
}

.interest-item:hover svg,
.interest-item:hover img { transform: scale(1.1); filter: grayscale(0) opacity(1); }

.interest-item.selected {
  border-color: var(--color-text);
  background: var(--color-text);
}

.interest-item.selected svg,
.interest-item.selected img { filter: invert(1) brightness(2) opacity(1); }
.interest-item.selected span { color: #fff; }

/* Interest grid fade when skipped */
.interest-grid {
  transition: opacity var(--duration-base) var(--ease);
}

/* ── Form ── */
.sales-form {
  padding: 0 36px 36px;
  flex: 1;
}

.form-group {
  margin-bottom: 16px;
  position: relative;
}

.form-group label {
  display: block;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 16px 18px;
  border: 1.5px solid var(--color-line);
  border-radius: 8px;
  background: var(--color-bg-alt);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text);
  outline: none;
  transition: border-color var(--duration-base) var(--ease), background var(--duration-base) var(--ease), box-shadow var(--duration-base) var(--ease);
}

.form-group input:hover,
.form-group textarea:hover {
  border-color: rgba(17, 29, 41, 0.25);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-text);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(17, 29, 41, 0.06);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(17, 29, 41, 0.3);
  font-weight: 400;
}

.form-group textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

/* ── Phone Input with Custom Country Dropdown ── */
.phone-wrap {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--color-line);
  border-radius: 8px;
  background: var(--color-bg-alt);
  transition: border-color var(--duration-base) var(--ease), box-shadow var(--duration-base) var(--ease), background var(--duration-base) var(--ease);
  position: relative;
  overflow: visible;
}

.phone-wrap:hover { border-color: rgba(17, 29, 41, 0.25); }

.phone-wrap:focus-within {
  border-color: var(--color-text);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(17, 29, 41, 0.06);
}

/* Trigger area */
.country-native {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 14px;
  border-right: 1.5px solid var(--color-line);
  flex-shrink: 0;
  cursor: pointer;
  align-self: stretch;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  min-height: 50px;
}

.country-native:hover { background: rgba(17, 29, 41, 0.03); }

.country-flag {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  pointer-events: none;
}

.country-code-label {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  pointer-events: none;
}

.country-chevron {
  width: 10px;
  height: 10px;
  opacity: 0.35;
  pointer-events: none;
  transition: transform var(--duration-fast);
  margin-left: 2px;
}

.country-native.open .country-chevron { transform: rotate(180deg); }

/* Hidden native select — covers the trigger for mobile tap */
.country-native select {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 16px; /* prevents iOS zoom */
  z-index: 2;
}

/* Custom dropdown list — positioned from .phone-wrap */
.country-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 200%;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1.5px solid var(--color-line);
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(17, 29, 41, 0.14);
  z-index: 100;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--color-line) transparent;
}

.country-list::-webkit-scrollbar { width: 4px; }
.country-list::-webkit-scrollbar-thumb { background: var(--color-line); border-radius: 8px; }

.country-native.open .country-list {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.country-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s ease;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-text);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.country-list-item:hover { background: rgba(17, 29, 41, 0.04); }
.country-list-item.active { background: rgba(17, 29, 41, 0.06); font-weight: 600; }

.country-list-item img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.country-list-item .cl-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-list-item .cl-dial {
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 400;
  flex-shrink: 0;
}

/* Phone input */
.phone-wrap input[type="tel"] {
  flex: 1;
  padding: 16px 18px 16px 14px;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text);
  outline: none;
  min-width: 0;
}

.phone-wrap input[type="tel"]::placeholder {
  color: rgba(17, 29, 41, 0.3);
}

.form-submit {
  position: relative;
  width: 100%;
  padding: 22px 28px;
  margin-top: 8px;
  background: var(--color-text);
  color: #fff;
  border: 2px solid var(--color-text);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: color var(--duration-slow) var(--ease), box-shadow var(--duration-base) var(--ease);
}

.form-submit:hover {
  box-shadow: 0 6px 24px rgba(17, 29, 41, 0.2);
}

.form-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff;
  transform: translateY(101%);
  transition: transform var(--duration-slow) var(--ease);
  z-index: -1;
}

.form-submit:hover::before { transform: translateY(0); }
.form-submit:hover { color: var(--color-text); }

/* ── Responsive ── */
@media (max-width: 760px) {
  .sales-trigger {
    top: auto;
    bottom: 24px;
    right: 16px;
    transform: none;
    writing-mode: horizontal-tb;
    text-orientation: initial;
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 10px;
    letter-spacing: 1.5px;
    flex-direction: row;
  }

  .sales-trigger .trigger-dot { margin-bottom: 0; margin-right: 8px; }
  .sales-trigger.hidden { transform: translateY(120px); }

  .sales-panel { max-width: 100%; right: -100%; }
  .sales-manager { padding: 44px 24px 24px; }
  .sales-quick { padding: 0 24px; }
  .sales-divider { margin: 0 24px 24px; }
  .sales-interest { padding: 0 24px 20px; }
  .interest-grid { grid-template-columns: repeat(4, 1fr); }
  .sales-form { padding: 0 24px 32px; }
  .sales-close { top: 14px; right: 14px; }
}

@media (max-width: 420px) {
  .interest-grid { grid-template-columns: repeat(2, 1fr); }
}
