/* ================================================================ */
/* ── ChatbotBadge: Header Entry Point ── */
.se-chatbot-badge {
  position: relative;
  padding: 5px 8px 5px 5px;
  border-radius: 12px;
  /* No border , clean look */
  box-shadow: 0 2px 12px rgba(233, 75, 53, 0.12);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  animation: se-badge-pulse 2.5s ease-in-out infinite;
}
.se-chatbot-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(233, 75, 53, 0.22);
  animation: none;
}
@keyframes se-badge-pulse {
  0%, 100% { box-shadow: 0 2px 12px rgba(233, 75, 53, 0.10), 0 0 0 0 rgba(233, 75, 53, 0.25); }
  50%       { box-shadow: 0 4px 16px rgba(233, 75, 53, 0.16), 0 0 0 5px rgba(233, 75, 53, 0); }
}

/* Avatar ring + status dot */
.se-badge-avatar {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #FFF0EE 0%, #FFE8E4 100%);
  display: flex; align-items: center; justify-content: center;
  overflow: visible;
  flex-shrink: 0;
}
.se-badge-status-dot {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 10px; height: 10px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: se-dot-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes se-dot-ping {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  70%  { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Typewriter text , fixed width prevents layout shift / blinking */
.se-typewriter-text {
  display: inline-block;
  width: 160px;          /* fixed: badge never resizes as text types */
  font-style: italic;
  letter-spacing: 0.01em;
  border-right: 1.5px solid #E94B35;  /* blinking cursor */
  overflow: hidden;
  white-space: nowrap;
  animation: se-blink 0.75s step-end infinite;
}
@keyframes se-blink {
  0%, 100% { border-color: #E94B35; }
  50%       { border-color: transparent; }
}

/* ── ChatbotModal Overlay ── */
.se-chatbot-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(20, 14, 10, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.se-chatbot-overlay.se-open {
  opacity: 1;
  pointer-events: all;
}

/* ── ChatbotModal Panel ── */
.se-chatbot-panel {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100vh;
  background: #FDFCFB;
  border-radius: 0;
  border: 1px solid rgba(232, 222, 212, 0.8);
  box-shadow:
    0 32px 80px -12px rgba(0, 0, 0, 0.28),
    0 4px 24px rgba(233, 75, 53, 0.08),
    inset 0 1px 0 rgba(255,255,255,0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.88) translateY(24px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}
.se-chatbot-overlay.se-open .se-chatbot-panel {
  transform: scale(1) translateY(0);
}

/* ── Modal Header ── */
.se-chat-header {
  background: linear-gradient(135deg, #fff 0%, #FFF5F3 100%);
  border-bottom: 1px solid #F0E8E2;
  flex-shrink: 0;
}
.se-chat-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}

/* Chat avatar (inside modal) */
.se-chat-avatar {
  position: relative;
  width: 46px; height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #FFF0EE 0%, #FFE4DF 100%);
  border: 1.5px solid rgba(233, 75, 53, 0.15);
  display: flex; align-items: center; justify-content: center;
  overflow: visible;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(233, 75, 53, 0.12);
}
.se-chat-avatar-dot {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 12px; height: 12px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: se-dot-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.se-chat-title {
  font-family: 'Fredoka', 'Outfit', sans-serif;
  font-size: 1.1rem; font-weight: 700; color: #1E140F;
  margin: 0; line-height: 1.2;
}
.se-chat-subtitle {
  font-size: 0.72rem; color: #9C8C85; font-weight: 500; margin: 2px 0 0;
}
.se-chat-close-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid #E8DED4;
  background: #fff; color: #706059;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.82rem;
  transition: all 0.25s ease; flex-shrink: 0;
}
.se-chat-close-btn:hover {
  background: #FFF0EE; border-color: #E94B35; color: #E94B35;
  transform: rotate(90deg);
}

/* ── Chat Messages Area ── */
.se-chat-messages {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 20px 20px 12px;
  display: flex; flex-direction: column; gap: 16px;
  scroll-behavior: smooth;
}
.se-chat-messages::-webkit-scrollbar { width: 5px; }
.se-chat-messages::-webkit-scrollbar-track { background: transparent; }
.se-chat-messages::-webkit-scrollbar-thumb { background: #E0D4C5; border-radius: 4px; }

/* ── ChatMessage Component ── */
.se-chat-msg {
  display: flex; gap: 10px; align-items: flex-end;
  animation: se-msg-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes se-msg-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.se-chat-msg.se-bot  { flex-direction: row; }
.se-chat-msg.se-user { flex-direction: row-reverse; }

.se-msg-avatar {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #FFF0EE 0%, #FFE4DF 100%);
  border: 1.5px solid rgba(233,75,53,0.12);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.se-msg-avatar img { width: 100%; height: 100%; object-fit: contain; }

.se-msg-bubble {
  max-width: calc(100% - 80px);
  padding: 10px 14px; border-radius: 16px;
  font-size: 0.83rem; font-weight: 500; line-height: 1.55;
}
.se-chat-msg.se-bot .se-msg-bubble {
  background: #fff; border: 1px solid #F0E8E2; color: #2A211C;
  border-bottom-left-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.se-chat-msg.se-user .se-msg-bubble {
  background: linear-gradient(135deg, #E94B35 0%, #d03c27 100%); color: #fff;
  border-bottom-right-radius: 4px; box-shadow: 0 4px 14px rgba(233, 75, 53, 0.25);
}

/* Typing indicator */
.se-typing-indicator {
  display: flex; align-items: center; gap: 4px; padding: 10px 14px;
}
.se-typing-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #C4B8AE;
  animation: se-typing-bounce 1.2s ease-in-out infinite;
}
.se-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.se-typing-dot:nth-child(3) { animation-delay: 0.30s; }
@keyframes se-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-6px); background: #E94B35; }
}

/* ── Quick Chips ── */
.se-chips-row {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 2px;
}
.se-chip {
  padding: 7px 14px; border-radius: 999px; border: 1.5px solid #E8DED4;
  background: #fff; color: #2A211C;
  font-size: 0.75rem; font-weight: 600; cursor: pointer;
  transition: all 0.22s ease; white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.se-chip:hover {
  border-color: #E94B35; color: #E94B35; background: #FFF5F3;
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(233, 75, 53, 0.14);
}

/* ── SuggestionCard Carousel ── */
.se-cards-row {
  display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 8px;
  scrollbar-width: none;
}
.se-cards-row::-webkit-scrollbar { display: none; }

/* Product SuggestionCard */
.se-product-card {
  flex-shrink: 0; width: 230px; background: #fff;
  border-radius: 16px; border: 1px solid #F0E8E2; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: all 0.25s ease; display: flex; flex-direction: column;
}
.se-product-card:hover {
  transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,0.12);
  border-color: #DDD0C8;
}
.se-product-card-img {
  width: 100%; height: 130px; object-fit: cover; background: #F5F0EB;
}
.se-product-card-img-placeholder {
  width: 100%; height: 130px;
  background: linear-gradient(135deg, #FFF0EE 0%, #F5F0EB 100%);
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
}
.se-product-card-body {
  padding: 10px 11px; display: flex; flex-direction: column; gap: 5px; flex: 1;
}
.se-product-card-name {
  font-size: 0.74rem; font-weight: 700; color: #2A211C; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.se-product-card-meta {
  display: flex; align-items: center; gap: 5px; font-size: 0.65rem; color: #9C8C85; font-weight: 500;
}
.se-product-card-stars { color: #f59e0b; font-size: 0.62rem; }
.se-product-card-store { font-size: 0.63rem; color: #A09085; font-weight: 500; }
.se-product-card-price { font-size: 0.88rem; font-weight: 800; color: #1E140F; }
.se-product-card-cta {
  margin-top: 6px; width: 100%; padding: 7px 10px; border-radius: 9px;
  background: linear-gradient(135deg, #E94B35 0%, #d03c27 100%);
  color: #fff; border: none; font-size: 0.69rem; font-weight: 800;
  cursor: pointer; transition: all 0.2s; text-align: center;
}
.se-product-card-cta:hover {
  transform: scale(1.03); box-shadow: 0 4px 12px rgba(233, 75, 53, 0.3);
}

/* Store SuggestionCard */
.se-store-card {
  flex-shrink: 0; width: 190px; background: #fff;
  border-radius: 16px; border: 1px solid #F0E8E2; padding: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: all 0.25s ease; display: flex; flex-direction: column; gap: 8px;
}
.se-store-card:hover {
  transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,0.12);
  border-color: #DDD0C8;
}
.se-store-card-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.se-store-card-name { font-size: 0.78rem; font-weight: 700; color: #1E140F; line-height: 1.2; }
.se-store-card-meta { display: flex; flex-direction: column; gap: 3px; }
.se-store-meta-row {
  display: flex; align-items: center; gap: 5px; font-size: 0.63rem; color: #9C8C85; font-weight: 500;
}
.se-store-open-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
}
.se-store-open-badge.open   { background: #F0FDF4; color: #16a34a; }
.se-store-open-badge.closed { background: #FEF2F2; color: #dc2626; }
.se-store-card-cta {
  padding: 7px 10px; border-radius: 9px; background: #F5F0EB;
  border: 1px solid #E8DED4; color: #2A211C;
  font-size: 0.69rem; font-weight: 800; cursor: pointer;
  transition: all 0.2s; text-align: center;
}
.se-store-card-cta:hover { background: #1E140F; color: #fff; border-color: #1E140F; }

/* ── Chat Input Area ── */
.se-chat-input-area {
  border-top: 1px solid #F0E8E2; padding: 14px 20px 16px;
  background: #fff; flex-shrink: 0;
}
.se-chat-input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: #FAF7F2; border: 1.5px solid #E8DED4; border-radius: 14px;
  padding: 8px 10px 8px 14px; transition: border-color 0.2s, box-shadow 0.2s;
}
.se-chat-input-wrap:focus-within {
  border-color: #E94B35; box-shadow: 0 0 0 3px rgba(233, 75, 53, 0.1);
}
.se-chat-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: 0.86rem; font-weight: 500; color: #2A211C; font-family: 'Outfit', sans-serif;
}
.se-chat-input::placeholder { color: #C4B8AE; }
.se-chat-send-btn {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #E94B35 0%, #d03c27 100%);
  color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; cursor: pointer; transition: all 0.22s ease;
  flex-shrink: 0; box-shadow: 0 2px 8px rgba(233, 75, 53, 0.3);
}
.se-chat-send-btn:hover { transform: scale(1.08); box-shadow: 0 4px 14px rgba(233, 75, 53, 0.4); }
.se-chat-send-btn:active { transform: scale(0.95); }
.se-chat-powered {
  text-align: center; font-size: 0.62rem; color: #C4B8AE;
  font-weight: 500; margin: 8px 0 0;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .se-chatbot-panel {
    max-height: 95dvh; border-radius: 20px 20px 0 0;
    align-self: flex-end; margin-bottom: -16px;
  }
  .se-chatbot-overlay { align-items: flex-end; padding: 0; }
  .se-product-card { width: 200px; }
  .se-store-card { width: 170px; }
  .se-chat-header-inner { padding: 13px 16px; }
  .se-chat-messages { padding: 16px 16px 10px; }
  .se-chat-input-area { padding: 12px 16px 16px; }
}

/* ================================================================
   SE DELIVERY / SHIPPING MODE TOGGLE
   Component: DeliveryShippingToggle
   Structured for future API integration via se-mode-change event
   ================================================================ */

/* ── Toggle Container (segmented control) ── */
.se-mode-toggle {
  display: flex;
  align-items: center;
  background: #F5EFE6;
  border: 1px solid #E8DED4;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

/* ── Toggle Buttons ── */
.se-mode-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #9C8C85;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.01em;
}
.se-mode-btn i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  display: inline-block;
  flex-shrink: 0;
}
.se-mode-btn:hover:not(.se-mode-active) {
  color: #2A211C;
  background: rgba(255, 255, 255, 0.5);
}

/* Hide wording and just show icon when header is sticky */
#site-header.fixed .se-mode-label {
  display: none;
}
#site-header.fixed .se-mode-btn {
  padding: 5px 8px;
}
#site-header.fixed #chat-agent-text {
  display: none;
}
#site-header.fixed .se-chatbot-badge {
  padding: 0;
  background: transparent;
  box-shadow: none;
}