/* ============================================
   Common Footer & Privacy Modal Styles
   ============================================ */

/* Legacy footer layout compatibility */
.footer {
  width: 100%;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: clamp(20px, 4vw, 64px);
  padding-right: clamp(20px, 4vw, 64px);
}

.footer-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-info {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 10px 28px;
  align-items: start;
  min-width: 0;
}

.footer-info-item {
  min-width: 0;
}

.footer-info-address dd {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.footer-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  text-align: right;
}

/* Footer redesign used by fragments/footer.html */
.footer {
  border-top: none !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(16, 24, 27, 0.02) 100%),
    linear-gradient(135deg, #10181b 0%, #18272b 50%, #10181b 100%) !important;
  color: #ffffff !important;
}

.footer-redesign {
  width: min(1200px, calc(100% - 96px)) !important;
  max-width: none !important;
  min-height: 150px !important;
  margin: 0 auto !important;
  padding: 28px 0 !important;
  display: grid !important;
  grid-template-columns: 1.8fr 1fr 0.9fr !important;
  align-items: center !important;
  gap: 46px !important;
}

.footer-company h3 {
  margin: 0 0 10px !important;
  color: #ffffff !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
}

.footer-company p {
  margin: 0 0 4px !important;
  color: rgba(255, 255, 255, 0.78) !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  white-space: normal;
}

.footer-company .footer-en {
  margin-top: 6px !important;
  color: rgba(255, 255, 255, 0.62) !important;
  font-size: 12px !important;
}

.footer-contact {
  position: relative;
  padding-left: 42px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 9px !important;
}

.footer-contact::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 58px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.28);
}

.footer-contact-row {
  display: grid !important;
  grid-template-columns: 28px 1fr !important;
  align-items: center !important;
  gap: 8px !important;
}

.footer-contact-row span {
  color: #47be75 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}

.footer-contact-row p {
  margin: 0 !important;
  color: rgba(255, 255, 255, 0.86) !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

.footer-legal {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  justify-content: center !important;
  gap: 10px !important;
  text-align: right !important;
}

.footer-copyright {
  margin: 0 !important;
  color: rgba(255, 255, 255, 0.68) !important;
  font-size: 12px !important;
  line-height: 1.55 !important;
  white-space: nowrap !important;
}

.footer-links {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 22px !important;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.88) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  transition: color 0.25s ease !important;
}

.footer-links a:hover {
  color: #47be75 !important;
}

.footer-privacy-open {
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  font: inherit;
  color: rgba(255, 255, 255, 0.88) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  cursor: pointer !important;
}

.footer-privacy-open:hover {
  color: #47be75 !important;
}

/* Privacy modal */
.privacy-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.privacy-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.privacy-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(5px);
}

.privacy-modal-dialog {
  position: relative;
  width: min(880px, 100%) !important;
  max-height: min(82vh, 860px);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.privacy-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid #e9eaec;
}

.privacy-modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #111827;
}

.privacy-modal-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.privacy-modal-body {
  padding: 24px 28px 28px;
  overflow-y: auto;
  color: #374151;
}

.privacy-modal-eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #edfdf3;
  color: #1b5e3b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.privacy-modal-summary {
  margin: 0 0 20px;
  padding: 18px 18px 16px;
  border: 1px solid #e5efe9;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfffc 0%, #f7faf8 100%);
}

.privacy-modal-summary strong {
  color: #1b5e3b;
}

.privacy-point-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 0;
}

.privacy-point {
  padding: 12px 13px;
  border: 1px solid #edf1ee;
  border-radius: 12px;
  background: #fff;
}

.privacy-point b {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: #111827;
}

.privacy-point span {
  display: block;
  font-size: 12px;
  line-height: 1.55;
  color: #4b5563;
}

.privacy-summary-table-wrap {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
}

.privacy-summary-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.privacy-summary-table th,
.privacy-summary-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef0f2;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.6;
}

.privacy-summary-table th {
  background: #f8faf9;
  color: #1b5e3b;
  font-weight: 800;
  white-space: nowrap;
}

.privacy-summary-table tr:last-child td {
  border-bottom: none;
}

.privacy-modal-body h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
  color: #111827;
}

.privacy-modal-body p,
.privacy-modal-body li {
  font-size: 14px;
  line-height: 1.75;
  color: #4b5563;
}

.privacy-modal-body section {
  margin-bottom: 20px;
}

.privacy-modal-body ul {
  margin: 0;
  padding-left: 18px;
}

.privacy-modal-body .privacy-note {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f9fafb;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.65;
}

.privacy-contact-card {
  padding: 16px;
  border: 1px solid #e5efe9;
  border-radius: 16px;
  background: #fbfffc;
}

.privacy-contact-card ul {
  padding-left: 0 !important;
  list-style: none;
}

.privacy-contact-card li {
  display: flex;
  gap: 10px;
}

.privacy-contact-card li strong {
  min-width: 72px;
  color: #1b5e3b;
}

.privacy-modal-date {
  color: #6b7280 !important;
  font-size: 13px !important;
}

body.privacy-modal-open {
  overflow: hidden;
}

@media (max-width: 1024px) {
  .footer-bottom {
    align-items: flex-start;
    gap: 24px;
  }

  .footer-info {
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 14px 22px;
  }

  .footer-info-address {
    grid-column: 1 / -1;
  }

  .footer-meta {
    width: 100%;
    justify-content: space-between;
    text-align: left;
  }

  .footer-redesign {
    width: calc(100% - 80px) !important;
    grid-template-columns: 1.3fr 1fr !important;
    gap: 28px 40px !important;
    min-height: auto !important;
    padding: 34px 0 !important;
  }

  .footer-legal {
    grid-column: 1 / -1 !important;
    align-items: flex-start !important;
    text-align: left !important;
    padding-top: 18px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.14) !important;
  }

  .footer-links {
    justify-content: flex-start !important;
  }
}

@media (max-width: 640px) {
  .footer-inner {
    padding: 36px 20px 32px;
  }

  .footer-top {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .footer-logo {
    max-width: 150px;
    height: auto;
  }

  .footer-divider {
    margin: 22px 0;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
  }

  .footer-info {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .footer-info-item {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 12px;
    align-items: start;
  }

  .footer-info-item dt {
    white-space: nowrap;
  }

  .footer-info-item dd {
    line-height: 1.6;
  }

  .footer-meta {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    text-align: left;
  }

  .footer-privacy-link {
    padding: 0;
  }

  .footer-redesign {
    width: calc(100% - 40px) !important;
    grid-template-columns: 1fr !important;
    gap: 22px !important;
    padding: 30px 0 !important;
  }

  .footer-company h3 {
    font-size: 18px !important;
  }

  .footer-contact {
    padding-left: 0 !important;
    padding-top: 18px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.14) !important;
  }

  .footer-contact::before {
    display: none !important;
  }

  .footer-legal {
    grid-column: auto !important;
    padding-top: 18px !important;
  }

  .footer-links {
    gap: 16px !important;
    flex-wrap: wrap !important;
  }

  .footer-privacy-open {
    font-size: 12px !important;
  }

  .privacy-modal {
    padding: 16px;
  }

  .privacy-modal-header,
  .privacy-modal-body {
    padding-left: 20px;
    padding-right: 20px;
  }

  .privacy-point-grid {
    grid-template-columns: 1fr;
  }

  .privacy-modal-dialog {
    max-height: 88vh !important;
  }

  .footer-copyright {
    white-space: normal !important;
  }
}

@media (max-width: 380px) {
  .footer-info-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ============================================
   Final Override Against Legacy style/main-ui
   ============================================ */

body .footer {
  border-top: none !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(16, 24, 27, 0.02) 100%),
    linear-gradient(135deg, #10181b 0%, #18272b 50%, #10181b 100%) !important;
  color: #ffffff !important;
}

body .footer .footer-inner.footer-redesign {
  width: min(1200px, calc(100% - 96px)) !important;
  max-width: none !important;
  min-height: 150px !important;
  margin: 0 auto !important;
  padding: 28px 0 !important;
  display: grid !important;
  grid-template-columns: 1.8fr 1fr 0.9fr !important;
  align-items: center !important;
  gap: 46px !important;
}

body .footer .footer-company h3 {
  margin: 0 0 10px !important;
  color: #ffffff !important;
  font-size: 20px !important;
  font-weight: 800 !important;
}

body .footer .footer-company p {
  margin: 0 0 4px !important;
  color: rgba(255, 255, 255, 0.78) !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  white-space: normal !important;
}

body .footer .footer-contact {
  position: relative !important;
  padding-left: 42px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 9px !important;
}

body .footer .footer-contact::before {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  top: 50% !important;
  width: 1px !important;
  height: 58px !important;
  transform: translateY(-50%) !important;
  background: rgba(255, 255, 255, 0.28) !important;
}

body .footer .footer-contact-row span {
  color: #47be75 !important;
}

body .footer .footer-contact-row p {
  color: rgba(255, 255, 255, 0.86) !important;
}

body .footer .footer-legal {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  justify-content: center !important;
  gap: 10px !important;
  text-align: right !important;
}

body .footer .footer-copyright {
  color: rgba(255, 255, 255, 0.68) !important;
  font-size: 12px !important;
  white-space: nowrap !important;
}

body .footer .footer-links {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 22px !important;
}

body .footer .footer-links a,
body .footer .footer-privacy-open,
body .footer .footer-privacy-link {
  color: rgba(255, 255, 255, 0.88) !important;
  font-size: 12px !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
}

body .footer .footer-links a:hover,
body .footer .footer-privacy-open:hover,
body .footer .footer-privacy-link:hover {
  color: #47be75 !important;
}

body .privacy-modal {
  z-index: 10000 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body .privacy-modal.is-open {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

body .privacy-modal .privacy-modal-dialog {
  width: min(880px, 100%) !important;
}

@media (max-width: 1024px) {
  body .footer .footer-inner.footer-redesign {
    width: calc(100% - 80px) !important;
    grid-template-columns: 1.3fr 1fr !important;
    gap: 28px 40px !important;
    min-height: auto !important;
    padding: 34px 0 !important;
  }

  body .footer .footer-legal {
    grid-column: 1 / -1 !important;
    align-items: flex-start !important;
    text-align: left !important;
    padding-top: 18px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.14) !important;
  }

  body .footer .footer-links {
    justify-content: flex-start !important;
  }
}

@media (max-width: 640px) {
  body .footer .footer-inner.footer-redesign {
    width: calc(100% - 40px) !important;
    grid-template-columns: 1fr !important;
    gap: 22px !important;
    padding: 30px 0 !important;
  }

  body .footer .footer-company h3 {
    font-size: 18px !important;
  }

  body .footer .footer-contact {
    padding-left: 0 !important;
    padding-top: 18px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.14) !important;
  }

  body .footer .footer-contact::before {
    display: none !important;
  }

  body .footer .footer-legal {
    grid-column: auto !important;
    padding-top: 18px !important;
    align-items: flex-start !important;
    text-align: left !important;
  }

  body .footer .footer-links {
    gap: 16px !important;
    flex-wrap: wrap !important;
  }

  body .footer .footer-copyright {
    white-space: normal !important;
  }
}
