/* Realistic iPhone-style device + WhatsApp Flow UI */

.device-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 0 4px;
  min-width: 0;
  width: 100%;
}

.device-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
  width: 100%;
}

.device-frame {
  width: 290px;
  min-width: 290px;
  max-width: 290px;
  flex-shrink: 0;
  margin: 0 auto;
  background: linear-gradient(145deg, #2a2a2e 0%, #0d0d0f 55%, #1a1a1e 100%);
  border-radius: 44px;
  padding: 10px;
  box-shadow:
    0 0 0 1px #3a3a3e,
    0 24px 48px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
}

.device-frame::before {
  content: '';
  position: absolute;
  right: -3px;
  top: 108px;
  width: 3px;
  height: 52px;
  background: #3a3a3e;
  border-radius: 0 2px 2px 0;
}

.device-frame::after {
  content: '';
  position: absolute;
  left: -3px;
  top: 88px;
  width: 3px;
  height: 28px;
  background: #3a3a3e;
  border-radius: 2px 0 0 2px;
  box-shadow: 0 40px 0 #3a3a3e;
}

.device-screen {
  background: #000;
  border-radius: 36px;
  overflow: hidden;
  width: 100%;
  height: 520px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.device-island {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 84px;
  height: 24px;
  background: #000;
  border-radius: 20px;
  z-index: 20;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.device-statusbar {
  height: 44px;
  padding: 14px 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.device-statusbar.light { color: #111; }

.device-status-icons {
  display: flex;
  gap: 4px;
  align-items: center;
  font-size: 11px;
  letter-spacing: -0.5px;
}

.device-home-indicator {
  width: 100px;
  height: 4px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  margin: 6px auto 2px;
}

.device-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  color: #64748b;
}

/* ---- WhatsApp Chat layer ---- */
.wa-chat {
  flex: 1;
  background: #e5ddd5;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23c5bfb5' fill-opacity='0.12'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
  padding: 8px 10px 12px;
  overflow-y: auto;
}

.wa-topbar {
  background: #075e54;
  color: #fff;
  padding: 10px 12px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.wa-topbar .wa-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.wa-topbar .wa-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.wa-topbar .wa-sub {
  font-size: 11px;
  opacity: 0.8;
}

.wa-bubble {
  max-width: 88%;
  padding: 7px 10px 5px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 6px;
  position: relative;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
}

.wa-bubble.in {
  background: #fff;
  border-top-left-radius: 0;
  margin-right: auto;
  color: #64748b;
}

.wa-bubble.out {
  background: #dcf8c6;
  border-top-right-radius: 0;
  margin-left: auto;
  color: #3d5347;
}

.wa-bubble .wa-time {
  font-size: 10px;
  color: #999;
  float: right;
  margin-left: 8px;
  margin-top: 4px;
}

.wa-reply-bar {
  flex-shrink: 0;
  background: #f0f2f5;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid #e0e0e0;
}

.wa-reply-btn {
  background: #fff;
  border: 1px solid #25d366;
  color: #64748b;
  padding: 9px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

.wa-reply-btn.on {
  background: #25d366;
  border-color: #25d366;
  color: #fff;
}

.wa-flow-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  max-width: 92%;
  margin-top: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.wa-flow-card-hdr {
  font-size: 12px;
  font-weight: 700;
  color: #075e54;
  padding: 8px 10px 4px;
}

.wa-flow-card-body {
  font-size: 13px;
  padding: 0 10px 8px;
  color: #64748b;
  line-height: 1.4;
}

.wa-flow-card-ft {
  border-top: 1px solid #eee;
  padding: 10px;
  text-align: center;
  color: #00a884;
  font-weight: 600;
  font-size: 14px;
}

/* ---- WhatsApp Flow fullscreen (real UI) ---- */
.flow-fullscreen {
  flex: 1;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.flow-nav {
  padding: 10px 14px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
  background: #fff;
}

.flow-nav .flow-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #54656f;
  font-size: 18px;
  font-weight: 300;
}

.flow-nav .flow-title {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #111b21;
  margin-right: 28px;
}

.flow-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 8px;
  -webkit-overflow-scrolling: touch;
}

.flow-heading {
  font-size: 17px;
  font-weight: 700;
  color: #111b21;
  margin-bottom: 4px;
  line-height: 1.3;
}

.flow-subheading {
  font-size: 13px;
  color: #667781;
  margin-bottom: 14px;
  line-height: 1.45;
}

.flow-caption {
  font-size: 12px;
  color: #8696a0;
  margin-bottom: 12px;
}

.flow-group-label {
  font-size: 13px;
  font-weight: 600;
  color: #54656f;
  margin: 14px 0 8px;
}

.flow-group-hint {
  font-size: 11px;
  color: #8696a0;
  margin: -4px 0 8px;
}

.flow-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f2f5;
}

.flow-option:last-child { border-bottom: none; }

.flow-option-img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: #f0f2f5;
  flex-shrink: 0;
}

.flow-option-img.lg {
  width: 72px;
  height: 72px;
  border-radius: 10px;
}

.flow-option-text {
  flex: 1;
  min-width: 0;
}

.flow-option-title {
  font-size: 14px;
  font-weight: 600;
  color: #111b21;
  line-height: 1.25;
  margin-bottom: 2px;
}

.flow-option-desc {
  font-size: 12px;
  color: #667781;
  line-height: 1.35;
}

.flow-radio {
  width: 20px;
  height: 20px;
  border: 2px solid #cfd4d9;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.flow-radio.on {
  border-color: #00a884;
}

.flow-radio.on::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: #00a884;
  border-radius: 50%;
}

.flow-check {
  width: 20px;
  height: 20px;
  border: 2px solid #cfd4d9;
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
}

.flow-check.on {
  background: #00a884;
  border-color: #00a884;
}

.flow-check.on::after {
  content: '✓';
  position: absolute;
  inset: 0;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flow-footer {
  padding: 12px 16px 20px;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.flow-footer-btn {
  background: #00a884;
  color: #fff;
  text-align: center;
  padding: 13px 16px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
}

.flow-cart-line {
  font-size: 13px;
  color: #111b21;
  padding: 8px 0;
  border-bottom: 1px solid #f0f2f5;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.flow-cart-total {
  font-size: 15px;
  font-weight: 700;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
}

.flow-powered {
  text-align: center;
  font-size: 10px;
  color: #aebac1;
  padding: 6px 0 2px;
}

/* Step tabs beside phone (left, stacked) */
.flow-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  padding-top: 48px;
  width: 118px;
}

.flow-step-btn {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  white-space: nowrap;
  width: 100%;
}

.flow-step-btn:hover {
  border-color: #6366f1;
  color: #6366f1;
}

.flow-step-btn.active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

.flow-step-hint {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  max-width: 420px;
  line-height: 1.4;
}

@media (max-width: 520px) {
  .device-row {
    flex-direction: column;
    align-items: center;
  }

  .flow-steps {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 320px;
    padding-top: 0;
    order: 2;
  }

  .flow-step-btn {
    width: auto;
    border-radius: 100px;
    padding: 6px 12px;
    font-size: 11px;
  }
}
