/* Clinical Curator — editorial custom styles */

html { scroll-behavior: smooth; }
body { font-family: "Inter", system-ui, -apple-system, sans-serif; }

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.editorial-gradient {
  background: linear-gradient(135deg, #006EB6 0%, #184a94 100%);
}
.sls-gradient { background: linear-gradient(135deg, #006EB6 0%, #184a94 100%); }
.sls-gradient-dark { background: linear-gradient(135deg, #184a94 0%, #0f2e5f 100%); }

/* Category grid — responsive rounded tiles */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.cat-tile {
  border-radius: 1rem;
  padding: 1.5rem 1rem;
  aspect-ratio: 1 / 1;
}

/* Tablet: 3 columns */
@media (max-width: 1024px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
}
/* Large phone: 2 columns */
@media (max-width: 640px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .cat-tile {
    padding: 1.25rem 0.75rem;
    border-radius: 0.75rem;
  }
}
/* Small phone: still 2 col but smaller aspect */
@media (max-width: 380px) {
  .cat-grid { gap: 8px; }
  .cat-tile { padding: 1rem 0.5rem; }
}

.glass-nav {
  background: rgba(248, 249, 253, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 rgba(190, 200, 209, 0.25);
}

.ambient-lift {
  box-shadow: 0 16px 48px -24px rgba(25, 28, 31, 0.18),
              0 2px 8px -4px rgba(25, 28, 31, 0.06);
}

.ghost-border {
  box-shadow: inset 0 0 0 1px rgba(190, 200, 209, 0.25);
}

/* Scroll-snap horizontal carousel */
.rail {
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }

/* Infinite marquee (suppliers) */
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee {
  display: flex;
  width: max-content;
  animation: marquee 40s linear infinite;
}
.marquee-pause:hover .marquee { animation-play-state: paused; }

/* Toast */
.toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  background: #191c1f;
  color: #f8f9fd;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transform: translateY(-8px);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* Qty stepper */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  background: #f2f4f7;
  border-radius: 0.5rem;
  overflow: hidden;
}
.qty-stepper button {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  color: #3e4850;
  transition: background 0.15s;
}
.qty-stepper button:hover { background: #e6e8ec; }
.qty-stepper input {
  width: 2.5rem;
  height: 2rem;
  text-align: center;
  border: none;
  background: transparent;
  font-weight: 600;
  color: #191c1f;
  outline: none;
  -moz-appearance: textfield;
}
.qty-stepper input::-webkit-inner-spin-button,
.qty-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Fade-in on intersection */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* Autocomplete dropdown */
.ac-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 0.5rem;
  box-shadow: 0 24px 64px -20px rgba(25,28,31,0.18), 0 4px 12px -4px rgba(25,28,31,0.08);
  overflow: hidden;
  z-index: 60;
  max-height: 420px;
  overflow-y: auto;
}
.ac-group-title {
  font-family: "Work Sans", sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6e7881;
  padding: 0.5rem 1rem 0.25rem;
}
.ac-item { padding: 0.625rem 1rem; display: flex; gap: 0.75rem; align-items: center; cursor: pointer; }
.ac-item:hover, .ac-item.active { background: #f2f4f7; }
.ac-item mark { background: transparent; color: #00628a; font-weight: 600; }

/* Filter checkbox */
.filter-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #3e4850;
  cursor: pointer;
  padding: 0.25rem 0;
}
.filter-check input { accent-color: #00628a; }

/* Product card */
.pcard { background: #fff; border-radius: 0.5rem; overflow: hidden; transition: transform 0.25s, box-shadow 0.25s; }
.pcard:hover { transform: translateY(-2px); box-shadow: 0 24px 48px -28px rgba(25,28,31,0.18); }

/* Checkout stepper */
.step-dot { width: 2rem; height: 2rem; border-radius: 9999px; display: grid; place-items: center; font-weight: 700; font-size: 0.875rem; }
.step-dot.done { background: #00628a; color: #fff; }
.step-dot.active { background: linear-gradient(135deg,#00628a,#007cae); color: #fff; }
.step-dot.pending { background: #e6e8ec; color: #6e7881; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(25,28,31,0.55); display: grid; place-items: center; z-index: 80; opacity: 0; pointer-events: none; transition: opacity .3s; }
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal { background: #fff; border-radius: 0.75rem; padding: 2.5rem; max-width: 28rem; width: calc(100% - 2rem); text-align: center; transform: scale(.96); transition: transform .3s; }
.modal-backdrop.open .modal { transform: scale(1); }

/* Utility: hide native scrollbar on sidebars */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

/* WhatsApp floating button */
.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 90;
  background: #25D366;
  color: #fff;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  transition: all 0.3s ease;
}
.whatsapp-float:hover {
  background: #1ebe57;
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.5);
}
@media (max-width: 640px) {
  .whatsapp-float { bottom: 1rem; right: 1rem; width: 3rem; height: 3rem; }
  .whatsapp-float svg { width: 1.5rem; height: 1.5rem; }
}

/* Better mobile tap targets */
@media (max-width: 640px) {
  .filter-check { padding: 0.5rem 0; }
  .qty-stepper button { width: 2.25rem; height: 2.25rem; }
  .qty-stepper input { width: 2.25rem; }
}

/* ═══════════════════════════════════════
   DNA Helix Animation — Pure CSS, GPU-accelerated
   Uses two counter-rotating sine waves via offset circles
   ═══════════════════════════════════════ */
.dna-helix {
  position: absolute;
  pointer-events: none;
  overflow: hidden;
}

.dna-strand {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
}

.dna-strand .bp {
  position: absolute;
  left: 50%;
  width: var(--w, 60px);
  height: 3px;
  border-radius: 2px;
  transform-origin: center;
  will-change: transform, opacity;
}

/* Nucleotide dots at each end */
.dna-strand .bp::before,
.dna-strand .bp::after {
  content: "";
  position: absolute;
  top: 50%;
  width: var(--dot, 8px);
  height: var(--dot, 8px);
  border-radius: 50%;
  transform: translateY(-50%);
}
.dna-strand .bp::before { left: -2px; }
.dna-strand .bp::after  { right: -2px; }

/* Color pairs */
.dna-strand .bp.pair-a { background: rgba(0, 161, 224, 0.3); }
.dna-strand .bp.pair-a::before { background: rgba(0, 161, 224, 0.8); }
.dna-strand .bp.pair-a::after  { background: rgba(0, 110, 182, 0.8); }

.dna-strand .bp.pair-b { background: rgba(91, 79, 155, 0.3); }
.dna-strand .bp.pair-b::before { background: rgba(91, 79, 155, 0.8); }
.dna-strand .bp.pair-b::after  { background: rgba(24, 74, 148, 0.8); }

.dna-strand .bp.pair-c { background: rgba(0, 110, 182, 0.25); }
.dna-strand .bp.pair-c::before { background: rgba(0, 161, 224, 0.7); }
.dna-strand .bp.pair-c::after  { background: rgba(91, 79, 155, 0.7); }

/* Rotation animation — each bp gets a staggered delay via inline --d */
@keyframes dna-rotate {
  0%   { transform: translateX(-50%) rotateY(0deg); }
  100% { transform: translateX(-50%) rotateY(360deg); }
}

.dna-strand .bp {
  animation: dna-rotate var(--speed, 6s) linear infinite;
  animation-delay: var(--d, 0s);
  transform-style: preserve-3d;
  perspective: 600px;
  backface-visibility: visible;
}

/* Depth fade — simulates 3D by modulating opacity as it rotates */
@keyframes dna-depth {
  0%, 100% { opacity: 0.3; }
  25%      { opacity: 1; }
  50%      { opacity: 0.3; }
  75%      { opacity: 1; }
}
.dna-strand .bp::before {
  animation: dna-depth var(--speed, 6s) linear infinite;
  animation-delay: var(--d, 0s);
}
.dna-strand .bp::after {
  animation: dna-depth var(--speed, 6s) linear infinite;
  animation-delay: calc(var(--d, 0s) + calc(var(--speed, 6s) / 2));
}

/* Floating upward drift for ambient feel */
@keyframes dna-float {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-12px); }
  100% { transform: translateY(0); }
}
.dna-helix.float { animation: dna-float 8s ease-in-out infinite; }
.dna-helix.float-alt { animation: dna-float 10s ease-in-out infinite reverse; }

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .dna-strand .bp,
  .dna-strand .bp::before,
  .dna-strand .bp::after,
  .dna-helix.float,
  .dna-helix.float-alt,
  .dna-path-a, .dna-path-b,
  .dna-dot-pulse,
  .dna-particle,
  .dna-particle::after { animation: none !important; opacity: 0.3; }
}

/* On small screens, only hide inline-hidden helixes — backbone SVGs & particles remain */
@media (max-width: 480px) {
  .dna-helix { opacity: 0.3 !important; }
  .dna-helix .bp { --w: 30px !important; --dot: 5px !important; }
}

/* ═══════════════════════════════════════
   DNA Backbone — SVG sine-wave strands running alongside hex grid
   ═══════════════════════════════════════ */
.dna-backbone-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.dna-backbone {
  position: absolute;
  top: 0;
  height: 100%;
  width: 80px;
}
.dna-backbone.left  { left: 3%; }
.dna-backbone.right { right: 3%; }
@media (max-width: 900px) {
  .dna-backbone { width: 50px; }
  .dna-backbone.left  { left: 0; }
  .dna-backbone.right { right: 0; }
}

/* SVG path animation — dash offset crawling along the helix */
.dna-path-a, .dna-path-b {
  stroke-dasharray: 120 80;
  animation: dna-crawl 8s linear infinite;
}
.dna-path-b { animation-direction: reverse; }

@keyframes dna-crawl {
  0%   { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -400; }
}

/* Pulsing nucleotide dots on backbone */
.dna-dot-pulse {
  animation: dna-dot-glow 3s ease-in-out infinite;
}
.dna-dot-pulse.d2 { animation-delay: -0.6s; }
.dna-dot-pulse.d3 { animation-delay: -1.2s; }
.dna-dot-pulse.d4 { animation-delay: -1.8s; }
.dna-dot-pulse.d5 { animation-delay: -2.4s; }

@keyframes dna-dot-glow {
  0%, 100% { r: 5; opacity: 0.35; }
  50%      { r: 10; opacity: 1; }
}

/* ═══════════════════════════════════════
   Floating DNA particles — ambient in category section
   ═══════════════════════════════════════ */
.dna-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.dna-particle {
  position: absolute;
  border-radius: 50%;
  will-change: transform, opacity;
  animation: dna-particle-float var(--float-dur, 15s) ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
}

@keyframes dna-particle-float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.6;
  }
  25% {
    transform: translate(var(--drift-x, 20px), calc(var(--drift-y, -20px) * -1)) scale(1.3);
    opacity: 1;
  }
  50% {
    transform: translate(calc(var(--drift-x, 20px) * -0.5), var(--drift-y, -20px)) scale(0.8);
    opacity: 0.4;
  }
  75% {
    transform: translate(calc(var(--drift-x, 20px) * 0.7), calc(var(--drift-y, -20px) * 0.3)) scale(1.1);
    opacity: 0.9;
  }
}

/* Connecting lines between particles — pseudo-element on every 3rd */
.dna-particle:nth-child(3n)::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, rgba(0,161,224,0.2), transparent);
  transform-origin: left center;
  transform: rotate(calc(var(--drift-x, 20) * 1deg));
  animation: dna-line-fade 4s ease-in-out infinite alternate;
}
@keyframes dna-line-fade {
  0%   { opacity: 0; width: 20px; }
  100% { opacity: 1; width: 50px; }
}

/* Sticky label ghost animation */
@keyframes pulse-dot {
  0%,100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}
.pulse-dot { animation: pulse-dot 1.6s ease-in-out infinite; }
