/* ═══════════════════════════════════════════════════════════
   Janosci — Global UI Enhancement Layer v1
   Loaded last — subtle polish across all storefront pages.
   Brand: Navy #0A2540 · Royal #1769e8 · Gold #fbbf24
   ═══════════════════════════════════════════════════════════ */

:root {
  --je-royal: #1769e8;
  --je-royal-dark: #1155c7;
  --je-navy: #0a2540;
  --je-gold: #fbbf24;
  --je-surface: #ffffff;
  --je-bg: #f5f7fb;
  --je-border: #e4eaf2;
  --je-muted: #64748b;
  --je-radius: 16px;
  --je-radius-lg: 22px;
  --je-shadow-sm: 0 4px 14px -4px rgba(10, 37, 64, 0.1);
  --je-shadow-md: 0 14px 34px -14px rgba(10, 37, 64, 0.16);
  --je-shadow-lg: 0 24px 52px -18px rgba(10, 37, 64, 0.22);
  --je-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Ambient page background ── */
body.app-body {
  background:
    radial-gradient(ellipse 90% 50% at 0% -5%, rgba(23, 105, 232, 0.06), transparent 55%),
    radial-gradient(ellipse 70% 40% at 100% 5%, rgba(251, 191, 36, 0.05), transparent 50%),
    var(--je-bg) !important;
  scroll-behavior: smooth;
}

::selection {
  background: rgba(23, 105, 232, 0.18);
  color: var(--je-navy);
}

/* ── Refined scrollbar (desktop) ── */
@media (min-width: 768px) {
  html {
    scrollbar-width: thin;
    scrollbar-color: rgba(23, 105, 232, 0.35) transparent;
  }
  html::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  html::-webkit-scrollbar-track {
    background: transparent;
  }
  html::-webkit-scrollbar-thumb {
    background: rgba(23, 105, 232, 0.28);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
  }
  html::-webkit-scrollbar-thumb:hover {
    background: rgba(23, 105, 232, 0.45);
    background-clip: padding-box;
  }
}

/* ── Typography polish ── */
body.app-body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.02em;
}

/* ── Premium buttons ── */
body.app-body .btn-primary,
body.app-body .btn.btn-primary {
  background: linear-gradient(135deg, var(--je-royal) 0%, var(--je-royal-dark) 100%) !important;
  border: none !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  padding: 0.65rem 1.35rem !important;
  box-shadow: 0 6px 18px rgba(23, 105, 232, 0.32) !important;
  transition: transform 0.25s var(--je-ease), box-shadow 0.25s var(--je-ease), filter 0.2s ease !important;
}
body.app-body .btn-primary:hover,
body.app-body .btn.btn-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 28px rgba(23, 105, 232, 0.38) !important;
  filter: brightness(1.04) !important;
}
body.app-body .btn-primary:active {
  transform: translateY(0) !important;
}

body.app-body .btn-outline-primary {
  border: 2px solid var(--je-royal) !important;
  color: var(--je-royal) !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(8px);
  transition: all 0.25s var(--je-ease) !important;
}
body.app-body .btn-outline-primary:hover {
  background: var(--je-royal) !important;
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(23, 105, 232, 0.28);
}

/* ── Section tags & pills ── */
body.app-body .section-tag,
body.app-body .ml-section-label,
body.app-body .home-section-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(23, 105, 232, 0.1), rgba(23, 105, 232, 0.05));
  color: var(--je-royal) !important;
  border: 1px solid rgba(23, 105, 232, 0.15);
}

body.app-body .section-divider {
  width: 48px;
  height: 4px;
  margin: 0.85rem auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--je-royal), var(--je-gold));
}

/* ── Product cards — global polish ── */
body.app-body .janosci-product-card {
  border-radius: var(--je-radius) !important;
  border: 1px solid var(--je-border) !important;
  box-shadow: var(--je-shadow-sm) !important;
  transition:
    transform 0.35s var(--je-ease),
    box-shadow 0.35s var(--je-ease),
    border-color 0.3s ease !important;
  overflow: hidden;
}
body.app-body .janosci-product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--je-shadow-lg) !important;
  border-color: rgba(23, 105, 232, 0.22) !important;
}
body.app-body .janosci-product-card .card-img-wrap {
  background: linear-gradient(180deg, #fbfdff 0%, #f0f5fc 100%) !important;
  position: relative;
}
body.app-body .janosci-product-card .card-img-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(10, 37, 64, 0.03) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
body.app-body .janosci-product-card:hover .card-img-wrap::after {
  opacity: 1;
}
body.app-body .janosci-product-card .btn-add-cart {
  background: linear-gradient(135deg, var(--je-navy) 0%, var(--je-royal) 100%) !important;
  border: none !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  transition: all 0.25s var(--je-ease) !important;
}
body.app-body .janosci-product-card .btn-add-cart:hover {
  background: linear-gradient(135deg, var(--je-royal) 0%, var(--je-royal-dark) 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(23, 105, 232, 0.3);
}
body.app-body .janosci-product-card .btn-view-details {
  border-radius: 10px;
  font-weight: 600;
  transition: color 0.2s ease, background 0.2s ease;
}
body.app-body .janosci-product-card .sale-badge {
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}
body.app-body .janosci-product-card .wishlist-btn {
  transition: transform 0.25s var(--je-ease), color 0.2s ease, box-shadow 0.2s ease;
}
body.app-body .janosci-product-card .wishlist-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* ── Header glass effect on scroll ── */
body.app-body .site-header.navbar-scrolled {
  backdrop-filter: blur(16px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.2) !important;
  box-shadow: 0 8px 32px rgba(10, 37, 64, 0.12) !important;
}

/* ── Search bar glow ── */
body.app-body .catalog-search:focus-within {
  box-shadow: 0 0 0 4px rgba(23, 105, 232, 0.1), 0 4px 16px rgba(23, 105, 232, 0.08) !important;
}

/* ── Form fields ── */
body.app-body input[type="text"],
body.app-body input[type="email"],
body.app-body input[type="tel"],
body.app-body input[type="search"],
body.app-body input[type="password"],
body.app-body textarea,
body.app-body select {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
body.app-body input:focus,
body.app-body textarea:focus,
body.app-body select:focus {
  border-color: rgba(23, 105, 232, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(23, 105, 232, 0.12) !important;
  outline: none;
}

/* ── Toast notifications ── */
.toast-container .toast {
  border-radius: 14px !important;
  backdrop-filter: blur(12px);
  box-shadow: var(--je-shadow-lg) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* ── Bottom nav polish ── */
body.app-body .bottom-nav {
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border-top: 1px solid rgba(228, 234, 242, 0.9) !important;
  box-shadow: 0 -8px 32px rgba(10, 37, 64, 0.08) !important;
}
body.app-body .bottom-nav .nav-item.active,
body.app-body .bottom-nav .nav-item:hover {
  color: var(--je-royal) !important;
}

/* ── WhatsApp FAB ── */
body.app-body .app-fab-wa {
  box-shadow: 0 8px 28px rgba(37, 211, 102, 0.35) !important;
  transition: transform 0.3s var(--je-ease), box-shadow 0.3s ease !important;
}
body.app-body .app-fab-wa:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 36px rgba(37, 211, 102, 0.45) !important;
}

/* ── Page hero sections (generic) ── */
body.app-body .page-hero {
  border-radius: 0 0 var(--je-radius-lg) var(--je-radius-lg);
  overflow: hidden;
  position: relative;
}
body.app-body .page-hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--je-royal), var(--je-gold), var(--je-royal));
}

/* ── Empty states ── */
body.app-body .state-empty {
  border-radius: var(--je-radius-lg);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  box-shadow: var(--je-shadow-sm);
}

/* ── Focus visible for accessibility ── */
:focus-visible {
  outline: 2px solid var(--je-royal);
  outline-offset: 2px;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ════════════════════════════════════════════════
   PRODUCTS LISTING PAGE
   ════════════════════════════════════════════════ */
body.products-page-body .janosci-product-card,
body.products-page .janosci-product-card {
  border-radius: var(--je-radius) !important;
}
body.products-page-body .pl-toolbar,
body.products-page .pl-toolbar {
  border-radius: var(--je-radius) !important;
  box-shadow: var(--je-shadow-md) !important;
}
body.products-page-body .pl-hero,
body.products-page .pl-hero {
  border-radius: 0 0 var(--je-radius-lg) var(--je-radius-lg);
}

/* ════════════════════════════════════════════════
   MOBILE APP HOME STRIP
   ════════════════════════════════════════════════ */
body.home-mobile-app .app-home-strip {
  background:
    radial-gradient(ellipse 100% 60% at 50% -10%, rgba(23, 105, 232, 0.08), transparent 55%),
    linear-gradient(180deg, #f0f5fc 0%, #f5f7fb 100%) !important;
}
body.home-mobile-app .app-home-search {
  border-radius: 14px !important;
  box-shadow: var(--je-shadow-sm) !important;
  border: 1.5px solid rgba(23, 105, 232, 0.12) !important;
  transition: box-shadow 0.25s ease, border-color 0.25s ease !important;
}
body.home-mobile-app .app-home-search:focus-within {
  border-color: rgba(23, 105, 232, 0.35) !important;
  box-shadow: 0 0 0 4px rgba(23, 105, 232, 0.1), var(--je-shadow-sm) !important;
}
body.home-mobile-app .app-quick-chip {
  transition: transform 0.25s var(--je-ease), box-shadow 0.25s ease !important;
}
body.home-mobile-app .app-quick-chip:active {
  transform: scale(0.96);
}
body.home-mobile-app .app-promo-tile {
  border-radius: 18px !important;
  transition: transform 0.3s var(--je-ease), box-shadow 0.3s ease !important;
}
body.home-mobile-app .app-promo-tile:active {
  transform: scale(0.98);
}
body.home-mobile-app .app-love-card {
  border-radius: 16px !important;
  box-shadow: var(--je-shadow-sm) !important;
  transition: transform 0.3s var(--je-ease), box-shadow 0.3s ease !important;
}
body.home-mobile-app .app-love-card:active {
  transform: scale(0.98);
}
body.home-mobile-app .app-trust-pill {
  border-radius: 999px !important;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(10, 37, 64, 0.06);
}
body.home-mobile-app .app-cat-icon-circle {
  transition: transform 0.3s var(--je-ease), box-shadow 0.3s ease !important;
}
body.home-mobile-app .app-cat-icon-item:active .app-cat-icon-circle {
  transform: scale(0.92);
}

/* ════════════════════════════════════════════════
   CART PAGE
   ════════════════════════════════════════════════ */
body.page-cart .cart-page-header {
  border-radius: var(--je-radius-lg) !important;
}
body.page-cart .cart-item,
body.page-cart .cart-summary-card {
  border-radius: var(--je-radius) !important;
  box-shadow: var(--je-shadow-sm) !important;
  transition: box-shadow 0.25s ease !important;
}
body.page-cart .cart-item:hover {
  box-shadow: var(--je-shadow-md) !important;
}
