/* ==========================================================================
   INSTASHIELD - LEGAL & CERTIFICATIONS PAGE STYLESHEET
   css/legal.css
   ========================================================================== */

/* LEGAL HERO (DARK THEME - SAME AS HOME, ABOUT, PRODUCT & GALLERY) */
.legal-hero {
  position: relative;
  min-height: 440px;
  padding: 180px 0 80px;
  text-align: center;
  background: radial-gradient(ellipse 70% 60% at 50% 30%, rgba(49, 199, 232, 0.18), transparent 70%),
              radial-gradient(ellipse 50% 50% at 85% 65%, rgba(8, 118, 185, 0.15), transparent 60%),
              linear-gradient(135deg, var(--midnight) 0%, var(--navy) 50%, var(--midnight) 100%);
  color: var(--white);
  overflow: hidden;
}

.legal-hero .wrap {
  position: relative;
  z-index: 2;
  max-width: 850px;
}

.legal-hero .eyebrow {
  color: var(--cyan);
}

.legal-hero h1 {
  font-size: clamp(38px, 5vw, 60px);
  color: #ffffff;
  margin: 10px 0 16px;
}

.legal-hero p.sub {
  font-size: clamp(16px, 1.8vw, 20px);
  color: #cfe3ee;
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
}

/* LEGAL MAIN SECTION (LIGHT THEME LIKE .how & .corporate-sec) */
.legal-section {
  position: relative;
  padding: 80px 0 120px;
  background: linear-gradient(180deg, var(--ice) 0%, #ffffff 100%);
  color: var(--navy);
  margin-top: -40px;
  border-radius: 54px 54px 0 0;
  z-index: 3;
}

/* LEGAL CONTENT BLOCKS (UNIFIED CONTINUOUS FLOW) */
.legal-block {
  position: relative;
  margin-bottom: 24px;
}

.legal-block-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 38px;
}

.legal-block-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  background: rgba(8, 118, 185, 0.09);
  border: 1px solid rgba(8, 118, 185, 0.22);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.legal-block-header h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 10px;
  line-height: 1.25;
}

.legal-block-header p {
  font-size: 15px;
  color: #4a6c84;
  line-height: 1.6;
}

.legal-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(8, 118, 185, 0.18), transparent);
  margin: 64px auto;
  max-width: 900px;
}

/* Fallback for any legacy pane */
.legal-pane {
  display: block;
}

/* ==========================================================================
   MINIMAL DOCUMENT CARDS (OPTION A: IMAGE + TITLE + VIEW BUTTON)
   ========================================================================== */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 30px;
}

.doc-card {
  background: #ffffff;
  border: 1px solid rgba(8, 118, 185, 0.16);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(6, 43, 73, 0.06);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  display: flex;
  flex-direction: column;
}

.doc-card:hover {
  transform: translateY(-8px);
  border-color: var(--cyan);
  box-shadow: 0 22px 48px rgba(8, 118, 185, 0.16), 0 0 25px rgba(49, 199, 232, 0.18);
}

/* Document Thumbnail Container */
.doc-preview {
  position: relative;
  height: 380px;
  background: linear-gradient(180deg, #f0f6fa 0%, #e3eef6 100%);
  padding: 16px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.doc-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(6, 43, 73, 0.12);
  transition: transform 0.4s ease;
}

.doc-card:hover .doc-img {
  transform: scale(1.03);
}

/* Hover Overlay on Image */
.doc-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 21, 34, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  cursor: pointer;
}

.doc-card:hover .doc-hover-overlay {
  opacity: 1;
}

.doc-hover-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: var(--navy);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  padding: 10px 22px;
  border-radius: 999px;
  border: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.doc-hover-btn:hover {
  transform: scale(1.05);
  background: var(--ice);
  color: var(--blue);
}

/* Document Card Footer */
.doc-footer {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
  border-top: 1px solid rgba(8, 118, 185, 0.1);
}

.doc-title {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--navy);
  margin: 0;
  line-height: 1.3;
}

.doc-btn-view {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(100deg, var(--blue), var(--cyan));
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(8, 118, 185, 0.28);
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.doc-btn-view:hover {
  transform: translateX(3px);
  box-shadow: 0 6px 20px rgba(49, 199, 232, 0.45);
}

/* Legacy cert-card support if needed */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

/* PATENTS & IP CARDS */
.ip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.ip-card {
  background: #ffffff;
  border: 1px solid rgba(8, 118, 185, 0.16);
  border-radius: 28px;
  padding: 38px 32px;
  box-shadow: 0 12px 36px rgba(6, 43, 73, 0.06);
}

.ip-card h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 12px;
}

.ip-card p {
  font-size: 15px;
  color: #4b6d85;
  line-height: 1.65;
  margin-bottom: 20px;
}

.ip-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ip-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: #274861;
  font-weight: 600;
}

.ip-points li svg {
  width: 18px;
  height: 18px;
  color: var(--blue);
  flex-shrink: 0;
  margin-top: 2px;
}

/* COMPLIANCE & SAFETY STANDARDS GRID */
.compliance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.comp-box {
  background: #ffffff;
  border: 1px solid rgba(8, 118, 185, 0.16);
  border-radius: 24px;
  padding: 32px 24px;
  box-shadow: 0 10px 28px rgba(6, 43, 73, 0.05);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.comp-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(49, 199, 232, 0.12);
  color: var(--blue);
  margin-bottom: 18px;
}

.comp-icon svg {
  width: 28px;
  height: 28px;
}

.comp-box h4 {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 10px;
}

.comp-box p {
  font-size: 14px;
  color: #55758c;
  line-height: 1.55;
}

/* WARRANTY & TERMS ACCORDION */
.warranty-card {
  background: #ffffff;
  border: 1px solid rgba(8, 118, 185, 0.18);
  border-radius: 28px;
  padding: 40px;
  box-shadow: 0 14px 40px rgba(6, 43, 73, 0.06);
  max-width: 900px;
  margin: 0 auto;
}

.warranty-card h3 {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 16px;
}

.warranty-card p {
  font-size: 15px;
  color: #4b6d85;
  line-height: 1.7;
  margin-bottom: 20px;
}

.warranty-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.warranty-table th,
.warranty-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(8, 118, 185, 0.14);
  font-size: 14px;
}

.warranty-table th {
  color: var(--navy);
  font-weight: 800;
  background: var(--ice);
}

.warranty-table td {
  color: #3f6078;
}

/* ==========================================================================
   CERTIFICATE DETAIL MODAL
   ========================================================================== */
/* ==========================================================================
   DOCUMENT LIGHTBOX / POPUP MODAL (NEXT / PREV NAVIGATION)
   ========================================================================== */
.doc-lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.doc-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.doc-lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 18, 30, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1;
}

.doc-lightbox-panel {
  position: relative;
  z-index: 2;
  background: rgba(4, 25, 41, 0.98);
  border: 1px solid rgba(49, 199, 232, 0.35);
  border-radius: 24px;
  width: 100%;
  max-width: 880px;
  max-height: calc(100vh - 48px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 50px rgba(8, 118, 185, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: auto;
  transform: scale(0.96);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: #ffffff;
  box-sizing: border-box;
}

.doc-lightbox.active .doc-lightbox-panel {
  transform: scale(1);
}

/* Lightbox Header Bar - STAYS FULLY VISIBLE, NEVER CLIPPED */
.doc-lightbox-bar {
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(2, 16, 27, 0.92);
  flex-shrink: 0;
  min-height: 58px;
  box-sizing: border-box;
}

.doc-lightbox-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.doc-lightbox-title {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-lightbox-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(49, 199, 232, 0.12);
  border: 1px solid rgba(49, 199, 232, 0.3);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.doc-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.doc-lightbox-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(49, 199, 232, 0.1);
  border: 1px solid rgba(49, 199, 232, 0.35);
  padding: 7px 15px;
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1;
}

.doc-lightbox-open-btn:hover {
  background: rgba(49, 199, 232, 0.22);
  border-color: var(--cyan);
  transform: translateY(-1px);
}

.doc-lightbox-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.doc-lightbox-close:hover {
  background: #ef4444;
  border-color: #ef4444;
  transform: rotate(90deg);
}

/* Lightbox Stage */
.doc-lightbox-stage {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 14px 18px;
  min-height: 0;
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(8, 118, 185, 0.12), transparent 70%);
  box-sizing: border-box;
}

.doc-stage-img-wrap {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
}

.doc-stage-img {
  max-width: 100%;
  max-height: min(52vh, 460px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.65);
  background: #ffffff;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.doc-stage-img.fade-out {
  opacity: 0;
  transform: scale(0.97);
}

.doc-stage-nav {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(4, 25, 41, 0.9);
  border: 1px solid rgba(49, 199, 232, 0.45);
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: all 0.25s ease;
  z-index: 5;
  flex-shrink: 0;
}

.doc-stage-nav:hover {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-color: transparent;
  transform: scale(1.1);
  box-shadow: 0 10px 28px rgba(49, 199, 232, 0.4);
}

/* Lightbox Thumbnails Strip */
.doc-lightbox-thumbs {
  padding: 10px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(2, 14, 23, 0.88);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  justify-content: center;
  scrollbar-width: thin;
  flex-shrink: 0;
  box-sizing: border-box;
}

.doc-thumb-item {
  width: 38px;
  height: 50px;
  border-radius: 6px;
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.45;
  transition: all 0.2s ease;
  flex-shrink: 0;
  background: #ffffff;
}

.doc-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doc-thumb-item:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

.doc-thumb-item.active {
  border-color: var(--cyan);
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(49, 199, 232, 0.55);
}

@media (max-width: 640px) {
  .doc-lightbox {
    padding: 12px 8px;
  }

  .doc-lightbox-panel {
    max-height: calc(100vh - 24px);
    border-radius: 18px;
  }

  .doc-lightbox-stage {
    padding: 10px 6px;
  }

  .doc-stage-nav {
    width: 38px;
    height: 38px;
  }

  .doc-stage-img {
    max-height: 46vh;
  }

  .doc-lightbox-bar {
    padding: 10px 14px;
    min-height: 50px;
  }

  .doc-lightbox-title {
    font-size: 15px;
  }

  .doc-lightbox-open-btn {
    padding: 5px 10px;
    font-size: 11.5px;
  }

  .doc-lightbox-thumbs {
    justify-content: flex-start;
  }
}

/* RESPONSIVE DESIGN */
@media (max-width: 900px) {
  .ip-grid,
  .compliance-grid {
    grid-template-columns: 1fr;
  }

  .cert-modal-dialog {
    padding: 28px 20px;
  }
}

@media (max-width: 640px) {
  .certs-grid {
    grid-template-columns: 1fr;
  }

  .warranty-card {
    padding: 26px 18px;
  }
}
