:root {
  --surface: #ffffff;
  --muted: #5f6f82;
  --line: #dce5f0;
}

*,
*::before,
*::after {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #1f2937;
  background: #f5f5f5;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  overflow-x: hidden;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  width: 2.5rem;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  color: #334155;
  transition: all 0.2s ease;
  background: #fff;
}

.icon-button:hover {
  border-color: #d9eeff;
  background: #eef8ff;
  color: #09529a;
}

.section-card {
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(17, 34, 54, 0.08);
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #334155;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border-radius: 0.75rem;
  padding: 0.25rem 0;
  color: #64748b;
  transition: all 0.2s ease;
}

.tab-item-active {
  background: #eef8ff;
  color: #09529a;
}

.floating-help {
  position: fixed;
  right: 1rem;
  bottom: 6rem;
  z-index: 95;
  display: inline-flex;
  height: 3rem;
  width: 3rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9999px;
  background: #ff7a1f;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.floating-help:hover {
  filter: brightness(1.02);
}

.ai-assistant-panel {
  position: fixed;
  right: 1rem;
  bottom: 9.75rem;
  z-index: 95;
  width: min(92vw, 360px);
  max-height: calc(100vh - 11rem);
  display: flex;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.ai-assistant-panel.hidden {
  display: none;
}

.ai-assistant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(120deg, #ff7a1f, #ff5117);
  color: #fff;
  padding: 0.7rem 0.9rem;
}

.ai-assistant-title {
  font-size: 0.85rem;
  font-weight: 700;
}

.ai-assistant-close {
  border: 0;
  border-radius: 9999px;
  width: 1.9rem;
  height: 1.9rem;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1rem;
}

.ai-assistant-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.8rem;
  background: #f8fafc;
}

.ai-assistant-msg {
  margin-bottom: 0.55rem;
  max-width: 88%;
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  font-size: 0.82rem;
  line-height: 1.35;
  white-space: pre-wrap;
}

.ai-assistant-msg-user {
  margin-left: auto;
  background: #ffedd5;
  color: #9a3412;
}

.ai-assistant-msg-bot {
  margin-right: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.ai-assistant-form {
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid #e2e8f0;
  padding: 0.65rem;
  background: #fff;
}

.ai-assistant-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  border-top: 1px solid #e2e8f0;
  padding: 0.55rem 0.65rem 0.1rem;
  background: #fff;
}

.ai-assistant-chip {
  padding: 0.3rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.ai-assistant-cards {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.45rem;
}

.ai-assistant-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.5rem;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  color: #0f172a;
}

.ai-assistant-card-image {
  width: 72px;
  height: 72px;
  object-fit: cover;
}

.ai-assistant-card-body {
  padding: 0.25rem 0.5rem 0.25rem 0;
}

.ai-assistant-card-title {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.12rem;
}

.ai-assistant-card-subtitle {
  font-size: 0.68rem;
  color: #64748b;
  line-height: 1.25;
  margin-bottom: 0.15rem;
}

.ai-assistant-card-meta {
  font-size: 0.7rem;
  font-weight: 700;
  color: #ea580c;
}

/* Vendor mobile drawer: prevent active items from stretching to giant blocks. */
[data-vendor-nav-mobile] {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

[data-vendor-nav-mobile] .module-main,
[data-vendor-nav-mobile] .module-subtab,
[data-vendor-nav-mobile] > a {
  align-self: start;
  width: 100%;
  min-height: 40px;
  height: auto;
  flex: 0 0 auto;
}

body.vendor-menu-open #appBottomDock {
  display: none !important;
}

[data-vendor-nav] .module-main,
[data-vendor-nav-mobile] .module-main {
  min-height: 40px;
}

[data-vendor-nav] .module-main.is-active-module,
[data-vendor-nav-mobile] .module-main.is-active-module {
  min-height: 40px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.ai-assistant-input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  font-size: 0.84rem;
}

.ai-assistant-send {
  border: 0;
  border-radius: 10px;
  background: #ff7a1f;
  color: #fff;
  font-weight: 700;
  padding: 0 0.8rem;
}

@media (min-width: 1024px) {
  .floating-help {
    bottom: 1rem;
  }

  .ai-assistant-panel {
    bottom: 4.8rem;
  }
}

.product-strip {
  scrollbar-width: none;
}

.product-strip::-webkit-scrollbar {
  display: none;
}

.dashboard-shell {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.dashboard-topbar {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #d8d8d8;
  background: #f3f3f3;
  padding: 8px 10px;
}

.dashboard-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.25rem;
  width: 2.25rem;
  color: #1f2937;
}

.dashboard-badge {
  position: absolute;
  right: -3px;
  top: -2px;
  min-width: 15px;
  border-radius: 9999px;
  background: #ff4f18;
  padding: 0 4px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  line-height: 15px;
}

.top-right-group {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 2px;
}

.balance-tag {
  min-width: 40px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: #111827;
}

.dashboard-search {
  display: grid;
  grid-template-columns: 1fr 52px;
  overflow: hidden;
  border: 2px solid #d7d7d7;
  border-radius: 9999px;
  background: #fff;
}

.dashboard-search input {
  border: 0;
  padding: 12px 16px;
  font-size: 14px;
  color: #374151;
  outline: none;
  background: transparent;
}

.dashboard-search button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid #d8d8d8;
  background: #ff5a1f;
  color: #fff;
}

.hero-slider {
  overflow: hidden;
  border-radius: 20px;
  position: relative;
  margin: 0 auto;
  max-width: 100%;
}

.hero-track {
  display: flex;
  width: 100%;
  transition: transform 0.4s ease;
}

.hero-slide {
  width: 100%;
  min-width: 100%;
  flex: 0 0 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 2vw, 32px);
  min-height: 220px;
  padding: clamp(18px, 2vw, 36px);
}

@media (min-width: 1024px) {
  .home-desktop-sidebar {
    position: sticky;
    top: 96px;
    align-self: start;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
  }
}

.home-desktop-main {
  min-width: 0;
}

.hero-content {
  flex: 1 1 0;
  min-width: 0;
}

.hero-emoji {
  flex: 0 0 clamp(120px, 8vw, 180px);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  font-size: clamp(80px, 5vw, 180px);
  line-height: 1;
}

@media (max-width: 640px) {
  .hero-shell .hero-slide {
    min-height: 190px;
    padding: 18px 16px;
    gap: 10px;
    display: block;
  }

  .hero-shell .hero-content {
    width: 100%;
    max-width: 100%;
  }

  .hero-shell .hero-content h2 {
    font-size: 2rem !important;
    line-height: 1.05;
    word-break: break-word;
  }

  .hero-shell .hero-content p {
    font-size: 1.05rem !important;
    line-height: 1.25;
  }

  .hero-shell .hero-emoji {
    display: none;
  }
}

.hero-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  border: 1px solid #c7c7c7;
  background: #fff;
}

.hero-dot.is-active {
  background: #ff5a1f;
  border-color: #ff5a1f;
}

/* Homepage hero should fully occupy its container on desktop without empty bottom space. */
.hero-shell .hero-slider {
  border-radius: inherit;
}

.hero-shell .hero-track {
  align-items: stretch;
}

.hero-shell .hero-slide {
  min-height: clamp(260px, 32vw, 430px);
  padding: clamp(16px, 2.6vw, 40px);
}

.hero-shell .hero-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  margin-top: 0;
  z-index: 3;
}

.hero-shell .hero-slide.hero-slide-banner {
  display: block;
  min-height: 0;
  padding: 0;
}

.hero-shell .hero-slide.hero-slide-banner .hero-banner-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #feefd8;
}

@media (min-width: 640px) {
  .hero-shell .hero-slide.hero-slide-banner {
    min-height: clamp(260px, 32vw, 430px);
  }

  .hero-shell .hero-slide.hero-slide-banner .hero-banner-image {
    height: 100%;
    object-fit: cover;
  }
}

.hot-deals-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.hot-deals-card {
  min-width: 0;
}

.hot-deals-card img {
  height: 88px;
}

.hot-deals-card .line-clamp-2 {
  min-height: 26px;
  font-size: 10px;
}

@media (min-width: 640px) {
  .hot-deals-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }

  .hot-deals-card img {
    height: 128px;
  }

  .hot-deals-card .line-clamp-2 {
    min-height: 30px;
    font-size: 12px;
  }
}

@media (min-width: 1024px) {
  .hot-deals-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.category-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 3px solid #ff5a1f;
  border-radius: 9999px;
  color: #ff5a1f;
}

.category-label {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
  color: #1f2937;
}

.app-footer {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  border-top: 1px solid #dedede;
  background: #f3f3f3;
  padding: 8px;
}

.app-footer-item {
  padding: 7px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #374151;
}

/* App-like page change feel */
body {
  transition: background-color 0.18s ease;
}

main {
  transition: opacity 0.16s ease, transform 0.16s ease;
  will-change: opacity, transform;
}

body.app-nav-pending main {
  opacity: 0.92;
  transform: translateY(2px);
}

@media (prefers-reduced-motion: reduce) {
  main,
  body {
    transition: none !important;
  }
}
