/* ============================================
   FlowStash — Layout
   Container · Grid · Navigation · Footer
   Cinematic spacing · Icon-only mobile nav
   ============================================ */

/* ── Container ── */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--sm {
  max-width: var(--container-sm);
}

.container--md {
  max-width: var(--container-md);
}

.container--lg {
  max-width: var(--container-lg);
}

/* ── Page ── */
.page {
  min-height: 100vh;
  padding-top: calc(var(--nav-height) + var(--space-12));
  padding-bottom: var(--space-20);
}

/* ── Section ── */
.section {
  padding: var(--space-24) 0;
}

.section--hero {
  padding: var(--space-32) 0 var(--space-20);
}

/* ── Grid ── */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid--products {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

@media (max-width: 1024px) {
  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }
  .grid--products {
    grid-template-columns: 1fr;
  }
}

/* ── Flex Utilities ── */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ════════════════════════════════════════════
   NAVIGATION — Floating Minimal Capsule
   Desktop: centered, icon + text, translucent
   Mobile: fixed bottom bar, ICONS ONLY
   ════════════════════════════════════════════ */

.nav {
  position: fixed;
  top: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 6px 12px;
  background: rgba(12, 12, 16, 0.65);
  backdrop-filter: blur(32px) saturate(1.2);
  -webkit-backdrop-filter: blur(32px) saturate(1.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg), var(--shadow-inset);
  transition: width var(--duration-normal) var(--ease-cinematic), padding var(--duration-normal);
}

/* ── Buy / Earn Switcher ── */
.nav-switch {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.nav-switch__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 6px 14px;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--text-muted);
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: all var(--duration-fast) var(--ease-default);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  line-height: 1;
}

.nav-switch__btn svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
  opacity: 0.7;
  transition: opacity var(--duration-fast) var(--ease-default);
  flex-shrink: 0;
}

.nav-switch__btn:hover svg,
.nav-switch__btn--active svg {
  opacity: 1;
}

.nav-switch__btn:hover {
  color: var(--text-secondary);
}

.nav-switch__btn--active {
  background: var(--text-primary);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-3);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-tight);
  margin-right: var(--space-1);
}

.nav__logo-icon {
  width: 22px;
  height: 22px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav__logo-icon svg {
  width: 13px;
  height: 13px;
  color: var(--text-inverse);
}

.nav__link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-full);
  transition: all var(--duration-fast) var(--ease-default);
  white-space: nowrap;
  height: 32px; /* Fixed height for alignment */
}

.nav__link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav__link--active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.nav__link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav__link:hover svg,
.nav__link--active svg {
  opacity: 1;
}


.nav__link-text {
  transition: opacity var(--duration-normal);
}

.nav__cta {
  margin-left: var(--space-2);
}

/* Submit button specific style in Nav Capsule */
.nav__link.btn--secondary {
  border: 1px solid var(--border-default);
  padding: 0 var(--space-4); /* Consistent with nav links */
  background: rgba(255, 255, 255, 0.05);
  height: 32px;
  font-size: var(--text-xs);
  display: inline-flex;
}

.nav__link.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
}

/* ═══════════════════════════════════════════
   MOBILE NAVIGATION — Floating Pill
   ═══════════════════════════════════════════ */

.nav-mobile {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  padding: 8px 16px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(12, 12, 16, 0.85);
  backdrop-filter: blur(32px) saturate(1.2);
  -webkit-backdrop-filter: blur(32px) saturate(1.2);
  border-top: 1px solid var(--border-subtle);
}

.nav-mobile__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 400px;
  margin: 0 auto;
}

.nav-mobile__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: var(--weight-medium);
  transition: all var(--duration-fast) var(--ease-default);
  border-radius: var(--radius-lg);
  flex: 1;
}

.nav-mobile__link:hover,
.nav-mobile__link--active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-mobile__link svg {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.nav-mobile__link:hover svg,
.nav-mobile__link--active svg {
  opacity: 1;
}

/* Hide text on smaller screens if too crowded, but default to showing it */
@media (max-width: 350px) {
  .nav-mobile__link {
    font-size: 0;
    gap: 0;
  }
}

/* ════════════════════════════════════════════
   MOBILE TOP BAR — Logo + Mode Switcher
   ════════════════════════════════════════════ */
.nav-top-mobile {
  display: none !important;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(5, 5, 7, 0.85);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-bottom: 1px solid var(--border-subtle);
  z-index: var(--z-nav);
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
}

.nav-top-mobile .nav__logo {
  padding: 0;
  margin: 0;
}

.nav-top-mobile .nav__logo-icon {
  width: 28px;
  height: 28px;
}

.nav-top-mobile .nav-switch__btn {
  padding: 8px 12px;
}

.nav-top-mobile .nav-switch__btn svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 768px) {
  .nav#nav-desktop {
    display: none !important;
  }

  .nav-top-mobile {
    display: flex !important;
    height: 64px; /* Increased height for better proportions */
  }

  .nav-mobile {
    display: block !important;
  }

  .container {
    padding: 0 var(--space-4);
  }

  .page {
    padding-top: calc(64px + var(--space-10)); /* Adjusted for new header height */
    padding-bottom: calc(var(--nav-height-mobile) + var(--space-10));
  }
}

/* ════════════════════════════════════════════
   FOOTER — Minimal, typographic
   ════════════════════════════════════════════ */

.footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-16) 0 var(--space-10);
  margin-top: var(--space-24);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-12);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 280px;
}

.footer__brand-name {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: var(--tracking-tight);
}

.footer__brand-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
}

.footer__links {
  display: flex;
  gap: var(--space-16);
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer__col-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  margin-bottom: var(--space-1);
}

.footer__col a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: color var(--duration-fast) var(--ease-default);
}

.footer__col a:hover {
  color: var(--text-primary);
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
  color: var(--text-ghost);
  letter-spacing: var(--tracking-wide);
}

@media (max-width: 768px) {
  .footer__inner {
    flex-direction: column;
  }

  .footer__links {
    flex-direction: column;
    gap: var(--space-8);
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-3);
    text-align: center;
  }
}
