/* ========== FOOTER.CSS ========== */

:root {
  --footer-bg: #0a1f44;
  --footer-bg-deep: #071630;
  --footer-text-white: #ffffff;
  --footer-text-offwhite: rgba(255, 255, 255, 0.85);
  --footer-text-muted: rgba(255, 255, 255, 0.55);
  --footer-border: rgba(255, 255, 255, 0.12);
  --footer-link-hover: #3aa8ff;
  --footer-accent: #1db954;
  --content-width: 1280px;
  --font-body: system-ui, 'Segoe UI', 'Helvetica Neue', sans-serif;
  --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
}

#site-footer {
  background: var(--footer-bg);
  color: var(--footer-text-white);
  font-family: var(--font-body);
  line-height: 1.6;
  margin-top: auto;
}

/* ===== CERTIFICATIONS STRIP ===== */
.footer-cert-strip {
  background: linear-gradient(135deg, #081729 0%, #0d2545 50%, #081729 100%);
  border-top: 3px solid rgba(58, 168, 255, 0.4);
  border-bottom: 1px solid var(--footer-border);
  padding: 2.5rem 2rem;
}

.footer-cert-inner {
  max-width: var(--content-width);
  margin: 0 auto;
}

.footer-cert-label {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--footer-text-muted);
  margin-bottom: 1.75rem;
}

.footer-cert-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Individual badge */
.cert-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.2s, border-color 0.2s;
  cursor: default;
}

.cert-badge:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Badge logo circle */
.cert-badge__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  line-height: 1;
}

.cert-badge--blue  .cert-badge__logo { background: #1b4f9a; border: 2px solid #2d6cc0; }
.cert-badge--green .cert-badge__logo { background: #1a7a3c; border: 2px solid #28a05a; }
.cert-badge--red   .cert-badge__logo { background: #8b1a1a; border: 2px solid #b52020; }
.cert-badge--orange .cert-badge__logo { background: #8b4a00; border: 2px solid #c46b00; }
.cert-badge--teal  .cert-badge__logo { background: #0e6655; border: 2px solid #17a589; }

.cert-badge__gcc {
  font-size: 0.45rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
}

.cert-badge__iso {
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.cert-badge__num {
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: -0.02em;
}

/* HACCP logo */
.cert-badge__logo--haccp {
  background: #0e6655;
  border: 2px solid #17a589;
  gap: 0.15rem;
}

.cert-badge__logo--haccp svg {
  width: 18px;
  height: 18px;
  color: #fff;
}

.cert-badge__haccp-text {
  font-size: 0.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.04em;
}

/* UNGM logo */
.cert-badge--ungm .cert-badge__logo {
  background: rgba(0, 74, 153, 0.6);
  border: 2px solid rgba(0, 122, 204, 0.6);
}

.cert-badge__logo--ungm svg {
  width: 28px;
  height: 28px;
  color: #fff;
}

/* JAS-ANZ */
.cert-badge--jasanz .cert-badge__logo {
  background: rgba(80, 80, 80, 0.5);
  border: 2px solid rgba(150, 150, 150, 0.4);
  width: 52px;
  height: 52px;
}

.cert-badge__jasanz-label {
  font-size: 0.55rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.06em;
  text-align: center;
}

/* Badge text info */
.cert-badge__info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.cert-badge__std {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--footer-text-white);
  white-space: nowrap;
}

.cert-badge__name {
  font-size: 0.65rem;
  color: var(--footer-text-muted);
  white-space: nowrap;
}

.cert-badge__sub {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Divider between ISO and UNGM */
.cert-divider {
  width: 1px;
  height: 52px;
  background: var(--footer-border);
  flex-shrink: 0;
}

.footer-cert-note {
  text-align: center;
  font-size: 0.68rem;
  color: var(--footer-text-muted);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ===== MAIN FOOTER ===== */
.footer-main {
  padding: 3rem 2rem 2.5rem;
  border-bottom: 1px solid var(--footer-border);
}

.footer-main-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.3fr 1.2fr;
  gap: 3rem;
}

/* Brand column */
.footer-brand {
  display: flex;
  flex-direction: column;
}

.footer-logo {
  max-height: 60px;
  width: auto;
  margin-bottom: 1rem;
  object-fit: contain;
}

.footer-logo-text {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin-bottom: 1rem;
  font-family: var(--font-heading);
  color: var(--footer-text-white);
}

.footer-desc {
  font-size: 0.875rem;
  color: var(--footer-text-offwhite);
  line-height: 1.65;
  margin-bottom: 0.75rem;
  max-width: 85%;
}

.footer-tagline {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--footer-text-offwhite);
  opacity: 0.75;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  max-width: 90%;
}

/* Social icons */
.footer-social {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--footer-text-offwhite);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  text-decoration: none;
}

.social-icon svg {
  width: 16px;
  height: 16px;
}

.social-icon:hover {
  background: var(--footer-link-hover);
  border-color: var(--footer-link-hover);
  color: #fff;
}

/* Footer columns */
.footer-col__heading {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--footer-text-white);
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid rgba(58, 168, 255, 0.35);
  display: inline-block;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 0.6rem;
}

.footer-col a {
  color: var(--footer-text-offwhite);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
  display: inline-block;
}

.footer-col a:hover {
  color: var(--footer-link-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Locations list */
.footer-locations {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.footer-locations li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0;
  font-size: 0.875rem;
  color: var(--footer-text-offwhite);
}

.footer-locations li svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 0.2rem;
  color: var(--footer-link-hover);
}

.footer-locations li strong {
  color: var(--footer-text-white);
  display: block;
  font-size: 0.8rem;
}

/* Contact list */
.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.footer-contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0;
}

.footer-contact-list svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: var(--footer-link-hover);
}

.footer-contact-list a {
  color: var(--footer-text-offwhite);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-contact-list a:hover {
  color: var(--footer-link-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===== POLICIES STRIP ===== */
.footer-policies-strip {
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid var(--footer-border);
  border-bottom: 1px solid var(--footer-border);
}

.footer-policies-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0.85rem 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
}

.footer-policies-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
}

.footer-policies-inner a {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--footer-text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-policies-inner a:hover {
  color: var(--footer-text-white);
}

/* ===== BOTTOM BAR ===== */
.footer-bottom {
  background: var(--footer-bg-deep);
}

.footer-bottom-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1.1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copyright {
  font-size: 0.78rem;
  color: var(--footer-text-muted);
}

.footer-bottom-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-cap-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.45rem 1rem;
  border-radius: 40px;
  color: var(--footer-text-white);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.footer-cap-btn svg {
  width: 16px;
  height: 16px;
}

.footer-cap-btn:hover {
  background: var(--footer-link-hover);
  border-color: var(--footer-link-hover);
  color: #fff;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .footer-main-inner {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 768px) {
  .footer-cert-badges {
    gap: 0.75rem;
  }
  .cert-badge {
    padding: 0.5rem 0.7rem;
  }
  .cert-badge__logo {
    width: 44px;
    height: 44px;
  }
  .cert-divider {
    display: none;
  }
  .footer-main-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-brand {
    text-align: center;
    align-items: center;
  }
  .footer-desc {
    max-width: 100%;
  }
  .footer-col__heading {
    display: block;
    text-align: center;
  }
  .footer-col ul,
  .footer-locations,
  .footer-contact-list {
    align-items: center;
  }
  .footer-locations li,
  .footer-contact-list li {
    justify-content: center;
  }
  .footer-policies-inner {
    justify-content: center;
    gap: 1rem;
  }
  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .footer-cert-strip {
    padding: 2rem 1rem;
  }
  .footer-main {
    padding: 2rem 1rem;
  }
  .cert-badge__name {
    display: none;
  }
  .footer-cert-badges {
    gap: 0.5rem;
  }
}

/* Focus accessibility */
.footer-col a:focus-visible,
.footer-contact-list a:focus-visible,
.social-icon:focus-visible,
.footer-cap-btn:focus-visible,
.footer-policies-inner a:focus-visible {
  outline: 2px solid var(--footer-link-hover);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Cert badges: pointer + hover ring */
[data-cert-id] {
  cursor: pointer;
}

.cert-badge[data-cert-id]:hover,
.cert-badge[data-cert-id]:focus-visible {
  box-shadow: 0 0 0 2px rgba(58,168,255,0.5);
  outline: none;
}

/* ===== CERTIFICATION MODAL ===== */
.certm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,14,30,0.72);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(4px);
  /* Always in DOM — hidden via visibility/pointer-events so CSS display:flex
     doesn't block page clicks when modal is closed */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.certm-overlay.certm-open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.certm-dialog {
  background: #fff;
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
  position: relative;
  transform: translateY(18px) scale(0.97);
  transition: transform 0.28s cubic-bezier(.34,1.36,.64,1), opacity 0.25s ease;
  opacity: 0;
  max-height: 90vh;
  overflow-y: auto;
}

.certm-overlay.certm-open .certm-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Close button */
.certm-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: background 0.15s, color 0.15s;
  z-index: 1;
}

.certm-close svg { width: 16px; height: 16px; }
.certm-close:hover { background: #e2e8f0; color: #0a1f44; }

/* Header */
.certm-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid #f0f4f8;
}

.certm-badge-wrap {
  flex-shrink: 0;
}

/* Badge circles inside modal */
.certm-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.certm-badge--blue   { background: #1b4f9a; box-shadow: 0 4px 14px rgba(27,79,154,0.35); }
.certm-badge--green  { background: #1a7a3c; box-shadow: 0 4px 14px rgba(26,122,60,0.35); }
.certm-badge--red    { background: #8b1a1a; box-shadow: 0 4px 14px rgba(139,26,26,0.35); }
.certm-badge--orange { background: #b35900; box-shadow: 0 4px 14px rgba(139,74,0,0.35); }
.certm-badge--teal   { background: #0e6655; box-shadow: 0 4px 14px rgba(14,102,85,0.35); }
.certm-badge--ungm   { background: #1b4f9a; box-shadow: 0 4px 14px rgba(27,79,154,0.3); }
.certm-badge--jasanz { background: #4a5568; box-shadow: 0 4px 14px rgba(74,85,104,0.3); }

.certm-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0a1f44;
  margin-bottom: 0.2rem;
}

.certm-type {
  font-size: 0.78rem;
  color: #718096;
}

/* Description */
.certm-desc {
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  color: #4a5568;
  line-height: 1.65;
  border-bottom: 1px solid #f0f4f8;
}

/* Meta table */
.certm-meta {
  padding: 0.85rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  border-bottom: 1px solid #f0f4f8;
  background: #f8fafc;
}

.certm-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  gap: 0.5rem;
}

.certm-meta-row span  { color: #718096; }
.certm-meta-row strong { color: #1a202c; font-weight: 600; text-align: right; }

/* Modal footer */
.certm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

.certm-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1a7a3c;
}

.certm-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1a7a3c;
  animation: cpPulse 2s ease-in-out infinite;
}

.certm-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1b4f9a;
  text-decoration: none;
}

.certm-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Body lock when modal open */
body.certm-active { overflow: hidden; }

/* ── Mobile: bottom sheet ───────────────────────────── */
@media (max-width: 560px) {
  .certm-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .certm-dialog {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    max-height: 88vh;
    /* override desktop transform so it slides up from bottom */
    transform: translateY(40px) scale(1);
  }

  .certm-overlay.certm-open .certm-dialog {
    transform: translateY(0) scale(1);
  }

  .certm-header { padding: 1.25rem 1.25rem 0.85rem; }
  .certm-desc   { padding: 0.85rem 1.25rem; }
  .certm-meta   { padding: 0.75rem 1.25rem; }
  .certm-footer { padding: 0.85rem 1.25rem 1.25rem; }
  .certm-close  { top: 0.85rem; right: 0.85rem; }

  /* Drag handle visual hint */
  .certm-dialog::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #d1d5db;
    margin: 0.85rem auto 0;
  }
}
