/* =========================================================
   BMHA Cookie Consent v5 Government Bottom Bar + Policy Page
   - แถบล่างสุภาพ กระชับ ตามแนวเว็บภาครัฐ
   - เฉพาะคุกกี้ที่จำเป็น + สถิติการใช้งานเว็บไซต์
   ========================================================= */
.bmha-cookie-consent {
  font-family: 'Kanit', sans-serif;
}

.bmha-cookie-consent[hidden] {
  display: none !important;
}

.bmha-cookie-consent {
  position: fixed;
  right: 24px;
  bottom: 24px;
  left: auto;
  width: min(420px, calc(100vw - 32px));
  z-index: 11000;
  padding: 0;
  background: rgba(255, 255, 255, .97);
  border: 1px solid rgba(13, 143, 128, .16);
  border-radius: 20px;
  box-shadow: 0 18px 46px rgba(16, 36, 63, .18);
  transform: translateY(24px);
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
  backdrop-filter: blur(10px);
}

.bmha-cookie-consent.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.bmha-cookie-bar {
  width: 100%;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  justify-items: stretch;
  gap: 14px;
  color: #173657;
  text-align: left;
}

.bmha-cookie-copy {
  min-width: 0;
  text-align: center;
}

.bmha-cookie-copy h2 {
  margin: 0 0 4px;
  color: #173657;
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.35;
  font-weight: 700;
}

.bmha-cookie-copy p {
  max-width: 900px;
  margin: 0 auto;
  color: #38506a;
  font-size: clamp(12px, 1.05vw, 13.5px);
  line-height: 1.65;
}

.bmha-cookie-copy a {
  color: #0b8178;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bmha-cookie-copy a:hover {
  color: #10243f;
}

.bmha-cookie-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
}

.bmha-cookie-btn {
  min-width: 94px;
  min-height: 34px;
  padding: 7px 15px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.bmha-cookie-btn:hover {
  transform: translateY(-1px);
}

.bmha-cookie-btn-primary {
  color: #fff;
  background: #0b8178;
  border-color: #0b8178;
  box-shadow: 0 8px 18px rgba(11, 129, 120, .16);
}

.bmha-cookie-btn-primary:hover {
  background: #10243f;
  border-color: #10243f;
}

.bmha-cookie-btn-soft {
  color: #173657;
  background: #fff;
  border-color: #cfd9e2;
}

.bmha-cookie-btn-soft:hover {
  background: #f2f7f6;
  border-color: #b9d2cf;
}

/* Cookie Policy Page */
body.bmha-cookie-policy-page .bmha-subpage-content {
  padding-top: clamp(36px, 5vw, 68px);
  padding-bottom: clamp(64px, 7vw, 110px);
}

body.bmha-cookie-policy-page .bmha-policy-card {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 46px);
  border-radius: 32px;
  background:
    radial-gradient(circle at 100% 0%, rgba(214, 184, 74, .11), transparent 28%),
    linear-gradient(180deg, #ffffff, #fbfdfc);
  border: 1px solid rgba(23, 54, 87, .10);
  box-shadow: 0 24px 72px rgba(16, 36, 63, .12);
}

.bmha-policy-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(23, 54, 87, .10);
}

.bmha-policy-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #8a7940;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.bmha-policy-label::before {
  content: "";
  width: 30px;
  height: 4px;
  border-radius: 999px;
  background: #d6b84a;
}

.bmha-policy-title {
  margin: 0;
  color: #173657;
  font-size: clamp(30px, 3.2vw, 46px);
  line-height: 1.22;
  font-weight: 700;
}

.bmha-policy-lead {
  max-width: 820px;
  margin: 12px 0 0;
  color: #4b5d73;
  font-size: 16px;
  line-height: 1.85;
}

.bmha-policy-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #173657;
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(23, 54, 87, .16);
  cursor: pointer;
}

.bmha-policy-reset-btn:hover {
  background: #0b8178;
}

.bmha-policy-content {
  display: grid;
  gap: 26px;
  margin-top: 28px;
}

.bmha-policy-section {
  padding: clamp(20px, 3vw, 28px);
  border-radius: 24px;
  background: #fff;
  border: 1px solid rgba(23, 54, 87, .09);
}

.bmha-policy-section h3 {
  margin: 0 0 10px;
  color: #173657;
  font-size: clamp(21px, 2vw, 28px);
  line-height: 1.35;
  font-weight: 700;
}

.bmha-policy-section p {
  margin: 0;
  color: #40546c;
  font-size: 15.5px;
  line-height: 1.9;
}

.bmha-policy-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.bmha-policy-summary-card {
  min-height: 178px;
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #f8fbfa);
  border: 1px solid rgba(23, 54, 87, .09);
  box-shadow: 0 10px 28px rgba(16, 36, 63, .06);
}

.bmha-policy-summary-icon {
  width: 62px;
  height: 62px;
  min-width: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border-radius: 20px;
  color: #173657;
  background: linear-gradient(180deg, #edf3f6, #e6f0f2);
  box-shadow: inset 0 0 0 1px rgba(23, 54, 87, .04);
}

.bmha-policy-summary-icon i,
.bmha-policy-summary-icon .fas,
.bmha-policy-summary-icon .far,
.bmha-policy-summary-icon .fab,
.bmha-policy-summary-icon .bi {
  font-size: 28px !important;
  line-height: 1 !important;
}

.bmha-policy-summary-card strong {
  display: block;
  color: #173657;
  font-size: 18px;
  line-height: 1.45;
}

.bmha-policy-summary-card span {
  display: block;
  margin-top: 8px;
  color: #52667c;
  font-size: 14.5px;
  line-height: 1.8;
}

.bmha-policy-table-wrap {
  overflow-x: auto;
  margin-top: 16px;
  border-radius: 18px;
  border: 1px solid rgba(23, 54, 87, .12);
  background: #fff;
}

.bmha-policy-table {
  width: 100%;
  min-width: 820px;
  margin: 0;
  border-collapse: collapse;
}

.bmha-policy-table th,
.bmha-policy-table td {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(23, 54, 87, .09);
  vertical-align: top;
  font-size: 14.5px;
  line-height: 1.75;
}

.bmha-policy-table th {
  color: #173657;
  background: #f3f8f7;
  font-weight: 700;
  white-space: nowrap;
}

.bmha-policy-table tr:last-child td {
  border-bottom: 0;
}

.bmha-policy-table td:first-child {
  color: #173657;
  font-weight: 700;
  white-space: nowrap;
}

.bmha-policy-table code {
  display: inline-block;
  margin: 1px 2px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #9b3a62;
  background: #fff1f6;
  font-size: 12px;
}

.bmha-policy-note-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.bmha-policy-note-list li {
  display: flex;
  gap: 10px;
  color: #40546c;
  font-size: 15px;
  line-height: 1.85;
}

.bmha-policy-note-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: #d6b84a;
}

@media (max-width: 991.98px) {
  .bmha-cookie-bar {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .bmha-cookie-actions {
    margin: 0 auto;
  }

  .bmha-policy-top,
  .bmha-policy-summary-grid {
    grid-template-columns: 1fr;
  }

  .bmha-policy-reset-btn {
    width: fit-content;
  }
}

@media (max-width: 767.98px) {
  .bmha-cookie-consent {
    padding: 12px 14px;
  }

  .bmha-cookie-copy {
    text-align: center;
  }

  .bmha-cookie-actions {
    width: 100%;
    justify-content: center;
  }

  .bmha-cookie-btn {
    flex: 0 1 138px;
    min-width: 112px;
  }

  body.bmha-cookie-policy-page .bmha-policy-card {
    padding: 20px;
    border-radius: 24px;
  }
}


/* Step 38: Cookie banner button alignment + policy icon refinement */
.bmha-cookie-copy {
  max-width: 980px;
}

.bmha-policy-summary-card {
  position: relative;
  overflow: hidden;
}

.bmha-policy-summary-card::after {
  content: "";
  position: absolute;
  top: -42px;
  right: -42px;
  width: 116px;
  height: 116px;
  border-radius: 999px;
  background: rgba(214, 184, 74, .08);
  pointer-events: none;
}

.bmha-cookie-policy-card-icon,
.bmha-cookie-card-icon,
.bmha-policy-icon {
  width: 62px;
  height: 62px;
  min-width: 62px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #edf3f6, #e6f0f2);
  color: #173657;
  margin-bottom: 18px;
}

.bmha-cookie-policy-card-icon i,
.bmha-cookie-card-icon i,
.bmha-policy-icon i {
  font-size: 28px !important;
  line-height: 1 !important;
}

@media (prefers-reduced-motion: reduce) {

  .bmha-cookie-consent,
  .bmha-cookie-btn,
  .bmha-policy-reset-btn {
    transition-duration: .001ms !important;
  }
}

/* Step 39: ICT DMH policy content refinement */
.bmha-policy-reference-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(13, 143, 128, .08), rgba(214, 184, 74, .10));
  border: 1px solid rgba(13, 143, 128, .14);
  color: #31506a;
}

.bmha-policy-reference-note i {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #173657;
  background: #fff;
  box-shadow: 0 8px 20px rgba(16, 36, 63, .08);
}

.bmha-policy-reference-note strong {
  display: block;
  margin-bottom: 4px;
  color: #173657;
  font-size: 16px;
}

.bmha-policy-reference-note p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.85;
}

.bmha-policy-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.bmha-policy-subcard {
  padding: 20px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(23, 54, 87, .09);
  box-shadow: 0 8px 24px rgba(16, 36, 63, .05);
}

.bmha-policy-subcard h4 {
  margin: 0 0 8px;
  color: #173657;
  font-size: 18px;
  line-height: 1.4;
}

.bmha-policy-subcard p {
  margin: 0;
  color: #40546c;
  font-size: 15px;
  line-height: 1.85;
}

.bmha-policy-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.bmha-policy-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #f3f8f7;
  color: #173657;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(23, 54, 87, .08);
}

.bmha-policy-browser-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.bmha-policy-browser-grid a {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  color: #173657;
  background: #f7fbfa;
  border: 1px solid rgba(23, 54, 87, .09);
  font-size: 14px;
  font-weight: 600;
  transition: background 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.bmha-policy-browser-grid a:hover {
  background: #edf6f4;
  border-color: rgba(13, 143, 128, .22);
  transform: translateY(-1px);
}

.bmha-policy-contact-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
  padding: clamp(20px, 3vw, 28px);
  border-radius: 24px;
  background: linear-gradient(135deg, #173657, #0b8178);
  color: #fff;
  box-shadow: 0 18px 48px rgba(16, 36, 63, .14);
}

.bmha-policy-contact-box i {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, .14);
  color: #f7e8b1;
  font-size: 23px;
}

.bmha-policy-contact-box h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 24px;
  line-height: 1.35;
}

.bmha-policy-contact-box p {
  margin: 0;
  color: rgba(255, 255, 255, .86);
  line-height: 1.85;
  font-size: 15px;
}

.bmha-policy-contact-box a {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bmha-policy-check-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.bmha-policy-check-list li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  color: #40546c;
  font-size: 15px;
  line-height: 1.85;
}

.bmha-policy-check-list li::before {
  content: "✓";
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: #0b8178;
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
}

@media (max-width: 991.98px) {

  .bmha-policy-two-col,
  .bmha-policy-browser-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {

  .bmha-policy-reference-note,
  .bmha-policy-contact-box {
    grid-template-columns: 1fr;
  }

  .bmha-cookie-consent {
    right: 14px;
    bottom: 14px;
    width: calc(100vw - 28px);
  }
}
