/* Content tweaks on top of the imported WordPress page CSS (loaded last in <head>). */

/* Table of contents box on product and article pages (details.aia-fa-product-toc):
   smaller type and tighter spacing so the list reads as a compact index. */
.aia-fa-toc-section .aia-fa-product-toc { margin: 20px 0 !important; }
.aia-fa-product-toc > summary { font-size: 15px !important; padding-top: 12px !important; padding-bottom: 12px !important; min-height: 0 !important; }
.aia-fa-product-toc > summary::after { padding: 6px 11px !important; font-size: 12px !important; }
details.aia-fa-product-toc > ol.aia-fa-product-toc__list { margin: 0 14px 0 22px !important; padding: 12px 0 14px 18px !important; }
.aia-fa-product-toc__list li { font-size: 14px !important; line-height: 1.45 !important; margin-bottom: 5px !important; padding-left: 2px !important; }
.aia-fa-product-toc__list li:last-child { margin-bottom: 0 !important; }
.aia-fa-product-toc__list li a { font-size: inherit !important; line-height: inherit !important; }
@media (max-width: 600px) {
  .aia-fa-product-toc__list li { font-size: 13.5px !important; }
  details.aia-fa-product-toc > ol.aia-fa-product-toc__list { margin: 0 10px 0 14px !important; }
}

/* Footer cards: the theme kept 220px of empty space at the bottom of the cards (room for the
   lead form that is gone). Now the three cards are as tall as the tallest card's content, and
   the เมนูด่วน & บริการ column gets the same card look as the other two. Selectors repeat the
   theme's own (#footer-widgets .footer-widget-N ...) so they win on order. */
#footer-widgets .footer-widget-1 .aia-fa-widget-col,
#footer-widgets .footer-widget-2 .aia-fa-widget-col,
#footer-widgets .footer-widget-4 .aia-fa-widget-col {
  padding: 22px 22px 20px !important; min-height: 0 !important; height: 100% !important; box-sizing: border-box;
}
#footer-widgets .footer-widget-4 .aia-fa-widget-col {
  background: linear-gradient(145deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035));
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px; box-shadow: 0 14px 30px rgba(9, 15, 22, .14);
}
#footer-widgets .footer-widget-4 .aia-fa-widget-list { margin-bottom: 0 !important; }

/* Premium calculator box (#aia-healthhappy-calc-container on /aia-health-happy/): tighter
   spacing and type, and the plan picker as buttons (.afa-plan-btns) instead of a dropdown. */
#aia-healthhappy-calc-container { padding: 24px 24px 26px !important; margin: 28px 0 !important; }
#aia-healthhappy-calc-container .aia-calc-badge { padding: 4px 14px !important; font-size: 14px !important; line-height: 1.6 !important; }
#aia-healthhappy-calc-container .aia-calc-title { font-size: 32px !important; line-height: 1.15 !important; margin: 12px 0 4px !important; }
#aia-healthhappy-calc-container .aia-calc-subtitle { font-size: 15px !important; line-height: 1.5 !important; margin: 0 0 18px !important; }
#aia-healthhappy-calc-container .aia-calc-main-wrapper { gap: 20px !important; align-items: stretch !important; }
#aia-healthhappy-calc-container .aia-calc-grid { gap: 14px !important; align-content: center; }
#aia-healthhappy-calc-container .aia-calc-label { font-size: 16px !important; line-height: 1.4 !important; margin-bottom: 6px !important; }
#aia-healthhappy-calc-container .aia-seg-btn-inner { min-height: 38px; }
#aia-healthhappy-calc-container .aia-calc-select { padding: 9px 14px !important; font-size: 15px !important; line-height: 1.4 !important; }
#aia-healthhappy-calc-container .aia-calc-res-box { padding: 20px 20px !important; justify-content: center; }
#aia-healthhappy-calc-container .aia-sum-highlight-box { padding: 12px 16px !important; margin-bottom: 12px !important; }
#aia-healthhappy-calc-container .aia-sum-highlight-label { font-size: 13px !important; line-height: 1.5 !important; margin-bottom: 0 !important; }
#aia-healthhappy-calc-container .aia-sum-highlight-amount { font-size: 34px !important; line-height: 1.2 !important; }
#aia-healthhappy-calc-container .aia-calc-res-title { font-size: 14px !important; line-height: 1.5 !important; margin-bottom: 0 !important; }
#aia-healthhappy-calc-container .aia-calc-res-price { font-size: 30px !important; line-height: 1.25 !important; margin-bottom: 10px !important; }
#aia-healthhappy-calc-container .aia-calc-res-pill { padding: 8px 14px !important; font-size: 13.5px !important; line-height: 1.5 !important; margin-bottom: 12px !important; }
#aia-healthhappy-calc-container .aia-calc-cta { padding: 10px 18px !important; min-height: 0 !important; }
#aia-healthhappy-calc-container .aia-calc-cta img { width: 26px !important; height: 26px !important; }
#aia-healthhappy-calc-container .aia-calc-cta span { font-size: 17px !important; }

.afa-plan-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.afa-plan-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; margin: 0;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 12px; background: #1E293B; color: #fff; cursor: pointer;
  font-family: "AIA Body", "Leelawadee UI", Tahoma, sans-serif; text-align: left; transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.afa-plan-btn b { font-size: 17px; line-height: 1.25; font-weight: 700; }
.afa-plan-btn span { font-size: 12.5px; line-height: 1.35; color: #CBD5E1; }
.afa-plan-btn:hover { border-color: rgba(211, 17, 69, .7); }
.afa-plan-btn[aria-checked="true"] { background: #D31145; border-color: #D31145; box-shadow: 0 8px 18px -10px rgba(211, 17, 69, .9); }
.afa-plan-btn[aria-checked="true"] span { color: #FFE4EA; }
.afa-plan-btn:focus-visible { outline: 3px solid #E4708F; outline-offset: 2px; }
@media (max-width: 600px) {
  #aia-healthhappy-calc-container { padding: 18px 14px 18px !important; }
  #aia-healthhappy-calc-container .aia-calc-title { font-size: 26px !important; }
  #aia-healthhappy-calc-container .aia-calc-res-box { padding: 14px 12px !important; }
  #aia-healthhappy-calc-container .aia-sum-highlight-amount { font-size: 28px !important; }
  #aia-healthhappy-calc-container .aia-calc-res-pill { padding: 8px 10px !important; }
  #aia-healthhappy-calc-container .aia-calc-cta { padding: 10px 12px !important; }
  #aia-healthhappy-calc-container .aia-calc-cta span { font-size: 15.5px !important; white-space: nowrap; letter-spacing: 0 !important; }
  .afa-plan-btn { padding: 9px 10px; }
  .afa-plan-btn span { font-size: 12px; }
}

/* Age buttons: one row of five on desktop and phones */
.afa-plan-btns--ages { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.afa-plan-btns--ages .afa-plan-btn { align-items: center; padding: 9px 4px; }
.afa-plan-btns--ages .afa-plan-btn b { font-size: 16px; white-space: nowrap; }

/* Product pages with the hero box (.aia-fa-hero): bring the box up close to the menu.
   The theme stacked 20px (main) + 40px (article padding) + 34px (content margin) above it. */
.site-main:has(.aia-fa-hero) { margin-top: 0 !important; }
.inside-article:has(.aia-fa-hero) { padding-top: 20px !important; }
.inside-article:has(.aia-fa-hero) .entry-content { margin-top: 0 !important; }
@media (max-width: 768px) { .inside-article:has(.aia-fa-hero) { padding-top: 12px !important; } }

/* Top bar: agent name (bold) and licence on the left, lined up with the logo text below;
   the AIA mark on the right, without the boxed frame. Same text as WordPress.
   "body" in each selector: the theme topbar CSS loads later (inside <body>) with the same selectors. */
body #aia-agent-topbar .aia-agent-inner {
  flex-direction: row-reverse !important; justify-content: space-between !important; align-items: center !important;
  max-width: 1200px !important; width: 100% !important; margin: 0 auto !important; padding: 10px 23px !important; box-sizing: border-box !important; gap: 16px !important;
}
body #aia-agent-topbar .aia-agent-logo { width: auto !important; height: auto !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; flex: 0 0 auto !important; }
body #aia-agent-topbar .aia-agent-logo img { width: 58px !important; height: 58px !important; margin: -6px -8px -6px 0; max-width: none !important; border-radius: 0 !important; }
body #aia-agent-topbar .aia-agent-info { flex: 1 1 auto !important; min-width: 0; text-align: left !important; }
body #aia-agent-topbar .aia-agent-name { font-size: 16px !important; font-weight: 700 !important; line-height: 1.4 !important; margin: 0 !important; }
body #aia-agent-topbar .aia-agent-license { font-size: 16px !important; font-weight: 400 !important; line-height: 1.4 !important; margin: 0 !important; opacity: 1 !important; }
@media (max-width: 768px) {
  body #aia-agent-topbar .aia-agent-inner { padding: 8px 16px !important; }
  body #aia-agent-topbar .aia-agent-name, body #aia-agent-topbar .aia-agent-license { font-size: 13px !important; }
  body #aia-agent-topbar .aia-agent-logo img { width: 46px !important; height: 46px !important; }
}
