/* ============================================================
   PharmaSoul — Static build custom styles
   Used alongside Tailwind CSS v4 (browser CDN)
   ============================================================ */

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  font-family: 'Manrope', sans-serif;
  color: #2a2a2a;
  background-color: #f8f5f0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Cormorant Garamond', serif;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f8f5f0; }
::-webkit-scrollbar-thumb { background: #8fb8e8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #1565c0; }

/* ---------- Marquee ---------- */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.animate-marquee {
  animation: marquee 12s linear infinite;
  will-change: transform;
}
.marquee-pause:hover .animate-marquee { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .animate-marquee { animation: none; }
}

/* ---------- ScrollReveal ---------- */
.scroll-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}
.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
/* Fallback: if JS is disabled, never hide content */
html:not(.js) .scroll-reveal {
  opacity: 1;
  transform: none;
}

/* ---------- Service card (Home) ---------- */
.service-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.service-dim { opacity: 0.6; }

/* ---------- Nav link underline ---------- */
.nav-link { position: relative; }
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.3s ease;
}
.nav-link:hover::after { width: 100%; }
.nav-link.nav-active { color: #0a3d91; }

/* ---------- Navbar scrolled state ---------- */
.nav-scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: 0 1px 0 rgba(26, 58, 42, 0.08);
}

/* ---------- Nav dropdown (desktop) ---------- */
.nav-dd { position: relative; }
.nav-dd::before {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  width: 260px; height: 14px;
  transform: translateX(-50%);
}
.nav-dd-trigger {
  display: flex; align-items: center; gap: 6px;
}
.nav-dd-caret-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; padding: 0;
  color: inherit; cursor: pointer;
}
.nav-dd-caret { width: 12px; height: 12px; transition: transform 0.3s ease; }
.nav-dd.open > .nav-dd-trigger .nav-dd-caret { transform: rotate(180deg); }
.nav-dd-panel {
  position: absolute;
  top: calc(100% + 14px); left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 244px; padding: 8px;
  background: #ffffff;
  border: 1px solid rgba(10, 61, 145, 0.1);
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(10, 61, 145, 0.14), 0 4px 12px rgba(10, 61, 145, 0.06);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 70;
}
.nav-dd:hover > .nav-dd-panel,
.nav-dd.open > .nav-dd-panel,
.nav-dd:focus-within > .nav-dd-panel {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-dd-link {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 10px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13.5px; font-weight: 500; line-height: 1.4;
  color: #4a4a4a;
  text-align: left; white-space: nowrap;
  background: none; border: 0; cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.nav-dd-link:hover, .nav-dd-link:focus-visible { background: rgba(10, 61, 145, 0.06); color: #0a3d91; }
.nav-dd-link svg { width: 13px; height: 13px; flex-shrink: 0; color: #0a3d91; }
.nav-dd-sub { position: relative; }
.nav-dd-sub::before {
  content: '';
  position: absolute; top: 0; left: 100%;
  width: 10px; height: 100%;
}
.nav-dd-flyout {
  position: absolute;
  top: -8px; left: calc(100% + 4px);
  min-width: 256px; padding: 8px;
  background: #ffffff;
  border: 1px solid rgba(10, 61, 145, 0.1);
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(10, 61, 145, 0.14), 0 4px 12px rgba(10, 61, 145, 0.06);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateX(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 80;
}
.nav-dd-sub:hover > .nav-dd-flyout,
.nav-dd-sub.open > .nav-dd-flyout,
.nav-dd-sub:focus-within > .nav-dd-flyout {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(0);
}

/* ---------- Mobile nav accordion ---------- */
.mobile-dd-panel {
  max-height: 0; overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-dd.open > .mobile-dd-panel { max-height: 640px; }
.mobile-dd-caret { transition: transform 0.3s ease; }
.mobile-dd-caret-btn {
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; padding: 10px 0 10px 12px;
  color: inherit; cursor: pointer;
}
.mobile-dd.open > .mobile-dd-trigger .mobile-dd-caret { transform: rotate(180deg); }
.mobile-dd-link {
  display: block; padding: 12px 8px;
  border-bottom: 1px solid rgba(10, 61, 145, 0.08);
  font-size: 17px; font-weight: 500;
  color: #4a4a4a;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.mobile-dd-link:hover { color: #0a3d91; }
.mobile-dd .mobile-dd .mobile-dd-link { padding-left: 20px; }

/* ---------- Mobile menu ---------- */
#mobile-menu-overlay {
  transition: opacity 0.5s ease;
}
#mobile-menu-panel {
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.mobile-menu-open #mobile-menu-overlay { opacity: 1; pointer-events: auto; }
.mobile-menu-open #mobile-menu-panel { transform: translateX(0); }

/* ---------- FAQ ---------- */
.faq-panel {
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Grain texture ---------- */
.grain-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
  pointer-events: none;
  z-index: 1;
  contain: paint;
}

/* ---------- Focus visible ---------- */
:focus-visible {
  outline: 2px solid #1e90ff;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 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-reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============================================================
   Lightbox — click product images to view full screen
   ============================================================ */

[data-lightbox] {
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 16, 28, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  cursor: zoom-out;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}

.lightbox p {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  color: #dde7f5;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

body.lightbox-open {
  overflow: hidden;
}
