/* ===== Product pop-up (blue theme) — used on Home and Products pages ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(4, 12, 32, 0.8);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s ease, visibility 0s linear .25s;
}
.modal-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}
.modal {
  position: relative;
  width: 100%;
  max-width: 880px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #fff;
  border-radius: 22px;
  background: linear-gradient(165deg, #12306d 0%, #0B1F4B 58%, #081a40 100%);
  box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(127,184,232,.28);
  transform: translateY(24px) scale(.97);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.modal-overlay.open .modal { transform: none; }
.modal-dynamic-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 6;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.32);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.modal-close:hover, .modal-close:focus-visible { background: #2F80D0; transform: scale(1.08); outline: none; }

/* header: photo + category + title */
.modal-head {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-shrink: 0;
  padding: 26px 70px 22px 30px;
  background:
    radial-gradient(circle at 0 0, rgba(47,128,208,.6), transparent 62%),
    linear-gradient(135deg, #1E4FA3, #0B1F4B);
  border-bottom: 1px solid rgba(127,184,232,.28);
}
.modal-head-img {
  width: 112px; height: 140px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,.35);
  box-shadow: 0 10px 26px rgba(0,0,0,.4);
}
.modal-category {
  margin: 0 0 .4rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #7FB8E8;
}
.modal-title {
  margin: 0;
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  line-height: 1.25;
  font-weight: 700;
  color: #fff;
}

/* scrolling content */
.modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 30px 28px;
  scrollbar-width: thin;
  scrollbar-color: rgba(127,184,232,.5) transparent;
}

/* tabs */
.tab-nav {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  gap: 8px;
  margin: 0 0 20px;
  padding: 16px 0 14px;
  overflow-x: auto;
  background: #0d2558;
  border-bottom: 1px solid rgba(127,184,232,.2);
}
.tab-btn {
  flex-shrink: 0;
  padding: .55em 1.2em;
  border-radius: 999px;
  border: 1px solid rgba(127,184,232,.3);
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.78);
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s, color .2s, transform .2s;
}
.tab-btn:hover { background: rgba(127,184,232,.2); color: #fff; }
.tab-btn.active {
  background: linear-gradient(135deg, #2F80D0, #1E4FA3);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(47,128,208,.4);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: modalFade .25s ease; }
@keyframes modalFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* overview text */
.modal-overview p, .tab-panel > p {
  margin: 0 0 1rem;
  font-size: .97rem;
  line-height: 1.75;
  color: rgba(255,255,255,.86);
}
.tab-panel a { color: #7FB8E8; }

/* key features */
.features-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.feature-item {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .7em .9em;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(127,184,232,.18);
  font-size: .9rem;
  line-height: 1.45;
  color: rgba(255,255,255,.92);
}
.feature-item::before {
  content: '✓';
  display: inline-flex;
  align-items: center; justify-content: center;
  flex: 0 0 20px;
  width: 20px; height: 20px;
  margin-top: .05rem;
  border-radius: 50%;
  background: #2F80D0;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
}

/* specification + ordering tables */
.spec-table, .ordering-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(127,184,232,.25);
  font-size: .9rem;
}
.spec-table th, .spec-table td,
.ordering-table th, .ordering-table td {
  padding: .7em 1em;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(127,184,232,.16);
}
.spec-table tr:last-child th, .spec-table tr:last-child td,
.ordering-table tr:last-child td { border-bottom: 0; }
.spec-table th {
  width: 38%;
  font-weight: 600;
  color: #7FB8E8;
  background: rgba(47,128,208,.14);
}
.spec-table td { color: rgba(255,255,255,.9); background: rgba(255,255,255,.04); }
.ordering-table th {
  background: linear-gradient(135deg, #2F80D0, #1E4FA3);
  color: #fff;
  font-weight: 600;
}
.ordering-table td { color: rgba(255,255,255,.9); background: rgba(255,255,255,.04); }

@media (max-width: 600px) {
  .modal-overlay { padding: .6rem; }
  .modal { max-height: 92vh; border-radius: 18px; }
  .modal-head { gap: 14px; padding: 20px 60px 16px 18px; }
  .modal-head-img { width: 76px; height: 96px; border-radius: 10px; }
  .modal-body { padding: 0 18px 22px; }
  .spec-table th { width: 44%; }
}
@media (prefers-reduced-motion: reduce) {
  .modal, .modal-overlay, .tab-panel.active { transition: none; animation: none; }
}

/* ---- Product pop-up additions: model, chips, photos, datasheet, enquiry ---- */
.modal-model { font-size: 0.85rem; color: var(--clr-text-mute); margin-bottom: 0.6rem; }
.modal-sub { font-size: 1rem; margin: 1.4rem 0 0.6rem; color: var(--heading); }
.modal-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 1rem 0 0.4rem; }
.mchip { font-size: 0.78rem; font-weight: 500; padding: 0.3em 0.8em; border-radius: 9999px; background: var(--clr-royal); color: #fff; }
.mchip-app { background: var(--surface-alt); color: var(--accent-text); border: 1px solid var(--border); }
.modal-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.6rem; margin-top: 1.2rem; }
.modal-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.modal-ds { margin: 1.4rem 0 0; }
.modal-ds img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); }
.modal-ds figcaption { font-size: 0.8rem; color: var(--clr-text-mute); margin-top: 0.4rem; }
.modal-cta { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.2rem; }
.modal-head-img { background: #EAF1FA; object-fit: contain; }
