/**
 * Nurses Weekend — shared home/landing styles: tokens, motion, animations.
 * Loaded after theme stylesheet.
 */

:root {
  --nw-midnight: #0b0b3b;
  --nw-hero-purple: rgb(183, 7, 255);
  --nw-hero-navy: rgb(38, 36, 97);
  --nw-accent: #ea580c;
  --nw-accent-soft: #f97316;
  --nw-teal: #0d9488;
  --nw-teal-hover: #0f766e;
  --nw-surface-dark: linear-gradient(135deg, #1a0533 0%, #2d1b69 45%, #0f3460 100%);
  --nw-shadow-sm: 0 1px 2px rgba(11, 11, 59, 0.06);
  --nw-shadow-md: 0 8px 24px rgba(11, 11, 59, 0.1);
  --nw-shadow-lg: 0 16px 40px rgba(11, 11, 59, 0.12);
}

body {
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.nw-font-display {
  font-family: "Crete Round", Georgia, "Times New Roman", serif;
}

/* Top bar uses brand accent */
.nw-topbar {
  background-color: var(--nw-accent);
}

/* Footer logo: cap size on WooCommerce pages (WC + broad plugins often target `img`) */
footer .nw-footer-logo {
  width: auto !important;
  height: auto !important;
  max-width: min(100%, 9.5rem) !important;
  max-height: 4.5rem !important;
  object-fit: contain;
}
@media (min-width: 768px) {
  footer .nw-footer-logo {
    max-width: min(100%, 11rem) !important;
    max-height: 5.5rem !important;
  }
}

/* Hero gradient (replaces long inline style) */
.nw-hero-gradient {
  background: radial-gradient(var(--nw-hero-purple) 0%, var(--nw-hero-navy) 69%);
  box-sizing: border-box;
}

/* Category / promo dark sections */
.nw-section-gradient-dark {
  background: var(--nw-surface-dark);
}

/* Cards: consistent elevation */
.nw-card-elevated {
  box-shadow: var(--nw-shadow-md);
}

.nw-card-elevated:hover {
  box-shadow: var(--nw-shadow-lg);
}

/* Generic WordPress pages (Privacy, Terms, etc.) — readable, on-brand links */
.nw-page-content a {
  color: var(--nw-teal-hover, #0f766e);
  text-decoration: underline;
  font-weight: 500;
}
.nw-page-content a:hover {
  color: var(--nw-accent, #ea580c);
}
.nw-page-content h2,
.nw-page-content h3 {
  font-family: "Crete Round", Georgia, "Times New Roman", serif;
  font-weight: 700;
  color: #0f172a;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  line-height: 1.25;
}
.nw-page-content h2 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}
.nw-page-content ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0.75rem 0 1rem;
}

/* Sticky header: dropdowns must not clip */
.nw-site-header {
  overflow: visible;
}

/* Sticky header stack: anchors land below the bar */
html {
  scroll-padding-top: 8.5rem;
}

@media (min-width: 1024px) {
  html {
    scroll-padding-top: 7.5rem;
  }
}

/* Desktop nav: animated teal underline (reads clearly vs plain hover) */
.nw-main-nav a {
  position: relative;
  padding-bottom: 0.2rem;
}
.nw-main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  background: var(--nw-teal);
  border-radius: 2px;
  transition: width 0.22s ease;
}
.nw-main-nav a:hover::after,
.nw-main-nav a:focus-visible::after {
  width: 100%;
}

/* Hero: mesh + warm glow so the block feels less “flat purple” */
.nw-hero-mesh {
  position: relative;
  isolation: isolate;
  /* Reserve space for absolutely positioned .nw-hero-marquee so content/image are not hidden under it */
  --nw-hero-marquee-h: 4rem;
}
@media (min-width: 768px) {
  .nw-hero-mesh {
    --nw-hero-marquee-h: 5.75rem;
  }
}
.nw-hero-mesh::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 60% at 15% 25%, rgba(255, 255, 255, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 70% 55% at 95% 15%, rgba(251, 191, 36, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse 50% 45% at 80% 90%, rgba(20, 184, 166, 0.18) 0%, transparent 50%);
}
.nw-hero-video-bg {
  z-index: 0;
}
.nw-hero-mesh > .nw-hero-inner {
  position: relative;
  z-index: 2;
  min-width: 0;
  padding-bottom: var(--nw-hero-marquee-h);
}

/* Above .nw-hero-inner (z stacking); otherwise the image column covers this bar on small screens */
.nw-hero-mesh > .nw-hero-marquee,
.nw-hero-mesh .nw-hero-marquee.nw-marquee-bar {
  z-index: 2;
}

/* Marquee pause control */
.nw-marquee-bar {
  position: relative;
}
.nw-marquee-pause {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
}
.nw-marquee-pause:hover {
  background: rgba(0, 0, 0, 0.5);
}
.nw-marquee-paused {
  animation-play-state: paused !important;
}

/* Scroll reveal */
.nw-reveal {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.nw-reveal.nw-reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* Gallery carousel */
.nw-gallery-carousel {
  position: relative;
  padding: 0 2.75rem;
}
.nw-gallery-viewport {
  width: 100%;
}
.nw-gallery-track {
  width: 100%;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.nw-gallery-slide [class*='aspect-'] {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
}
.nw-gallery-slide img {
  object-fit: contain;
  object-position: center;
  max-height: min(70vh, 520px);
}
.nw-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #0f766e;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.nw-gallery-arrow:hover {
  background: #0d9488;
  color: #fff;
}
.nw-gallery-prev {
  left: 0;
}
.nw-gallery-next {
  right: 0;
}
.nw-gallery-dot[data-active="true"] {
  background-color: #0d9488;
}

/* Modals */
.nw-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.nw-modal.hidden {
  display: none !important;
}
.nw-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
}
.nw-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  background: #fff;
  border-radius: 1rem;
  padding: 1.75rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}
.nw-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  background: #f1f5f9;
  border: none;
  cursor: pointer;
}
.nw-modal-close:hover {
  color: #0f172a;
  background: #e2e8f0;
}
body.nw-modal-open {
  overflow: hidden;
}

/* Primary nav: WP menu + fallback — multi-level flyouts (desktop) */
@media (min-width: 1024px) {
  .nw-main-nav #nw-nav-desktop li.menu-item-has-children {
    position: relative;
  }
  .nw-main-nav #nw-nav-desktop .sub-menu {
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 12rem;
    margin: 0;
    padding: 0.25rem 0;
    list-style: none;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
    border: 1px solid #e2e8f0;
    z-index: 120;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
  }
  .nw-main-nav #nw-nav-desktop .sub-menu .sub-menu {
    left: 100%;
    top: 0;
    margin-left: 2px;
  }
  .nw-main-nav #nw-nav-desktop li.menu-item-has-children:hover > .sub-menu,
  .nw-main-nav #nw-nav-desktop li.menu-item-has-children:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .nw-main-nav #nw-nav-desktop > li.menu-item > a {
    white-space: nowrap;
  }

  /* Dropdown links (Events regions + Shop compact list) */
  .nw-main-nav #nw-nav-desktop .sub-menu > li.menu-item > a {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    text-decoration: none;
  }
  .nw-main-nav #nw-nav-desktop .sub-menu > li.menu-item > a:hover,
  .nw-main-nav #nw-nav-desktop .sub-menu > li.menu-item > a:focus-visible {
    color: #0f766e;
    background: rgba(13, 148, 136, 0.08);
  }
  .nw-main-nav #nw-nav-desktop .sub-menu a::after {
    display: none !important;
  }

  /* Shop wide mega (columns) — width hugs content; compact Shop uses ul.sub-menu above */
  .nw-main-nav #nw-nav-desktop li.nw-shop-mega > .nw-shop-mega-panel.nw-shop-mega-panel--wide {
    position: absolute;
    left: 0;
    top: 100%;
    margin: 0;
    width: max-content;
    max-width: min(36rem, calc(100vw - 2rem));
    padding: 0.65rem 0.85rem 0.75rem;
    background: #fff;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
    z-index: 130;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
  }
  /* Keep panel inside viewport when Shop sits near the right edge */
  .nw-main-nav #nw-nav-desktop li.nw-shop-mega:last-child > .nw-shop-mega-panel.nw-shop-mega-panel--wide,
  .nw-main-nav #nw-nav-desktop li.nw-shop-mega:nth-last-child(2) > .nw-shop-mega-panel.nw-shop-mega-panel--wide {
    left: auto;
    right: 0;
  }
  .nw-main-nav #nw-nav-desktop li.nw-shop-mega:hover > .nw-shop-mega-panel,
  .nw-main-nav #nw-nav-desktop li.nw-shop-mega:focus-within > .nw-shop-mega-panel,
  .nw-main-nav #nw-nav-desktop li.nw-shop-mega:hover > .nw-shop-mega-panel.nw-shop-mega-panel--wide,
  .nw-main-nav #nw-nav-desktop li.nw-shop-mega:focus-within > .nw-shop-mega-panel.nw-shop-mega-panel--wide {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

/* Mobile / tablet (< lg): shop mega stacks under Shop in the drawer */
@media (max-width: 1023px) {
  #nw-nav-mobile .nw-shop-mega > .nw-shop-mega-panel {
    position: static;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    margin: 0.35rem 0 0.75rem 0.25rem;
    padding: 0.65rem 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    max-width: 100%;
    box-shadow: none;
  }
  #nw-nav-mobile .nw-shop-mega-columns {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  #nw-nav-mobile .nw-shop-mega-col {
    padding: 0.65rem 0;
    border-bottom: 1px solid #e2e8f0;
  }
  #nw-nav-mobile .nw-shop-mega-col:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  #nw-nav-mobile .nw-shop-mega-col--all {
    padding-top: 0;
  }
  #nw-nav-mobile .nw-shop-mega-col-title,
  #nw-nav-mobile .nw-shop-mega-link {
    display: block;
    padding: 0.15rem 0;
    font-size: 0.9375rem;
  }
  #nw-nav-mobile .nw-shop-mega-col-link,
  #nw-nav-mobile .nw-shop-mega-col-leaf .nw-shop-mega-col-link {
    padding: 0.35rem 0 0.15rem 0.75rem;
    font-size: 0.875rem;
  }
}

.nw-shop-mega-inner {
  min-width: 0;
}
.nw-shop-mega-intro {
  margin: 0 0 0.5rem;
  padding: 0;
}
.nw-shop-mega-all {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0f766e;
}
.nw-shop-mega-all:hover,
.nw-shop-mega-all:focus-visible {
  color: #0d9488;
}
/* Wide mega + mobile: no top-nav underline ribbon on panel links */
.nw-main-nav .nw-shop-mega-panel--wide a,
.nw-main-nav .nw-shop-mega-panel--mobile a {
  padding-bottom: 0;
}
.nw-main-nav .nw-shop-mega-panel--wide a::after,
.nw-main-nav .nw-shop-mega-panel--mobile a::after {
  display: none !important;
}
.nw-shop-mega-link {
  display: block;
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  border-radius: 0.25rem;
  white-space: nowrap;
}
.nw-shop-mega-link:hover,
.nw-shop-mega-link:focus-visible {
  color: #0f766e;
  background: rgba(13, 148, 136, 0.08);
}
.nw-shop-mega-empty,
.nw-shop-mega-empty-item .nw-shop-mega-empty {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
}
.nw-shop-mega-empty-item .nw-shop-mega-empty {
  display: block;
  padding: 0.5rem 0.75rem;
  margin: 0;
}

/* Shop mega: column layout only when parents have subcategories */
.nw-shop-mega-intro--wide {
  margin: 0 0 0.5rem;
  padding: 0 0 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}
.nw-shop-mega-columns {
  display: grid;
  grid-template-columns: repeat(var(--nw-mega-cols, 2), max-content);
  gap: 0.35rem 1.5rem;
  align-items: start;
}
.nw-shop-mega-col {
  min-width: 0;
  max-width: 11rem;
}
.nw-shop-mega-col-title {
  display: block;
  font-weight: 800;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0f766e;
  margin: 0 0 0.35rem;
  line-height: 1.25;
  text-decoration: none;
}
.nw-shop-mega-col-title:hover,
.nw-shop-mega-col-title:focus-visible {
  color: #0d9488;
}
.nw-shop-mega-col-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nw-shop-mega-col-link {
  display: block;
  padding: 0.2rem 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  border-radius: 0.25rem;
  text-decoration: none;
}
.nw-shop-mega-col-link:hover,
.nw-shop-mega-col-link:focus-visible {
  color: #0f766e;
  background: rgba(13, 148, 136, 0.08);
}
.nw-shop-mega-col-leaf {
  margin: 0;
}
.nw-kicker {
  display: inline-block;
  border-left: 4px solid var(--nw-accent);
  padding-left: 0.75rem;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0f766e;
}

.nw-kicker--inverse {
  color: #fef9c3;
  border-left-color: #fbbf24;
}

/* Big titles on dark bands */
.nw-glow-title {
  text-shadow: 0 0 42px rgba(251, 191, 36, 0.28), 0 2px 4px rgba(0, 0, 0, 0.25);
}

/* ---------- Animations ---------- */
@keyframes nw-marquee {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

.animate-marquee {
  display: inline-block;
  min-width: 100%;
  animation: nw-marquee 20s linear infinite;
}

@keyframes nw-hero-slide-left {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes nw-hero-slide-right {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.hero-text-slide-left {
  animation: nw-hero-slide-left 1s ease-out forwards;
}

.hero-image-slide-right {
  animation: nw-hero-slide-right 1s ease-out forwards;
  animation-delay: 0.3s;
}

@keyframes nw-fade-in-up {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes nw-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes nw-fade-up {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: nw-fade-in-up 0.8s ease forwards;
}

.nw-animate-fade-in {
  animation: nw-fade-in 0.8s ease forwards;
}

/* Staggered reveal for promo product cards (template outputs <li class="product ...">) */
#promotions ul.products > li.product {
  opacity: 0;
  transform: translateY(1.5rem);
  animation: nw-fade-up 0.7s ease forwards;
}
#promotions ul.products > li.product:nth-child(1) {
  animation-delay: 300ms;
}
#promotions ul.products > li.product:nth-child(2) {
  animation-delay: 500ms;
}
#promotions ul.products > li.product:nth-child(3) {
  animation-delay: 700ms;
}
#promotions ul.products > li.product:nth-child(4) {
  animation-delay: 900ms;
}
#promotions ul.products > li.product:nth-child(n + 5) {
  animation-delay: 0ms;
}

.delay-100 {
  animation-delay: 0.1s;
}
.delay-200 {
  animation-delay: 0.2s;
}
.delay-300 {
  animation-delay: 0.3s;
}
.delay-400 {
  animation-delay: 0.4s;
}
.delay-500 {
  animation-delay: 0.5s;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .animate-marquee {
    animation: none;
    transform: none;
    white-space: normal;
    text-align: center;
  }

  .nw-hero-mesh .animate-pulse {
    animation: none !important;
  }

  .hero-text-slide-left,
  .hero-image-slide-right {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .animate-fadeIn,
  .nw-animate-fade-in,
  #promotions ul.products > li.product {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .nw-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  /* Keep flyouts closed by default; open on hover/focus only (no fade transition). */
  .nw-main-nav #nw-nav-desktop .sub-menu,
  .nw-main-nav #nw-nav-desktop li.nw-shop-mega > .nw-shop-mega-panel {
    transition: none !important;
  }

  .nw-hero-video-bg {
    display: none !important;
  }
}

/* ---------- Accessibility: visible focus ---------- */
:where(a, button, input:not([type="hidden"]), select, textarea):focus-visible {
  outline: 2px solid var(--nw-teal, #0d9488);
  outline-offset: 2px;
}

/* ---------- Product loop stock badges ---------- */
.nw-stock-badge {
  position: absolute;
  left: 0.65rem;
  top: 0.65rem;
  z-index: 5;
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.6rem;
  border-radius: 9999px;
  line-height: 1.2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.nw-stock-badge--out {
  background: #1e293b;
  color: #fff;
}
.nw-stock-badge--low {
  background: linear-gradient(90deg, #ea580c, #f97316);
  color: #fff;
}

.nw-stock-line {
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}
.nw-stock-line--low {
  color: #c2410c;
  font-weight: 600;
}

.nw-footer-contact-custom a {
  color: #5eead4;
  text-decoration: underline;
}
.nw-footer-contact-custom a:hover {
  color: #fcd34d;
}
