/* ═══════════════════════════════════════════════════════════════
   CODQI — Storefront UI layer (feel-good polish, all public pages)
   Load after app.css + customer-experience.css
   ═══════════════════════════════════════════════════════════════ */

:root {
  --sf-font: 'Inter', system-ui, -apple-system, sans-serif;
  --sf-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sf-shadow-sm: 0 2px 8px rgba(10, 8, 32, 0.04);
  --sf-shadow-md: 0 12px 40px rgba(108, 39, 232, 0.1);
  --sf-shadow-lg: 0 24px 64px rgba(108, 39, 232, 0.14);
  --sf-surface: rgba(255, 255, 255, 0.88);
  --sf-border-soft: rgba(108, 39, 232, 0.08);
  --sf-content-pad: clamp(20px, 4vw, 32px);
}

/* ── Ambient page background ── */
body.cx-storefront {
  font-family: var(--sf-font);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -30%, rgba(108, 39, 232, 0.07), transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 20%, rgba(6, 182, 212, 0.04), transparent 50%),
    radial-gradient(ellipse 50% 40% at 0% 80%, rgba(168, 85, 247, 0.05), transparent 45%);
  background-attachment: fixed;
}

body.cx-storefront main {
  min-height: calc(100vh - var(--nav-h, 57px) - 120px);
}

/* ── Sticky glass header ── */
.cx-storefront .site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--sf-surface);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--sf-border-soft);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, var(--sf-shadow-sm);
  transition: box-shadow 0.3s var(--sf-ease);
}

.cx-storefront .site-header .logo-text {
  letter-spacing: -0.03em;
}

.cx-storefront .nav-link {
  border-radius: 10px;
  padding: 8px 12px;
  transition: color 0.2s var(--sf-ease), background 0.2s var(--sf-ease);
}

.cx-storefront .nav-link:hover {
  background: rgba(108, 39, 232, 0.06);
  color: var(--primary);
}

/* ── Announcement bar ── */
.cx-storefront .hp-topbar {
  background: linear-gradient(90deg, #120a28 0%, #1a1040 50%, #120a28 100%);
}

/* ── Buttons & CTAs ── */
.cx-storefront .btn-primary {
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.25s var(--sf-ease), box-shadow 0.25s var(--sf-ease);
}

.cx-storefront .btn-outline {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--sf-ease);
}

.cx-storefront .btn-outline:hover {
  background: #fff;
  border-color: rgba(108, 39, 232, 0.35);
  transform: translateY(-1px);
}

/* ── Flash messages (toast-like) ── */
.cx-storefront .flash {
  position: sticky;
  top: var(--nav-h, 57px);
  z-index: 150;
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  box-shadow: 0 8px 24px rgba(10, 8, 32, 0.08);
  animation: sf-flash-in 0.4s var(--sf-ease);
}

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

/* ── Inner heroes (about, contact, legal, checkout gate) ── */
.cx-storefront .inner-hero {
  padding: clamp(28px, 5.5vw, 42px) 0 clamp(24px, 4.5vw, 34px);
  border-bottom-color: var(--sf-border-soft);
}

.cx-storefront .inner-hero::before {
  background:
    radial-gradient(ellipse 80% 70% at 50% -25%, var(--inner-accent-soft, rgba(108, 39, 232, 0.1)) 0%, transparent 62%),
    radial-gradient(circle at 12% 88%, rgba(108, 39, 232, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 88% 72%, rgba(168, 85, 247, 0.05) 0%, transparent 38%);
}

.cx-storefront .inner-hero-tag {
  box-shadow: 0 2px 12px rgba(108, 39, 232, 0.08);
}

.cx-storefront .inner-hero h1 {
  letter-spacing: -0.04em;
  line-height: 1.1;
}

/* Products / blog listing heroes */
.cx-storefront .products-inner-hero,
.cx-storefront .blog-inner-hero {
  padding: clamp(28px, 5.5vw, 42px) 0 clamp(24px, 4.5vw, 34px);
}

.cx-storefront .products-inner-hero::before,
.cx-storefront .blog-inner-hero::before {
  opacity: 1;
}

/* ── Page sections & content shells ── */
.cx-storefront .page-section {
  padding-top: clamp(28px, 6vw, 48px);
  padding-bottom: clamp(56px, 12vw, 100px);
}

.cx-storefront .page-header h1 {
  letter-spacing: -0.03em;
}

.cx-storefront main > .static-page {
  background: #fff;
  border: 1px solid var(--sf-border-soft);
  border-radius: var(--radius-xl, 24px);
  padding: clamp(28px, 6vw, 48px) clamp(22px, 5vw, 40px);
  margin: clamp(32px, 6vw, 48px) auto clamp(56px, 10vw, 88px);
  box-shadow: var(--sf-shadow-sm);
  max-width: 860px;
}

.cx-storefront .page-section .static-page,
.cx-storefront .legal-prose {
  background: #fff;
  border: 1px solid var(--sf-border-soft);
  border-radius: var(--radius-xl, 24px);
  padding: clamp(28px, 6vw, 48px) clamp(22px, 5vw, 40px);
  margin: -20px auto 0;
  position: relative;
  z-index: 2;
  box-shadow: var(--sf-shadow-sm);
  max-width: 860px;
}

/* FAQ */
.cx-storefront .faq-item {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--sf-shadow-sm);
  transition: border-color 0.2s, box-shadow 0.25s var(--sf-ease), transform 0.2s var(--sf-ease);
}

.cx-storefront .faq-item:hover {
  box-shadow: var(--sf-shadow-md);
  transform: translateY(-1px);
}

.cx-storefront .faq-item[open],
.cx-storefront .faq-item.is-open {
  border-color: rgba(108, 39, 232, 0.25);
}

/* ── Product cards ── */
.cx-storefront .product-card {
  background: #fff;
  border: 1px solid var(--sf-border-soft);
  border-radius: var(--radius-lg, 18px);
  overflow: hidden;
  box-shadow: var(--sf-shadow-sm);
  transition: transform 0.3s var(--sf-ease), box-shadow 0.3s var(--sf-ease), border-color 0.2s;
}

.cx-storefront .product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sf-shadow-lg);
  border-color: rgba(108, 39, 232, 0.18);
}

.cx-storefront .product-thumb {
  background: linear-gradient(145deg, var(--bg2) 0%, #fff 100%);
}

/* ── Blog cards ── */
.cx-storefront .blog-card {
  border-radius: var(--radius-lg, 18px);
  border: 1px solid var(--sf-border-soft);
  box-shadow: var(--sf-shadow-sm);
  transition: transform 0.3s var(--sf-ease), box-shadow 0.3s var(--sf-ease);
}

.cx-storefront .blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sf-shadow-md);
}

/* ── Forms ── */
.cx-storefront .form-control {
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cx-storefront .form-control:focus {
  border-color: rgba(108, 39, 232, 0.45);
  box-shadow: 0 0 0 4px rgba(108, 39, 232, 0.1);
  outline: none;
}

.cx-storefront .form-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  letter-spacing: 0.01em;
}

/* ── Checkout & cart ── */
.cx-storefront .cart-item,
.cx-storefront .checkout-step,
.cx-storefront .order-summary {
  background: #fff;
  border: 1px solid var(--sf-border-soft);
  border-radius: var(--radius-lg, 18px);
  box-shadow: var(--sf-shadow-sm);
}

.cx-storefront .checkout-progress {
  gap: 8px;
}

/* ── Footer ── */
.cx-storefront .site-footer {
  background: linear-gradient(180deg, var(--bg2) 0%, #ede9ff 100%);
  margin-top: clamp(32px, 8vw, 64px);
}

.cx-storefront .footer-cta {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(237, 233, 255, 0.9) 100%);
  box-shadow: var(--sf-shadow-md);
  border: 1px solid rgba(108, 39, 232, 0.12);
}

.cx-storefront .footer-cta-text h3 {
  font-size: clamp(18px, 3vw, 22px);
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cx-storefront .payment-logos span {
  border-radius: 10px;
  transition: transform 0.2s var(--sf-ease);
}

.cx-storefront .payment-logos span:hover {
  transform: translateY(-2px);
}

/* ── Homepage (mk-* refinements) ── */
.page-home .mk-hero--v3,
.page-home .mk-hero--polish,
.page-home .mk-hero--clean {
  margin-top: 0;
}

.page-home .mk-path {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}

.page-home .mk-trust-strip {
  border-top: 1px solid var(--sf-border-soft);
  border-bottom: 1px solid var(--sf-border-soft);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
}

.page-home .mk-section {
  scroll-margin-top: calc(var(--nav-h, 57px) + 16px);
}

.page-home .mk-product-card,
.page-home .mk-svc-card {
  border-radius: 18px;
  box-shadow: var(--sf-shadow-sm);
  transition: transform 0.3s var(--sf-ease), box-shadow 0.3s var(--sf-ease);
}

.page-home .mk-product-card:hover,
.page-home .mk-svc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sf-shadow-lg);
}

/* ── Auth pages (auth layout + split) ── */
body.sf-auth {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 100% 80% at 0% 50%, rgba(108, 39, 232, 0.08), transparent 55%),
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(168, 85, 247, 0.06), transparent 50%);
  min-height: 100vh;
}

body.sf-auth .auth-panel {
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.06);
}

body.sf-auth .auth-card {
  border-radius: 20px;
  border: 1px solid var(--sf-border-soft);
  box-shadow: var(--sf-shadow-lg);
}

body.sf-auth .form-control:focus {
  border-color: rgba(108, 39, 232, 0.45);
  box-shadow: 0 0 0 4px rgba(108, 39, 232, 0.1);
}

/* ── Customer dashboard ── */
body.sf-dashboard {
  font-family: var(--sf-font);
  -webkit-font-smoothing: antialiased;
}

body.sf-dashboard .dashboard-layout {
  background: linear-gradient(135deg, #f4f2fc 0%, #faf8ff 50%, #f0ecff 100%);
}

body.sf-dashboard .dash-sidebar {
  border-right-color: rgba(108, 39, 232, 0.08);
  box-shadow: 4px 0 32px rgba(108, 39, 232, 0.06);
}

body.sf-dashboard .cust-stat,
body.sf-dashboard .cust-card,
body.sf-dashboard .cust-table-wrap {
  border-radius: 16px;
  border: 1px solid var(--sf-border-soft);
  box-shadow: var(--sf-shadow-sm);
  transition: box-shadow 0.25s var(--sf-ease);
}

body.sf-dashboard .cust-stat:hover {
  box-shadow: var(--sf-shadow-md);
}

body.sf-dashboard .dash-page-header h1 {
  letter-spacing: -0.03em;
}

/* ── Standalone 404 ── */
body.sf-error-page {
  font-family: var(--sf-font);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(108, 39, 232, 0.1), transparent 55%);
}

.sf-error-wrap {
  max-width: 440px;
  padding: 40px 32px;
  background: #fff;
  border-radius: 24px;
  border: 1px solid var(--sf-border-soft);
  box-shadow: var(--sf-shadow-lg);
}

.sf-error-code {
  font-size: clamp(72px, 18vw, 96px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -4px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.sf-error-wrap h2 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.sf-error-wrap p {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 28px;
  line-height: 1.6;
}

.sf-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.sf-error-actions a {
  text-decoration: none;
}

.sf-error-actions .btn-outline {
  color: var(--text-muted);
}

/* Contact / two-column grids */
.cx-storefront .contact-form-card,
.cx-storefront .contact-grid .contact-card,
.cx-storefront .info-card {
  background: #fff;
  border: 1px solid var(--sf-border-soft);
  border-radius: var(--radius-lg, 18px);
  box-shadow: var(--sf-shadow-sm);
}

/* Services page cards */
.cx-storefront .service-card,
.cx-storefront .bundle-card {
  border-radius: 18px;
  border: 1px solid var(--sf-border-soft);
  box-shadow: var(--sf-shadow-sm);
  transition: transform 0.3s var(--sf-ease), box-shadow 0.3s var(--sf-ease);
}

.cx-storefront .service-card:hover,
.cx-storefront .bundle-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sf-shadow-md);
}

/* Selection color */
.cx-storefront ::selection,
body.sf-auth ::selection,
body.sf-dashboard ::selection {
  background: rgba(108, 39, 232, 0.2);
  color: var(--text);
}

/* ── Keyboard focus — WCAG 2.2 AA ── */
.cx-storefront :focus-visible {
  outline: 2px solid var(--primary, #6c27e8);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Inputs use ring instead of outline for better appearance */
.cx-storefront input:focus-visible,
.cx-storefront select:focus-visible,
.cx-storefront textarea:focus-visible {
  outline: none;
  border-color: rgba(108, 39, 232, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(108, 39, 232, 0.12) !important;
}
/* Buttons that already show ring via border-color — keep outline visible */
.cx-storefront .btn-primary:focus-visible {
  outline: 2px solid rgba(108, 39, 232, 0.7);
  outline-offset: 3px;
}
/* Nav + cart + hero path links */
.cx-storefront .nav-link:focus-visible,
.cx-storefront .cart-btn:focus-visible,
.cx-storefront .mobile-toggle:focus-visible,
.cx-storefront .mk-hero-clean__path:focus-visible {
  outline: 2px solid var(--primary, #6c27e8);
  outline-offset: 3px;
  border-radius: 10px;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .cx-storefront .product-card:hover,
  .cx-storefront .blog-card:hover,
  .page-home .mk-product-card:hover,
  .cx-storefront .service-card:hover,
  .cx-storefront .bundle-card:hover,
  .cx-storefront .faq-item:hover {
    transform: none;
  }
  /* Stop all decorative keyframe animations */
  .cx-storefront [class*="orb"],
  .cx-storefront .mk-svc-teaser-orb,
  .cx-storefront .hero-glow,
  .mk-hero-float {
    animation: none !important;
  }
  /* Keep transitions for opacity/color but skip motion */
  .cx-storefront * {
    transition-property: color, background-color, border-color, box-shadow, opacity !important;
    transition-duration: 0.15s !important;
  }
}

  /* === Mobile: drop glass blur on header so the fixed nav drawer is not trapped (appended) === */
  @media (max-width: 768px) {
    .cx-storefront .site-header {
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      background: #fff;
    }
    .cx-storefront .site-nav-root.nav-menu-active .site-header,
    .cx-storefront .site-header.nav-open {
      z-index: 1100;
    }
  }
  