/* ============================================================
   SolutionMall — Shared Framework CSS (Dark Theme)
   Applies to: index.html + all solution pages
   Version: 2.1
   ============================================================ */

/* ── CSS Variables ── */
:root {
  --sm-bg-dark:      #060d1f;
  --sm-bg-card:      #0d1a35;
  --sm-bg-surface:   #111d38;
  --sm-blue-600:     #2563eb;
  --sm-blue-500:     #3b82f6;
  --sm-blue-400:     #60a5fa;
  --sm-blue-300:     #93c5fd;
  --sm-cyan:         #06b6d4;
  --sm-accent:       #f59e0b;
  --sm-text-primary: #f0f4ff;
  --sm-text-muted:   #8fa3bf;
  --sm-border:       rgba(255,255,255,0.08);
  --sm-header-h:     72px;
  --sm-font:         'Inter', system-ui, -apple-system, sans-serif;
  --sm-radius:       10px;
  --sm-shadow:       0 4px 24px rgba(0,0,0,0.4);
  --sm-transition:   240ms ease;
  --container:       1280px;
}

/* ── Shared reset ── */
.sm-header *, .sm-footer * {
  box-sizing: border-box;
}

/* ── Body offset for fixed header ── */
body {
  padding-top: var(--sm-header-h) !important;
}

/* ============================================================
   HEADER — Pill / Floating style (dark)
   ============================================================ */
.sm-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  padding: 12px 24px;
  transition: padding var(--sm-transition);
}

.sm-header.scrolled {
  padding: 8px 24px;
}

.sm-header-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  max-width: var(--container);
  margin: 0 auto;
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(6, 13, 31, 0.72);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  transition: all var(--sm-transition);
}

.sm-header.scrolled .sm-header-bar {
  background: rgba(6, 13, 31, 0.95);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* ── Brand / Logo ── */
.sm-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.sm-brand img {
  height: 30px !important;
  width: auto !important;
  max-width: 160px !important;
  display: block !important;
  object-fit: contain !important;
}

/* ── Navigation ── */
.sm-nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: hidden;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.sm-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--sm-transition), background var(--sm-transition);
}

.sm-nav-link:hover,
.sm-nav-link.active {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

/* ── Header Tools (right side) ── */
.sm-header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Partner CRM Button ── */
.sm-btn-crm {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sm-blue-300);
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(96,165,250,0.25);
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--sm-transition);
}

.sm-btn-crm:hover {
  color: #fff;
  background: rgba(59,130,246,0.22);
  border-color: rgba(96,165,250,0.5);
}

/* ── Browse Products Button ── */
.sm-btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--sm-blue-500), var(--sm-cyan));
  border: none;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(59,130,246,0.3);
  transition: all var(--sm-transition);
  cursor: pointer;
}

.sm-btn-primary:hover {
  box-shadow: 0 6px 22px rgba(59,130,246,0.45);
  transform: translateY(-1px);
}

/* ── Language Switcher ── */
.sm-lang-wrap {
  position: relative;
}

.sm-lang-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--sm-transition);
  font-family: var(--sm-font);
}

.sm-lang-button:hover {
  color: #fff;
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.22);
}

.sm-lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 150px;
  padding: 8px;
  border-radius: 16px;
  background: #0d1a35;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  list-style: none;
  margin: 0;
  display: none;
  z-index: 9999;
  animation: smMenuIn 0.15s ease;
}

/* Support both .open class and data-open="true" */
.sm-lang-wrap.open .sm-lang-menu,
.sm-lang-wrap[data-open="true"] .sm-lang-menu {
  display: block;
}

@keyframes smMenuIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sm-lang-option {
  display: block;
  width: 100%;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  transition: all var(--sm-transition);
  border: none;
  background: transparent;
  text-align: left;
  font-family: var(--sm-font);
  list-style: none;
}

.sm-lang-option:hover {
  color: #fff;
  background: rgba(59,130,246,0.15);
}

.sm-lang-option.active,
.sm-lang-option[data-active="true"] {
  color: var(--sm-blue-300);
  background: rgba(59,130,246,0.12);
  font-weight: 700;
}

/* ── Mobile Toggle ── */
.sm-mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  cursor: pointer;
  padding: 8px;
}

.sm-mobile-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.7);
  border-radius: 2px;
  transition: all var(--sm-transition);
}

/* ============================================================
   FOOTER — Dark theme
   ============================================================ */
.sm-footer {
  background: #040b1a;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 28px 0;
}

.sm-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.sm-footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sm-footer-brand img {
  height: 26px;
  width: auto;
  display: block;
  object-fit: contain;
  opacity: 0.8;
  transition: opacity var(--sm-transition);
}

.sm-footer-brand img:hover {
  opacity: 1;
}

.sm-footer-site {
  font-size: 0.78rem;
  color: var(--sm-text-muted);
  text-decoration: none;
  transition: color var(--sm-transition);
}

.sm-footer-site:hover {
  color: var(--sm-blue-300);
}

/* Social icons */
.sm-footer-socials {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sm-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--sm-text-muted);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  text-decoration: none;
  transition: all var(--sm-transition);
}

.sm-social-link:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  transform: translateY(-2px);
}

.sm-social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: block;
}

/* Copyright */
.sm-footer-copy {
  font-size: 0.76rem;
  color: var(--sm-text-muted);
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
#back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 40px;
  height: 40px;
  background: var(--sm-blue-500);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(59,130,246,0.4);
  transition: all var(--sm-transition);
  z-index: 999;
}

#back-to-top.visible {
  display: flex;
}

#back-to-top:hover {
  background: var(--sm-blue-600);
  transform: translateY(-2px);
}

#back-to-top svg {
  width: 18px;
  height: 18px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .sm-header-bar {
    grid-template-columns: auto auto;
    border-radius: 16px;
  }
  .sm-nav-links {
    display: none;
  }
  .sm-mobile-toggle {
    display: flex;
  }
}

@media (max-width: 640px) {
  .sm-header {
    padding: 8px 12px;
  }
  .sm-header-bar {
    padding: 8px 12px;
    gap: 10px;
  }
  .sm-btn-crm {
    display: none;
  }
  .sm-btn-primary {
    font-size: 0.72rem;
    padding: 7px 12px;
  }
  .sm-footer-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 0 16px;
  }
  .sm-footer-brand {
    flex-direction: column;
    gap: 8px;
  }
  .sm-footer-copy {
    text-align: center;
  }
}
