/* ==========================================================================
   Stacknivo Stylesheet
   ========================================================================== */

/* Design Tokens & Variables */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #0f172a;
  --secondary-hover: #1e293b;
  --background: #ffffff;
  --bg-offset: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-focus: #94a3b8;
  --success-bg: #dcfce7;
  --success-text: #15803d;
  --warning-bg: #fef3c7;
  --warning-text: #b45309;

  /* Fonts */
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles & Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: var(--background);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex-grow: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--secondary);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: 2.75rem;
}

h2 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

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

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.section {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.section-alt {
  background-color: var(--bg-offset);
}

.text-center {
  text-align: center;
}

.max-w-md {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

.max-w-sm {
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

/* Flexbox & Grids */
.flex {
  display: flex;
}

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

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

.grid {
  display: grid;
  gap: 2rem;
}

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

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

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--background);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: var(--background);
}

.btn-secondary {
  background-color: var(--background);
  color: var(--secondary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background-color: var(--bg-offset);
  border-color: var(--border-focus);
}

.btn-group {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.badge-blue {
  background-color: #dbeafe;
  color: #1e40af;
}

.badge-gray {
  background-color: var(--border);
  color: var(--secondary);
}

.badge-success {
  background-color: var(--success-bg);
  color: var(--success-text);
}

.badge-coming {
  background-color: var(--bg-offset);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Cards */
.card {
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-focus);
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-offset);
  color: var(--primary);
  margin-bottom: 1.25rem;
}

/* Header & Navigation */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  padding: 1rem 0;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--secondary);
  text-decoration: none;
}

.logo-icon {
  width: 1.75rem;
  height: 1.75rem;
  background-color: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 900;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--secondary);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 1.5rem;
  height: 2px;
  background-color: var(--secondary);
  margin: 5px 0;
  transition: var(--transition);
}

/* Footer */
.footer {
  background-color: var(--secondary);
  color: #94a3b8;
  padding-top: 4rem;
  padding-bottom: 3rem;
  border-top: 1px solid #1e293b;
}

.footer h4 {
  color: var(--background);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

.footer-logo {
  color: var(--background);
  font-weight: 800;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-logo .logo-icon {
  background-color: var(--primary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: #94a3b8;
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--background);
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.footer-legal a {
  color: #94a3b8;
  margin-left: 1.5rem;
}

.footer-legal a:hover {
  color: var(--background);
}

/* Home Hero Section */
.hero {
  padding: 7rem 0 5rem;
  text-align: center;
  background: radial-gradient(circle at top, #eff6ff 0%, #ffffff 60%);
}

.hero h1 {
  font-size: 3.5rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.25rem;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2.5rem;
}

.hero-buttons {
  justify-content: center;
  margin-bottom: 4rem;
}

.trust-indicators {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2.5rem;
  border-top: 1px solid var(--border);
  padding-top: 2.5rem;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.trust-item svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--primary);
}

/* Featured Shopify App Section */
.featured-product {
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.featured-img-container {
  background-color: var(--bg-offset);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  border-right: 1px solid var(--border);
}

.featured-app-mockup {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.mockup-header {
  background-color: var(--bg-offset);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mockup-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #cbd5e1;
}

.mockup-body {
  padding: 1.5rem;
}

.shipping-bar-preview {
  background-color: var(--bg-offset);
  border: 1px dashed var(--primary);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 1rem;
}

.shipping-progress {
  height: 8px;
  background-color: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.shipping-progress-bar {
  width: 75%;
  height: 100%;
  background-color: var(--primary);
}

.featured-content {
  padding: 3.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Why Choose Section */
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem;
}

.why-item {
  display: flex;
  gap: 1.25rem;
}

.why-icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  background-color: #eff6ff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.why-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* CTA Banner Section */
.cta-banner {
  background-color: var(--secondary);
  color: var(--background);
  border-radius: var(--radius-lg);
  padding: 4rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.cta-banner h2 {
  color: var(--background);
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

.cta-banner p {
  color: #94a3b8;
  font-size: 1.1rem;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
}

/* Products Page styles */
.product-card {
  display: grid;
  grid-template-columns: 1fr 2.5fr;
  gap: 2.5rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  align-items: center;
}

.product-logo-box {
  background-color: var(--bg-offset);
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.product-logo-box svg {
  width: 3.5rem;
  height: 3.5rem;
  color: var(--primary);
}

.product-features-list {
  list-style: none;
  margin: 1.25rem 0 1.75rem;
}

.product-features-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.product-features-list svg {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--primary);
  flex-shrink: 0;
}

/* Blog Cards */
.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.blog-title {
  font-size: 1.25rem;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.blog-card p {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.blog-footer-link {
  font-weight: 500;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.blog-footer-link svg {
  width: 1rem;
  height: 1rem;
  transition: var(--transition);
}

.blog-footer-link:hover svg {
  transform: translateX(3px);
}

/* Contact Grid & Form */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem;
  align-items: start;
}

.contact-info h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.contact-email-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-offset);
  margin-top: 1.5rem;
}

.contact-email-card svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--primary);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--secondary);
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.form-success-message {
  display: none;
  background-color: var(--success-bg);
  color: var(--success-text);
  padding: 1rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  border: 1px solid #bbf7d0;
}

/* Legal Pages (Privacy/Terms) Layout */
.legal-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 4rem;
  align-items: start;
}

.legal-sidebar {
  position: sticky;
  top: 6rem;
}

.legal-nav {
  list-style: none;
  border-left: 2px solid var(--border);
  padding-left: 1rem;
}

.legal-nav li {
  margin-bottom: 1rem;
}

.legal-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.legal-nav a:hover, .legal-nav a.active {
  color: var(--primary);
}

.legal-content {
  max-width: 68ch;
}

.legal-content section {
  margin-bottom: 3rem;
}

.legal-content h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.legal-content h3 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.legal-content ul, .legal-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

.legal-content li {
  margin-bottom: 0.5rem;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  h1 {
    font-size: 2.5rem;
  }
  .hero h1 {
    font-size: 3rem;
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }
  .footer-grid > div:first-child {
    grid-column: span 2;
    margin-bottom: 1rem;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.25rem;
  }
  h2 {
    font-size: 1.75rem;
  }
  .section {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }
  
  /* Header Mobile Nav */
  .nav-toggle {
    display: block;
  }
  
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--background);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
  }
  
  .nav-menu.open {
    max-height: 300px;
    box-shadow: var(--shadow-md);
  }
  
  .nav-list {
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
  }
  
  .header .btn-primary {
    display: none; /* Hide header CTA button on small screen, inside menu is fine or just clean navigation */
  }

  /* Grid Layouts */
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .hero {
    padding: 4.5rem 0 3rem;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
  
  .btn-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .featured-product {
    grid-template-columns: 1fr;
  }
  
  .featured-img-container {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 2rem;
  }
  
  .featured-content {
    padding: 2rem;
  }
  
  .why-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .cta-banner {
    padding: 2.5rem 1.5rem;
  }
  
  .product-card {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 1.5rem;
  }
  
  .product-logo-box {
    width: 5rem;
    height: 5rem;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  
  .legal-sidebar {
    position: static;
  }
  
  .legal-nav {
    display: flex;
    flex-wrap: wrap;
    border-left: none;
    border-bottom: 1px solid var(--border);
    padding-left: 0;
    padding-bottom: 0.75rem;
    gap: 1rem;
  }
  
  .legal-nav li {
    margin-bottom: 0;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .footer-legal a {
    margin: 0 0.75rem;
  }
}
