/* ═══════════════════════════════════════════
   Brother Singapore – Demo Site Styles
   Color palette extracted from brother.com.sg
   ═══════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brother Brand */
  --brother-blue: #0054a6;
  --brother-blue-dark: #003a75;
  --brother-blue-darker: #00285a;
  --brother-navy: #001e3c;

  /* Surfaces */
  --bg-page: #ffffff;
  --bg-light: #f5f7fa;
  --bg-muted: #eef1f6;

  /* Text */
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #717171;
  --text-light: #9ca3af;

  /* Borders */
  --border: #e0e0e0;
  --border-light: #efefef;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.1);
  --shadow-xl: 0 16px 50px rgba(0,0,0,.14);

  /* Layout */
  --max-width: 1200px;
  --header-height: 56px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── TOP BAR ─── */
.topbar {
  background: var(--brother-navy);
  color: rgba(255,255,255,.7);
  font-size: 0.72rem;
  height: 32px;
}
.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar-links { display: flex; gap: 1.25rem; }
.topbar-links a {
  color: rgba(255,255,255,.7);
  text-decoration: none;
  transition: color .15s;
}
.topbar-links a:hover { color: #fff; }

/* ─── HEADER ─── */
.header {
  background: var(--brother-blue);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow .2s;
}
.header.scrolled { box-shadow: 0 2px 12px rgba(0,0,0,.2); }
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  height: var(--header-height);
  gap: 1.5rem;
}

.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo-svg { height: 38px; width: auto; }

.nav {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
}
.nav-link {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0 0.85rem;
  height: var(--header-height);
  display: flex;
  align-items: center;
  border-bottom: 3px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}
.nav-link:hover,
.nav-link.active {
  color: #fff;
  border-bottom-color: #fff;
  background: rgba(255,255,255,.08);
}

.search-btn {
  background: none;
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 4px;
  transition: background .15s;
  white-space: nowrap;
  margin-left: auto;
}
.search-btn:hover { background: rgba(255,255,255,.1); }

/* Mobile toggle */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all .2s;
}
.mobile-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ─── BREADCRUMB ─── */
.breadcrumb {
  background: var(--bg-light);
  border-bottom: 1px solid var(--border-light);
  padding: 0 1.5rem;
}
.breadcrumb-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.breadcrumb-inner a {
  color: var(--brother-blue);
  text-decoration: none;
}
.breadcrumb-inner a:hover { text-decoration: underline; }

/* ─── HERO ─── */
.hero {
  background: linear-gradient(135deg, var(--brother-blue-dark) 0%, var(--brother-blue) 100%);
  padding: 3.5rem 1.5rem;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 70%);
  border-radius: 50%;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,.04) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-inner {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: .5rem;
  letter-spacing: -0.02em;
}
.hero-sub {
  font-size: 1rem;
  opacity: .85;
  margin-bottom: 2rem;
}
.hero-search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 8px;
  padding: 0 1.25rem;
  height: 52px;
  max-width: 520px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}
.hero-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-primary);
  background: transparent;
}
.hero-search input::placeholder { color: var(--text-light); }

/* ─── CATEGORIES ─── */
.categories {
  padding: 3.5rem 1.5rem;
  background: var(--bg-page);
}
.categories-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: .5rem;
  color: var(--text-primary);
}
.section-sub {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.cat-card {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all .2s;
  cursor: pointer;
}
.cat-card:hover {
  border-color: var(--brother-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.cat-icon {
  width: 64px;
  height: 64px;
  background: #eef3fa;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.cat-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: .35rem;
  color: var(--text-primary);
}
.cat-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ─── CHATBOT SECTION ─── */
.chatbot-section {
  background: var(--bg-light);
  padding: 4rem 1.5rem;
}
.chatbot-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.chatbot-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #e6f4ea;
  color: #1e7e34;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  background: #1e7e34;
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.85); }
}
.chatbot-intro h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: .75rem;
  color: var(--text-primary);
}
.chatbot-intro > p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}
.chatbot-features {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.cb-feat {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* Chat Widget */
.chatbot-widget {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 560px;
  border: 1px solid var(--border);
  transition: all .3s;
}
.chatbot-widget.expanded {
  position: fixed;
  inset: 0;
  z-index: 9999;
  border-radius: 0;
  height: 100vh;
  width: 100vw;
}

.widget-header {
  background: var(--brother-blue);
  padding: .85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.widget-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}


.widget-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}
.widget-status {
  font-size: 0.72rem;
  color: rgba(255,255,255,.7);
  display: flex;
  align-items: center;
  gap: 5px;
}
.status-dot {
  width: 6px;
  height: 6px;
  background: #4ade80;
  border-radius: 50%;
}
.widget-expand {
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
}
.widget-expand:hover { background: rgba(255,255,255,.2); }

.widget-body {
  flex: 1;
  position: relative;
}
.widget-body iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ─── FAQ SECTION ─── */
.faq-section {
  padding: 3.5rem 1.5rem;
  background: var(--bg-page);
}
.faq-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.faq-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.faq-card {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--text-primary);
  transition: all .2s;
}
.faq-card:hover {
  background: #eef3fa;
  border-color: var(--brother-blue);
  transform: translateY(-2px);
}
.faq-icon {
  font-size: 1.75rem;
  margin-bottom: .75rem;
}
.faq-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
}

/* ─── FOOTER ─── */
.footer { background: #1a1a2e; color: rgba(255,255,255,.75); }
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.footer-top {
  padding: 3rem 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-top .footer-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}
.footer-col h4 {
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.footer-col a {
  display: block;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 3px 0;
  transition: color .15s;
}
.footer-col a:hover { color: #fff; }

.social-links {
  display: flex;
  gap: 12px;
}
.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
  transition: all .15s;
}
.social-links a:hover {
  background: var(--brother-blue);
  color: #fff;
}

.footer-bottom {
  padding: 1.25rem 0;
}
.footer-bottom .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  font-size: 0.75rem;
}
.footer-legal {
  display: flex;
  gap: 1.25rem;
}
.footer-legal a {
  color: rgba(255,255,255,.5);
  text-decoration: none;
}
.footer-legal a:hover { color: #fff; }
.demo-notice {
  color: rgba(255,255,255,.35);
  font-size: 0.72rem;
}
.demo-notice a { color: rgba(255,255,255,.5); text-decoration: none; }
.demo-notice a:hover { color: #fff; }

/* ─── YUMI INTRO (inline chatbot section) ─── */
.chatbot-intro-top {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
}
.yumi-intro {
  width: 120px;
  height: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.1));
}
.yumi-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}
.widget-avatar {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ─── FLOATING YUMI TRIGGER (like Brother HK "Talk to Brother") ─── */
.yumi-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: flex-end;
  gap: 0;
  cursor: pointer;
  z-index: 1100;
  transition: transform .2s;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.2));
}
.yumi-fab:hover { transform: scale(1.05); }
.yumi-fab-img {
  width: 90px;
  height: auto;
  transition: transform .2s;
}
.yumi-fab-label {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  text-align: center;
  background: var(--brother-blue);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

/* ─── SLIDE-IN CHAT PANEL ─── */
.chat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.chat-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.chat-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  right: -420px;
  width: 400px;
  max-width: 100vw;
  background: #fff;
  z-index: 1300;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 30px rgba(0,0,0,.15);
  transition: right .35s cubic-bezier(.4, 0, .2, 1);
}
.chat-panel.open { right: 0; }

.chat-panel-header {
  background: var(--brother-blue);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chat-panel-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.panel-yumi {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 2px solid rgba(255,255,255,.3);
}
.panel-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.panel-subtitle {
  font-size: 0.78rem;
  color: rgba(255,255,255,.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-panel-close {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
}
.chat-panel-close:hover { background: rgba(255,255,255,.3); }

.chat-panel-body {
  flex: 1;
  position: relative;
}
.chat-panel-body iframe {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ─── BODY LOCKS ─── */
body.widget-expanded,
body.panel-open { overflow: hidden; }

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 900px) {
  .cat-grid, .faq-grid { grid-template-columns: repeat(2, 1fr); }
  .chatbot-inner { grid-template-columns: 1fr; }
  .chatbot-widget { height: 500px; }
  .footer-top .footer-inner { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .topbar { display: none; }

  .mobile-toggle { display: flex; }

  .nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--brother-blue-dark);
    flex-direction: column;
    padding: .5rem 0;
    box-shadow: var(--shadow-lg);
  }
  .nav.open { display: flex; }
  .nav-link {
    height: 44px;
    padding: 0 1.5rem;
    border-bottom: none;
    border-left: 3px solid transparent;
  }
  .nav-link:hover, .nav-link.active {
    border-bottom: none;
    border-left-color: #fff;
  }

  .hero { padding: 2.5rem 1.25rem; }
  .hero h1 { font-size: 1.5rem; }

  .cat-grid, .faq-grid { grid-template-columns: 1fr; }

  .chatbot-widget { height: 450px; }

  .yumi-intro { width: 80px; }
  
  .yumi-fab {
    bottom: 1rem;
    right: 1rem;
  }
  .yumi-fab-img { width: 70px; }
  .yumi-fab-label {
    font-size: 0.5rem;
    padding: 3px 4px;
    letter-spacing: 0.02em;
  }

  .chat-panel { width: 100vw; right: -100vw; }
  .chat-panel-header { padding: 0.75rem 1rem; }
  .panel-yumi { width: 40px; height: 40px; }
  
  .chat-panel-body iframe {
    bottom: 30px;
    height: calc(100% - 30px);
  }
  
  .footer-top .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom .footer-inner { flex-direction: column; text-align: center; }
}

