/* =======================================================================
   Wellspring — Clean, Responsive UI (Consolidated)
   ======================================================================= */

/* ---------- Design Tokens ---------- */
:root {
  /* Brand (Wellspring) */
  --well-blue: #008dd2;
  --well-lime: #a6c94f;
  --well-deep: #0b2038;
  --well-text-dark: #1b1b1b;
  --well-text: #404a57;

  /* Generic palette */
  --primary-color: var(--well-blue);
  --secondary-color: #6f7bff;
  --accent-color: var(--well-lime);

  /* Text */
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-light: #718096;

  /* Surfaces & effects */
  --bg-primary: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.75);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
  --glass-bd: 1px solid rgba(255, 255, 255, .45);

  /* Rounding & layout */
  --border-radius: 16px;
  --sidebar-width: 280px;

  /* Fluid type/spacing */
  --step--2: clamp(0.72rem, 0.67rem + 0.22vw, 0.82rem);
  --step--1: clamp(0.85rem, 0.79rem + 0.28vw, 0.98rem);
  --step-0: clamp(1.00rem, 0.92rem + 0.35vw, 1.20rem);
  --step-1: clamp(1.18rem, 1.06rem + 0.45vw, 1.46rem);
  --step-2: clamp(1.39rem, 1.22rem + 0.57vw, 1.76rem);
  --step-3: clamp(1.64rem, 1.39rem + 0.73vw, 2.14rem);
  --step-4: clamp(1.93rem, 1.57rem + 0.93vw, 2.59rem);
  --step-5: clamp(2.27rem, 1.78rem + 1.18vw, 3.14rem);

  --space-1: clamp(6px, 0.3vw, 8px);
  --space-2: clamp(10px, 0.5vw, 12px);
  --space-3: clamp(14px, 0.8vw, 16px);
  --space-4: clamp(18px, 1.1vw, 20px);
  --space-5: clamp(24px, 1.6vw, 28px);
  --space-6: clamp(32px, 2.2vw, 36px);
  --space-7: clamp(40px, 3vw, 48px);

  --transition: all .3s cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Reset / Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--well-text);
  background:
    radial-gradient(1200px 1200px at 12% -10%, rgba(255, 255, 255, .08), transparent 55%),
    linear-gradient(145deg, var(--well-blue), var(--well-lime));
  background-attachment: fixed;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Sticky footer layout */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.container {
  width: min(1200px, 92vw);
  margin: 0 auto;
  padding-inline: var(--space-3);
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  /* ⬅️ MOVE SIDEBAR TO LEFT */
  width: var(--sidebar-width);
  max-width: min(85vw, 340px);
  height: 100dvh;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 4px 0 24px rgba(0, 0, 0, .15);
  /* ⬅️ shadow flipped */
  z-index: 1000;
  transform: translateX(-100%);
  /* ⬅️ hide it on LEFT now */
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, .3);
  /* ⬅️ right border instead of left */
}


.sidebar.active {
  transform: translateX(0);
}

.sidebar-header {
  padding: var(--space-5) var(--space-4);
  border-bottom: 1px solid rgba(255, 255, 255, .3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h2 {
  font-size: var(--step-2);
  font-weight: 800;
  color: var(--text-primary);
}

.close-sidebar {
  background: none;
  border: 0;
  inline-size: 44px;
  block-size: 44px;
  font-size: var(--step-3);
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 10px;
  transition: var(--transition);
}

.close-sidebar:hover {
  background: rgba(0, 0, 0, .05);
  color: var(--text-primary);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding-block: var(--space-3);
  -webkit-overflow-scrolling: touch;
}

.sidebar-link {
  display: block;
  padding: 14px var(--space-5);
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 600;
  border-left: 3px solid transparent;
  margin: 4px 0;
  font-size: var(--step-0);
}

.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(0, 141, 210, .1);
  color: var(--primary-color);
  border-left-color: var(--primary-color);
}

.back-home {
  display: block;
  padding: var(--space-4) var(--space-5);
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 700;
  border-top: 1px solid rgba(255, 255, 255, .3);
  transition: var(--transition);
}

.back-home:hover {
  background: rgba(0, 141, 210, .1);
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Sidebar Toggle */
.sidebar-toggle {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  /* ⬅️ moved to left */
  inline-size: 50px;
  block-size: 50px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .75));
  border: var(--glass-bd);
  border-radius: 12px;
  cursor: pointer;
  z-index: 998;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.sidebar-toggle:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: var(--shadow-lg);
}

.sidebar-toggle span {
  inline-size: 24px;
  block-size: 3px;
  background: #2a2f45;
  border-radius: 2px;
  transition: var(--transition);
}

.sidebar-toggle.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.sidebar-toggle.active span:nth-child(2) {
  opacity: 0;
}

.sidebar-toggle.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ---------- Main / Hero ---------- */
.main-content {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

/* Aurora hero */
.hero-section.hero-aurora {
  position: relative;
  min-height: clamp(300px, 42vh, 520px);
  display: grid;
  place-items: center;
  padding: clamp(40px, 8vw, 80px) 20px clamp(24px, 5vw, 48px);
  overflow: clip;
  background: radial-gradient(1100px 850px at 15% -10%, rgba(255, 255, 255, .12), transparent 55%),
    linear-gradient(135deg, #0e2850 0%, #1a2f6b 38%, #2f2fa3 60%, #421fa9 80%);
}

.hero-section.hero-aurora::before,
.hero-section.hero-aurora::after {
  content: "";
  position: absolute;
  inset: -30% -10% -20% -10%;
  filter: blur(42px);
  opacity: .45;
  background:
    radial-gradient(40% 55% at 20% 30%, color-mix(in oklab, var(--well-blue) 82%, white) 0%, transparent 70%),
    radial-gradient(45% 60% at 80% 65%, color-mix(in oklab, var(--well-lime) 86%, white) 0%, transparent 72%),
    radial-gradient(32% 40% at 60% 20%, #7a67ff 0%, transparent 68%);
  animation: auroraShift 18s ease-in-out infinite alternate;
  pointer-events: none;
}

.hero-section.hero-aurora::after {
  animation-duration: 22s;
  animation-delay: -6s;
  opacity: .35;
}

@keyframes auroraShift {
  0% {
    transform: translate3d(-4%, -2%, 0) scale(1);
  }

  50% {
    transform: translate3d(3%, 1%, 0) scale(1.06);
  }

  100% {
    transform: translate3d(6%, 4%, 0) scale(1.12);
  }
}

/* Brand lockup */
.hero-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 22px);
  padding: clamp(12px, 2vw, 18px) clamp(14px, 2.2vw, 22px);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(255, 255, 255, .88));
  box-shadow: 0 16px 50px rgba(10, 15, 40, .25), 0 1px 0 rgba(255, 255, 255, .35) inset;
}

.brand-mark {
  width: clamp(64px, 9vw, 96px);
  height: auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  margin: 0;
  letter-spacing: .18em;
  font-weight: 900;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  color: var(--well-blue);
  text-shadow: 0 10px 28px rgba(7, 139, 209, .28);
}

.brand-tag {
  margin: 2px 0 0;
  font-size: clamp(.9rem, 1.6vw, 1.05rem);
  font-weight: 600;
  color: color-mix(in oklab, var(--well-text-dark) 55%, #6b7b8d);
}

/* Section headings */
.section-title {
  text-align: center;
  font-size: var(--step-4);
  font-weight: 800;
  color: var(--well-deep);
  margin-bottom: 6px;
}

.section-subtitle {
  text-align: center;
  font-size: var(--step-0);
  color: var(--well-text);
  margin-bottom: var(--space-6);
  font-weight: 300;
}

/* ---------- Categories & Cards ---------- */
.categories-section {
  padding: var(--space-4) 20px var(--space-7);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: clamp(14px, 2vw, 24px);
  margin: 0 auto;
}

.categories-grid.hidden {
  display: none;
}

.category-card {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .85));
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 20px;
  padding: clamp(20px, 2.4vw, 32px);
  text-decoration: none;
  color: var(--well-deep);
  transition: var(--transition);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 2px;
  background: linear-gradient(135deg, var(--well-blue), var(--well-lime));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .4s ease;
  pointer-events: none;
}

.category-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(0, 141, 210, .25);
}

.category-card:hover::after {
  opacity: 1;
}

.card-icon {
  font-size: clamp(36px, 3.6vw, 54px);
}

.card-title {
  font-size: var(--step-2);
  font-weight: 800;
  color: var(--well-blue);
}

.card-description {
  font-size: var(--step--1);
  color: var(--well-text);
  line-height: 1.55;
  flex: 1;
}

.card-arrow {
  font-size: var(--step-2);
  color: var(--well-blue);
  align-self: flex-end;
  transition: var(--transition);
}

.category-card:hover .card-arrow {
  transform: translateX(6px);
  color: var(--well-lime);
}

/* Full GIF card option */
.full-gif-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  padding: 0;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .1);
  transition: transform .4s ease, box-shadow .4s ease;
  display: block;
}

.full-gif-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
  border-radius: inherit;
}

.full-gif-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0, 141, 210, .25);
}

.full-gif-card:hover img {
  transform: scale(1.05);
}

/* ---------- Universal Search (Home) ---------- */
.universal-search {
  text-align: center;
  margin: clamp(24px, 3.2vw, 40px) auto clamp(10px, 2vw, 20px);
  max-width: 760px;
  width: 92%;
}

.universal-search input {
  width: 100%;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, .08);
  background: rgba(255, 255, 255, .95);
  color: var(--well-deep);
  font-size: var(--step-0);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
  transition: var(--transition);
}

.universal-search input::placeholder {
  color: var(--text-light);
}

.universal-search input:focus {
  outline: none;
  border-color: var(--well-blue);
  box-shadow: 0 0 10px rgba(0, 141, 210, .3);
}

/* Search results */
.search-results {
  max-width: 1100px;
  margin: 12px auto clamp(24px, 4vw, 44px);
  display: none;
  flex-direction: column;
  gap: 14px;
}

.result-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.result-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 18px 22px;
  cursor: pointer;
}

.result-title {
  font-size: var(--step-0);
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.25;
}

.result-composition {
  grid-column: 1/-1;
  margin-top: 6px;
  font-size: var(--step--1);
  color: var(--text-secondary);
}

.result-badge {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-color);
  background: rgba(0, 141, 210, .12);
  border: 1px solid rgba(0, 141, 210, .25);
  padding: 6px 10px;
  border-radius: 999px;
  justify-self: end;
}

.result-chevron {
  font-size: var(--step-0);
  color: var(--primary-color);
  transition: transform .25s ease;
  justify-self: end;
}

.result-card.expanded .result-chevron {
  transform: rotate(90deg);
}

.result-body {
  display: none;
  border-top: 1px solid rgba(255, 255, 255, .28);
  background: rgba(0, 141, 210, .06);
}

.result-card.expanded .result-body {
  display: block;
  animation: slideDown .25s ease;
}

.result-grid {
  padding: 20px 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 14px;
}

.result-item {
  background: rgba(255, 255, 255, .58);
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 12px;
  padding: 14px;
}

.result-item h4 {
  font-size: var(--step--1);
  font-weight: 900;
  color: var(--primary-color);
  margin-bottom: 6px;
}

.result-item p {
  font-size: var(--step--1);
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 10px;
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Category Page / Table ---------- */
.page-header {
  position: relative;
  padding: clamp(68px, 10vw, 110px) 20px clamp(22px, 3.2vw, 40px);
  background:
    radial-gradient(1100px 850px at 15% -10%, rgba(255, 255, 255, .12), transparent 55%),
    linear-gradient(135deg, #0e2850 0%, #1a2f6b 38%, #2f2fa3 60%, #421fa9 80%);
  overflow: clip;
}

.page-header::before,
.page-header::after {
  content: "";
  position: absolute;
  inset: -30% -10% -20% -10%;
  filter: blur(42px);
  opacity: .45;
  pointer-events: none;
  background:
    radial-gradient(40% 55% at 20% 30%, color-mix(in oklab, var(--well-blue) 82%, white) 0%, transparent 70%),
    radial-gradient(45% 60% at 80% 65%, color-mix(in oklab, var(--well-lime) 86%, white) 0%, transparent 72%),
    radial-gradient(32% 40% at 60% 20%, #7a67ff 0%, transparent 68%);
  animation: auroraShift 18s ease-in-out infinite alternate;
}

.page-header::after {
  animation-duration: 22s;
  animation-delay: -6s;
  opacity: .35;
}

.back-link {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, .92);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: var(--space-3);
  transition: var(--transition);
  font-size: var(--step--1);
}

.back-link:hover {
  color: #fff;
  transform: translateX(-3px);
}

.page-title {
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  font-weight: 900;
  color: #fff;
  margin-bottom: 6px;
}

.page-subtitle {
  font-size: clamp(0.95rem, 1.6vw, 1.25rem);
  color: rgba(255, 255, 255, .95);
  font-weight: 300;
}

/* Controls */
.products-section {
  padding: var(--space-4) 20px var(--space-7);
}

.table-controls {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 240px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 12px;
  font-size: var(--step-0);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-primary);
  transition: var(--transition);
}

.search-input::placeholder {
  color: var(--text-light);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 141, 210, .12);
}

.sort-btn {
  padding: 14px 22px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 12px;
  font-size: var(--step--1);
  font-weight: 800;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.sort-btn:hover {
  background: rgba(0, 141, 210, .2);
  border-color: var(--primary-color);
}

/* Table */
.table-wrapper {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.products-table {
  width: 100%;
  border-collapse: collapse;
}

.products-table thead {
  background: rgba(0, 141, 210, .15);
}

.products-table th {
  padding: 18px 20px;
  text-align: left;
  font-weight: 900;
  color: var(--text-primary);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.products-table .expand-col {
  width: 54px;
  text-align: center;
}

.products-table tbody tr.product-row {
  border-bottom: 1px solid rgba(0, 0, 0, .05);
  cursor: pointer;
  transition: var(--transition);
}

.products-table tbody tr.product-row:hover {
  background: rgba(0, 141, 210, .08);
}

.products-table tbody tr.product-row.expanded {
  background: rgba(0, 141, 210, .12);
}

.products-table td {
  padding: 18px 20px;
  color: var(--text-primary);
  font-size: var(--step-0);
}

.expand-icon {
  display: inline-block;
  transition: var(--transition);
  font-size: var(--step-1);
  color: var(--primary-color);
}

.product-row.expanded .expand-icon {
  transform: rotate(90deg);
}

/* Details panel */
.details-row {
  display: none;
}

.details-row.show {
  display: table-row;
}

.details-cell {
  padding: 0 !important;
  background: rgba(0, 141, 210, .06);
}

.details-content {
  padding: clamp(18px, 2.5vw, 32px);
  animation: slideDown .28s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: clamp(12px, 1.6vw, 24px);
}

.detail-item {
  background: rgba(255, 255, 255, .55);
  border-radius: 12px;
  padding: clamp(14px, 1.8vw, 20px);
  border: 1px solid rgba(255, 255, 255, .55);
}

.detail-title {
  font-size: var(--step-0);
  font-weight: 900;
  color: var(--primary-color);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-text {
  font-size: var(--step--1);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  font-size: var(--step--1);
  font-weight: 900;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  line-height: 1.1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--well-blue), var(--secondary-color));
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: rgba(0, 141, 210, .12);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
  background: rgba(0, 141, 210, .2);
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 24, .75);
  backdrop-filter: blur(2px);
}

.modal-content {
  position: relative;
  z-index: 1;
  border: 0;
  box-shadow: none;
  width: auto;
  max-width: min(96vw, 960px);
  max-height: 92vh;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 14px;
}

#modalImage {
  width: 100%;
  height: auto;
  max-height: 84vh;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .22);
}

.modal-actions .btn {
  min-width: 150px;
}

/* ---------- Footer ---------- */
.footer {
  background: rgba(255, 255, 255, .1);
  text-align: center;
  padding: 0.5rem;
  color: #fff;
  font-size: .9rem;
  backdrop-filter: blur(6px);
  margin-top: auto;
  /* sticky footer */
}

/* ---------- Subcategory (Form) Mini Cards ---------- */
.subcat-hint {
  display: none !important;
}

#subcatBar {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 6px 0 10px;
}

.subcat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  align-items: stretch;
  max-width: 1100px;
  margin: 0 auto;
}

.subcat-card {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  width: clamp(220px, 24vw, 280px);
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, .08);
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .86));
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.subcat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.subcat-card:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--well-blue) 40%, white);
  outline-offset: 2px;
}

.subcat-card .ico {
  inline-size: 40px;
  block-size: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
  background: linear-gradient(135deg, rgba(0, 141, 210, .16), rgba(111, 123, 255, .16));
  border: 1px solid rgba(0, 0, 0, .06);
}

.subcat-card .txt {
  display: grid;
  gap: 2px;
}

.subcat-card .label {
  font-weight: 900;
  color: var(--text-primary);
  font-size: var(--step--1);
}

.subcat-card .mini {
  font-size: 12px;
  color: var(--text-light);
}

.subcat-card .count {
  justify-self: end;
  font-size: 11px;
  font-weight: 900;
  color: var(--primary-color);
  background: rgba(0, 141, 210, .10);
  border: 1px solid rgba(0, 141, 210, .25);
  padding: 4px 8px;
  border-radius: 999px;
}

.subcat-card[aria-pressed="true"] {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--well-blue), var(--secondary-color));
  box-shadow: var(--shadow-md);
}

.subcat-card[aria-pressed="true"] .ico {
  background: rgba(255, 255, 255, .22);
  border-color: rgba(255, 255, 255, .25);
  color: #fff;
}

.subcat-card[aria-pressed="true"] .label,
.subcat-card[aria-pressed="true"] .mini {
  color: #fff;
}

.subcat-card[aria-pressed="true"] .count {
  background: rgba(255, 255, 255, .22);
  color: #fff;
  border-color: rgba(255, 255, 255, .28);
}

/* ---------- Transparent GIF cards (no frame) ---------- */
.full-gif-card,
.category-card.no-frame {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.full-gif-card::after,
.category-card.no-frame::after {
  display: none !important;
}

.full-gif-card:hover,
.category-card.no-frame:hover {
  transform: none !important;
  box-shadow: none !important;
}

.full-gif-card img {
  border-radius: 20px;
}

/* ---------- Pro Sidebar Look & Feel ---------- */
.sidebar.pro {
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .28), transparent 60%),
    linear-gradient(160deg, rgba(255, 255, 255, .86) 0%, rgba(255, 255, 255, .75) 60%, rgba(255, 255, 255, .68) 100%);
  left: 0;
  /* ensure left side */
  border-right: 1px solid rgba(255, 255, 255, .5);
  /* ⬅️ changed */
  box-shadow: 8px 0 30px rgba(10, 20, 40, .18), 0 1px 0 rgba(255, 255, 255, .45) inset;
  /* ⬅️ flip shadow */
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.sidebar.pro .sidebar-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .75));
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .06);
  padding: 10px 14px;
  min-height: 56px;
}

.sidebar.pro .sidebar-header h2 {
  margin: 0;
  font-size: clamp(1.05rem, 1.2vw, 1.35rem);
  line-height: 1.2;
  letter-spacing: .2px;
}

.sidebar.pro .close-sidebar {
  inline-size: 32px;
  block-size: 32px;
  font-size: 20px;
  border-radius: 8px;
}

.sidebar.pro .sidebar-nav {
  padding: 10px 12px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, .2) transparent;
}

.sidebar.pro .sidebar-nav::-webkit-scrollbar {
  width: 8px;
}

.sidebar.pro .sidebar-nav::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, .12));
  border-radius: 999px;
}

.sidebar.pro .sidebar-link {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr 18px;
  align-items: center;
  gap: 10px;
  margin: 8px 4px;
  padding: 12px 14px;
  text-decoration: none;
  font-weight: 700;
  color: var(--text-primary);
  background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .82));
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
  overflow: hidden;
}

.sidebar.pro .sidebar-link::before {
  content: attr(data-icon);
  display: grid;
  place-items: center;
  inline-size: 36px;
  block-size: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(0, 141, 210, .16), rgba(111, 123, 255, .16));
  border: 1px solid rgba(0, 0, 0, .08);
  font-size: 18px;
}

.sidebar.pro .sidebar-link::after {
  content: "›";
  justify-self: end;
  font-size: 18px;
  color: color-mix(in oklab, var(--well-blue) 65%, #2a2f45);
  opacity: .7;
  transition: transform .25s ease, opacity .25s ease;
}

.sidebar.pro .sidebar-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.sidebar.pro .sidebar-link:hover::after {
  transform: translateX(2px);
  opacity: 1;
}

.sidebar.pro .sidebar-link:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--well-blue) 40%, white);
  outline-offset: 2px;
}

.sidebar.pro .sidebar-link.active {
  color: #0f1b2e;
  background: linear-gradient(135deg, rgba(0, 141, 210, .14), rgba(111, 123, 255, .18));
  border-color: color-mix(in oklab, var(--well-blue) 35%, white);
  box-shadow: 0 10px 26px rgba(0, 141, 210, .18);
}

.sidebar.pro .sidebar-link.active::after {
  opacity: 1;
  transform: translateX(2px);
}

.sidebar.pro .sidebar-link.active .nav-label {
  color: var(--primary-color);
}

.sidebar.pro .sidebar-link.active:before {
  background: linear-gradient(135deg, rgba(0, 141, 210, .25), rgba(111, 123, 255, .25));
}

.sidebar.pro.reveal .sidebar-link {
  opacity: 0;
  transform: translateX(14px);
  animation: sideIn .42s cubic-bezier(.2, .6, .2, 1) forwards;
  animation-delay: var(--reveal-delay, 0ms);
}

@keyframes sideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.sidebar.pro .back-home {
  margin-top: 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .78));
  border-top: 1px solid rgba(0, 0, 0, .06);
  padding: 16px var(--space-5);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Category hero logo button ---------- */
/* ---------- Category hero logo button ---------- */
.brand-home {
  position: absolute;
  top: clamp(14px, 2.4vw, 22px);

  /* CHANGE THIS */
  /* left: clamp(14px, 2.4vw, 22px);  ❌ REMOVE */

  right: clamp(14px, 2.4vw, 22px);
  /* ✅ NEW POSITION ON RIGHT */

  z-index: 5;
  display: grid;
  place-items: center;
  width: clamp(38px, 6.2vw, 70px);
  height: clamp(38px, 6.2vw, 70px);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .82));
  border: 1px solid rgba(255, 255, 255, .65);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}


.brand-home:hover {
  transform: translateY(-1px);
}

.brand-home:focus-visible {
  outline: 3px solid rgba(0, 141, 210, .35);
  outline-offset: 2px;
}

.brand-home img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .04));
}

/* ---------- Product Categories heading colors on gradient ---------- */
.categories-section .section-title {
  color: #fff;
  text-shadow: 0 10px 24px rgba(0, 0, 0, .20), 0 1px 0 rgba(255, 255, 255, .25);
}

.categories-section .section-subtitle {
  color: rgba(255, 255, 255, .92);
  font-weight: 400;
  text-shadow: 0 6px 18px rgba(0, 0, 0, .16);
}

@media (prefers-contrast: less) {
  .categories-section .section-title {
    text-shadow: 0 6px 16px rgba(0, 0, 0, .16);
  }

  .categories-section .section-subtitle {
    text-shadow: 0 4px 12px rgba(0, 0, 0, .14);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .page-title {
    font-size: clamp(1.6rem, 4.6vw, 2.25rem);
  }

  .page-subtitle {
    font-size: var(--step--1);
  }
}

@media (max-width: 768px) {
  .table-wrapper {
    overflow-x: visible !important;
  }

  .products-table {
    min-width: 0 !important;
  }

  .hero-brand {
    flex-direction: column;
    text-align: center;
    gap: .8rem;
    padding: 1.2rem 1.4rem;
  }

  .brand-mark {
    width: 80px;
  }

  .brand-name {
    font-size: 1.8rem;
    text-align: center;
  }

  .brand-tag {
    font-size: .95rem;
    text-align: center;
  }

  .full-gif-card {
    border-radius: 14px;
  }
}

@media (max-width: 560px) {

  html,
  body {
    overflow-x: hidden !important;
  }

  .container {
    padding-inline: 14px;
  }

  .table-controls {
    flex-direction: column;
    gap: 10px;
  }

  .search-input {
    width: 100%;
    padding: 12px 14px;
    font-size: var(--step--1);
  }

  .sort-btn {
    width: 100%;
    padding: 12px 14px;
    font-size: var(--step--1);
  }

  .products-table thead {
    display: none;
  }

  .products-table,
  .products-table tbody,
  .products-table tr,
  .products-table td {
    display: block;
    width: 100%;
  }

  .products-table tbody tr.product-row {
    background: rgba(255, 255, 255, .68);
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(16, 24, 40, .08);
    backdrop-filter: blur(10px);
    padding: 12px 14px 8px;
    margin: 14px 0;
    transition: transform .18s ease, box-shadow .18s ease;
  }

  .products-table tbody tr.product-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(16, 24, 40, .10);
  }

  .products-table tbody tr.product-row td {
    padding: 8px 0;
    border: 0;
    font-size: var(--step--1);
    color: #1b2430;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .products-table tbody tr.product-row td:nth-child(1)::before,
  .products-table tbody tr.product-row td:nth-child(2)::before {
    display: block;
    font-weight: 800;
    font-size: 11.5px;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 4px;
  }

  .products-table tbody tr.product-row td:nth-child(1)::before {
    content: "Product Name";
  }

  .products-table tbody tr.product-row td:nth-child(2)::before {
    content: "Composition";
  }

  .products-table tbody tr.product-row td.expand-col {
    text-align: right;
    padding-top: 6px;
  }

  .expand-icon {
    font-size: 18px;
    color: var(--primary-color);
  }

  .details-row {
    display: none;
  }

  .details-row.show {
    display: block;
  }

  .details-cell {
    padding: 0 !important;
  }

  .details-content {
    margin: 10px 0 2px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(0, 141, 210, .10);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
  }

  .details-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .detail-item {
    padding: 12px;
  }

  .detail-title {
    font-size: 15.5px;
    color: #334155;
    margin-bottom: 6px;
  }

  .detail-text {
    font-size: 13.5px;
    color: #1f2937;
    line-height: 1.45;
  }

  .detail-actions {
    gap: 8px;
    flex-wrap: wrap;
  }

  .btn {
    padding: 8px 12px;
    font-size: 12.5px;
    border-radius: 999px;
  }

  /* modal small */
  .modal-content {
    max-width: 96vw;
  }

  #modalImage {
    max-height: 78vh;
  }

  .modal-actions .btn {
    min-width: 0;
    flex: 1;
  }

  /* spacing fixes */
  .page-header {
    padding: clamp(56px, 9vw, 84px) 16px clamp(18px, 4vw, 32px);
  }

  .back-link {
    margin-top: clamp(56px, 10vw, 64px);
  }
}

@media (max-width: 380px) {
  .page-title {
    font-size: clamp(1.2rem, 6.6vw, 1.5rem);
  }

  .btn {
    font-size: 12px;
    padding: 7px 10px;
  }

  .sidebar-toggle {
    inline-size: 44px;
    block-size: 44px;
  }

  .sidebar-toggle span {
    inline-size: 20px;
  }
}

@media (min-width: 1200px) {
  .container {
    width: min(1200px, 88vw);
  }
}

@media (min-width: 1600px) {
  .container {
    width: min(1400px, 74vw);
  }

  .categories-grid {
    gap: 28px;
  }

  .result-grid {
    gap: 18px;
  }
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== Mobile: subcategory cards 2-up (even on tiny phones) ===== */
@media (max-width: 560px) {

  /* make the row a 2-column grid */
  #subcatBar .subcat-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
    justify-items: stretch;
  }

  /* kill the big min-width and let cards shrink */
  #subcatBar .subcat-card {
    width: auto !important;
    /* override clamp width */
    padding: 10px 12px;
    border-radius: 12px;
  }

  /* compact internals so two fit comfortably */
  #subcatBar .subcat-card .ico {
    inline-size: 34px;
    block-size: 34px;
    font-size: 18px;
  }

  #subcatBar .subcat-card .label {
    font-size: 13px;
  }

  #subcatBar .subcat-card .mini {
    font-size: 11px;
  }

  #subcatBar .subcat-card .count {
    font-size: 10px;
    padding: 3px 6px;
  }
}

/* ultra-narrow devices: tighten a bit more */
@media (max-width: 360px) {
  #subcatBar .subcat-card {
    padding: 8px 10px;
  }

  #subcatBar .subcat-card .ico {
    inline-size: 30px;
    block-size: 30px;
    font-size: 16px;
  }

  #subcatBar .subcat-card .label {
    font-size: 12.5px;
  }
}

/* ===== Wellspring Preloader ===== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .18), transparent 60%),
    linear-gradient(145deg, #0e2850, #2f2fa3 55%, #421fa9 85%);
  transition: opacity .4s ease, visibility .4s ease;
}

.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pl-card {
  width: min(380px, 86vw);
  padding: 20px 22px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .86));
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
  text-align: center;
}

.pl-logo {
  width: 64px;
  height: auto;
  margin: 0 auto 8px;
  display: block;
}

.pl-name {
  font-weight: 900;
  letter-spacing: .16em;
  color: #008dd2;
  font-size: clamp(1.1rem, 2.6vw, 1.35rem);
  margin-bottom: 12px;
}

.pl-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, .08);
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}

.pl-bar>span {
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #008dd2, #6f7bff);
  border-radius: 999px;
  animation: plSlide 1.1s ease-in-out infinite;
}

@keyframes plSlide {
  0% {
    transform: translateX(-60%);
  }

  50% {
    transform: translateX(40%);
  }

  100% {
    transform: translateX(160%);
  }
}

.pl-tip {
  margin: 10px 0 0;
  font-size: .95rem;
  color: #2a2f45;
  opacity: .8;
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .pl-bar>span {
    animation-duration: .01ms;
  }
}


/* Molecule wise catelouge */

.catalogue-entry {
  max-width: 760px;
  width: 92%;
  margin: 10px auto 30px;
  text-align: right;
}

.btn-catalogue {
  font-weight: 700;
  font-size: var(--step--1);
}

/* ---------- Molecule Catalogue (PDF Canvas) ---------- */

.catalogue-main {
  display: flex;
  flex-direction: column;
}

.catalogue-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.catalogue-header .brand-home {
  margin-right: var(--space-3);
}

.cat-header-text {
  display: flex;
  flex-direction: column;
}

.catalogue-viewer-section {
  padding: var(--space-4) 20px var(--space-7);
}

.pdf-shell {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, .4);
  padding: clamp(14px, 2vw, 20px);
  min-height: min(70vh, 80dvh);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pdf-title {
  font-size: var(--step-0);
  font-weight: 800;
  color: var(--text-primary);
}

.pdf-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-xs {
  padding: 6px 12px;
  font-size: var(--step--2);
  border-radius: 999px;
}

.page-info {
  font-size: var(--step--2);
  color: var(--text-secondary);
}

/* Full-screen style canvas viewer */
.pdf-viewer {
  margin-top: 8px;
  flex: 1;
  /* background: #0b2038; */
  border-radius: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(8px, 1.6vw, 16px);
  overflow: auto;
}

#pdfCanvas {
  max-width: 100%;
  height: auto;
  display: block;
  /* box-shadow: 0 12px 30px rgba(0, 0, 0, .6); */
  /* border-radius: 6px; */
  background: #111827;
}

/* make the toggle visually more "catalogue" style if you want */
.sidebar-toggle.catalogue-toggle {
  right: auto;
  left: max(16px, env(safe-area-inset-left));
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .catalogue-header {
    flex-direction: row;
    align-items: center;
  }

  .pdf-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .pdf-viewer {
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .pdf-shell {
    padding: 10px;
  }

  .catalogue-header .brand-home img {
    width: 36px;
    height: 36px;
  }

  .pdf-title {
    font-size: var(--step--1);
  }
}

/* Center wrapper */
.catalogue-center {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

/* Premium button style (no underline, soft neumorphic) */
.catalogue-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  font-size: var(--step--1);
  font-weight: 700;
  color: #0c3c78;
  text-decoration: none !important;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: 0.25s ease;
}

/* Hover + focus animation */
.catalogue-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.22);
  color: #0850af;
}

/* Active click */
.catalogue-btn:active {
  transform: translateY(0);
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.18),
    inset 0 2px 2px rgba(255, 255, 255, 0.6);
}

/* Responsive fine-tuning for very small screens */
@media (max-width: 480px) {
  .catalogue-btn {
    font-size: var(--step--2);
    padding: 12px 20px;
    gap: 6px;
  }
}

/* Compact Molecule Cards */
.compact-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.compact-card {
  padding: 18px 20px;
  border-radius: 22px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffffcc;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: all .25s ease;
  cursor: pointer;
}

.compact-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

/* Icon */
.compact-card .card-icon {
  font-size: 34px;
  margin-right: 10px;
}

/* Title */
.compact-card .card-title {
  font-size: 1.05rem;
  font-weight: 700;
  flex: 1;
  color: var(--primary-blue);
}

/* Arrow */
.compact-card .card-arrow {
  font-size: 20px;
  font-weight: 700;
  opacity: 0.7;
}

/* Responsive */
@media (max-width: 480px) {
  .compact-card {
    padding: 16px;
    border-radius: 18px;
  }

  .compact-card .card-title {
    font-size: 0.95rem;
  }

  .compact-card .card-icon {
    font-size: 30px;
  }
}

/* --- Ultra-Compact Capsule Cards --- */

.molecule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

/* Capsule card */
.molecule-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  height: 64px;
  /* VERY SMALL HEIGHT */
  border-radius: 40px;
  /* CAPSULE SHAPE */
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-decoration: none;
  color: #0c3c78;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: .25s ease;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

/* Hover effect */
.molecule-chip:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

/* Icon */
.chip-icon {
  font-size: 28px;
  flex-shrink: 0;
}

/* Title */
.chip-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Arrow */
.chip-arrow {
  font-size: 18px;
  opacity: 0.7;
}

/* RESPONSIVE */
@media (max-width: 480px) {
  .molecule-chip {
    height: 56px;
    padding: 12px 16px;
    border-radius: 32px;
  }

  .chip-title {
    font-size: 0.9rem;
  }

  .chip-icon {
    font-size: 24px;
  }
}

.pdf-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pdf-subtitle {
  font-size: 0.8rem;
  opacity: 0.75;
}

/* -------- Molecule PDF modal layout -------- */

.pdf-shell {
  width: min(480px, 100%);
  max-height: 90vh;
  margin: 0 auto;
  padding: 18px;
  border-radius: 24px;
  background: var(--bg-glass, rgba(255, 255, 255, 0.96));
  box-shadow: 0 18px 60px rgba(10, 31, 68, 0.32);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.viewer-title {
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
  margin: 4px 0 0;
  color: var(--text-heading, #08233a);
  display: none;
}

/* Canvas container – same “tall narrow” feeling as product modal */
.pdf-viewer {
  flex: 1 1 auto;
  height: min(70vh, 78dvh);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* no inner scroll */
  border-radius: 16px;
  /* background: #0a2030; */
}

/* Let PDF.js resize inside that box */
#pdfCanvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  height: auto;
}

/* Bottom controls */
.pdf-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.9rem;
  color: #4b5b70;
}

.pdf-actions {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

/* -------- Molecule PDF modal layout (bigger PDF, lighter chrome) -------- */

.pdf-shell {
  width: min(720px, 98vw);
  /* wider card */
  max-height: 96vh;
  /* almost full viewport */
  margin: 0 auto;
  padding: 8px 10px 6px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 60px rgba(10, 31, 68, 0.35);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.viewer-title {
  font-size: 1.15rem;
  /* a bit smaller than before */
  font-weight: 700;
  text-align: center;
  margin: 2px 0 4px;
  color: var(--text-heading, #08233a);
}

/* Big, tall area for PDF – no inner scroll */
.pdf-viewer {
  flex: 1 1 auto;
  height: min(88vh, 94dvh);
  /* take almost all height */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 20px;
  /* background: #0a2030;                  dark frame */
  padding: 4px;
  /* very thin bezel */
}

#pdfCanvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  height: auto;
}

/* Bottom controls – compact */
.pdf-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #4b5b70;
  margin-top: 2px;
}

.pdf-pagination .btn {
  padding: 4px 14px;
  font-size: 0.82rem;
}

.pdf-actions {
  display: flex;
  justify-content: center;
  margin-top: 2px;
}

/* Small close icon button inside modal */
.modal-close-icon {
  position: absolute;
  top: 25px;
  right: 18px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #333;
  font-size: 30px;
  font-weight: bold;
  line-height: 34px;
  text-align: center;
  cursor: pointer;
  z-index: 50;
  /* box-shadow: 0px 3px 12px rgba(0, 0, 0, 0.18); */
  transition: all 0.2s ease-in-out;
}

.modal-close-icon:hover {
  background: #fff;
  transform: scale(1.1);
}

#pdfCanvas {
  transition: opacity 0.18s ease-out;
}

.pdf-page-fade {
  opacity: 0;
}

.categories-grid.molecule-grid {
    margin-bottom: 90px;
}

/* ===== Molecule PDF viewer (vertical scroll) ===== */
.pdf-shell {
  max-width: 350px;
  margin: 0 auto;
}

.pdf-viewer {
    max-height: calc(100vh - 160px); /* adjust if needed */
    overflow-y: auto;                /* vertical scroll */
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* each page container */
.pdf-page-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

/* the page canvas itself */
.pdf-page-canvas {
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(15, 52, 96, 0.4);
}

/* PDF viewer inside molecule modal – allow vertical scroll */
.pdf-viewer {
  margin-top: 8px;
  max-height: 80vh;
  overflow: auto;
  padding: clamp(8px, 1.6vw, 16px);
  /* vertical stack of pages */
  display: block;
  background: transparent;
}

/* Make sure canvas behaves nicely */
#pdfCanvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.pdf-page-container {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

.pdf-page-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: #111827;
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

/* Make the PDF modal a bit smaller than the image modal on desktop */
#pdfModal .modal-content {
  max-width: min(90vw, 720px);  /* narrower than 960px */
  max-height: 90vh;             /* keep some margin top/bottom */
}

/* Let content define the height, no forced tall shell */
#pdfModal .pdf-shell {
  min-height: auto;
}

/* Vertical, scrollable viewer area */
#pdfModal .pdf-viewer {
  margin-top: 8px;
  max-height: 70vh;                      /* page fits comfortably */
  overflow: auto;
  padding: clamp(8px, 1.6vw, 16px);
  display: block;
  background: transparent;
}

/* Each page block */
.pdf-page-container {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

/* Actual PDF page canvas */
.pdf-page-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: #111827;
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

/* ===== Default (mobile / tablet) behaviour ===== */

#pdfModal .modal-content {
  /* Close to your old behaviour: almost full screen on small devices */
  max-width: 96vw;
  max-height: 96vh;
}

#pdfModal .pdf-shell {
  min-height: auto;
}

#pdfModal .pdf-viewer {
  margin-top: 8px;
  max-height: 80vh;
  overflow: auto;
  padding: 8px;
  display: block;
  background: transparent;
}

.pdf-page-container {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

.pdf-page-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: #111827;
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

/* ===== Desktop overrides ONLY (>= 1024px) ===== */

@media (min-width: 1024px) {
  #pdfModal .modal-content {
    max-width: min(90vw, 720px); /* smaller, centered modal */
    max-height: 90vh;
  }

  #pdfModal .pdf-viewer {
    max-height: 70vh;            /* so one page fits nicely */
    padding: 12px 16px;
  }
}

/* ---------- PDF modal: behave like image modal ---------- */

/* Use the same general modal sizing as image viewer */
#pdfModal .modal-content {
  /* inherit from .modal-content, so no extra white space tricks */
  max-width: min(96vw, 960px);
  max-height: 92vh;
}

/* Shell doesn't enforce weird heights */
#pdfModal .pdf-shell {
  min-height: auto;
}

/* Viewer area: same feeling as #modalImage (tall, almost full screen) */
#pdfModal .pdf-viewer {
  margin-top: 8px;
  max-height: 84vh;         /* same as #modalImage */
  overflow: auto;
  padding: 0 12px;
  display: block;
  background: transparent;
}

/* Each page centered like the big product image */
.pdf-page-container {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

/* Actual PDF page canvas = acts like #modalImage */
.pdf-page-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

