/* =========================================
   BASE
========================================= */ 
:root {
    --accent: #223c78;
    --accent-soft: rgba(34, 60, 120, 0.08);
    --text: #4d5974;
}

/* ให้ FAQ ใช้ฟอนต์ตามเว็บหลัก */
#faq-tabs,
#faq-tab-content,
.tab-content,
.faq-nav {
    font-family: "supermarket", Arial, Helvetica, sans-serif !important;
}

/* จำกัดผลแค่หน้า FAQ */
#faq-tab-content,
#faq-tabs {
    font-family: "supermarket", Arial, Helvetica, sans-serif !important;
}

/* =========================================
   LEFT NAV (FAQ MENU)
========================================= */
.faq-nav {
    flex-direction: column;
    margin: 0 0 32px;
    border-radius: 2px;
    border: 1px solid #ddd;
    box-shadow: 0 1px 5px rgba(85, 85, 85, 0.15);
}

.faq-nav .nav-link {
    position: relative;
    display: block;
    margin: 0;
    padding: 13px 16px;
    background-color: #fff;
    border: 0;
    border-bottom: 1px solid #ddd;
    border-radius: 0;
    color: #616161;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.faq-nav .nav-link:hover {
    background-color: #f6f6f6;
}

.faq-nav .nav-link.active {
    background-color: #f6f6f6;
    font-weight: 700;
    color: var(--accent);
    border-left: 4px solid var(--accent);
}

.faq-nav .nav-link:last-of-type {
    border-bottom-left-radius: 2px;
    border-bottom-right-radius: 2px;
    border-bottom: 0;
}

.faq-nav .nav-link i.mdi {
    margin-right: 5px;
    font-size: 18px;
    position: relative;
}

/* =========================================
   TAB CONTENT
========================================= */
.tab-content {
    box-shadow: 0 1px 5px rgba(85, 85, 85, 0.15);
}

.tab-content .card {
    border-radius: 0;
}

.tab-content .card-header {
    padding: 15px 16px;
    border-radius: 0;
    background-color: #ffffff;
}

.tab-content .card-header h5 {
    margin: 0;
}

.tab-content .card-header h5 button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    color: #124c97;
    text-align: left;
    white-space: normal;
    position: relative;
    padding-right: 40px;
    background: transparent;
    transition: color 0.2s ease;
}

/* =========================================
   FIX HOVER "STUCK" ISSUE
========================================= */
.tab-content .card-header h5 button:focus,
.tab-content .card-header h5 button:active,
.tab-content .card-header h5 button:active:focus {
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none;
}

.tab-content .card-header h5 button:hover {
    color: var(--accent);
    text-decoration: none;
}

.tab-content .card-header h5 button[aria-expanded='true'] {
    color: var(--accent);
}

.tab-content .card-body {
    background: #ffffff;
}

.tab-content .card-body p {
    color: #616161;
    font-size: 1.1rem;
}

.tab-content .card-body p:last-of-type {
    margin: 0;
}

/* =========================================
   ACCORDION STRUCTURE
========================================= */
.accordion > .card:not(:first-child) {
    border-top: 0;
}

.collapse.show .card-body {
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* =========================================
   ACCORDION TITLE + ICON
========================================= */
.tab-content .card-header h5 button .accordion-title {
    display: inline-block;
    padding: 0.25rem 1.75rem 0.25rem 0;
    font-family: "supermarket", Arial, Helvetica, sans-serif !important;
    font-size: 1.1rem;
}

.tab-content .card-header h5 button .faq-toggle-icon {
    display: inline-block;
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: 1px solid currentColor;
    border-radius: 22px;
}

.tab-content .card-header h5 button .faq-toggle-icon::before {
    content: '';
    position: absolute;
    top: 9px;
    left: 5px;
    width: 10px;
    height: 2px;
    background: currentColor;
}

.tab-content .card-header h5 button .faq-toggle-icon::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 9px;
    width: 2px;
    height: 10px;
    background: currentColor;
}

.tab-content .card-header h5 button[aria-expanded='true'] .faq-toggle-icon::after {
    width: 0;
}

.accordion .card-header button[aria-expanded='true'] {
    border-bottom: 1px solid var(--accent);
}

/* =========================================
   FAQ BORDER IMPROVEMENT
========================================= */
.tab-content .accordion {
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
}

.tab-content .accordion .card {
    border: 0;
    border-bottom: 1px solid #e9e9e9;
}

.tab-content .accordion .card:last-child {
    border-bottom: 0;
}

.tab-content .card-header {
    border-bottom: 1px solid #f0f0f0;
}

.tab-content .collapse.show .card-body {
    border-top: 1px solid #eeeeee;
}

/* =========================================
   OLD FAQ SEARCH
========================================= */
.faq-search-wrapper {
    margin-bottom: 20px;
}

.faq-search-box {
    position: relative;
}

.faq-search-box input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border 0.2s ease;
    font-family: "supermarket", Arial, Helvetica, sans-serif !important;
}

.faq-search-box input:focus {
    outline: none;
    border-color: #223c78;
    box-shadow: 0 0 0 2px rgba(34, 60, 120, 0.08);
}

#clearSearch {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    font-size: 14px;
    cursor: pointer;
    color: #999;
    font-family: "supermarket", Arial, Helvetica, sans-serif !important;
}

.faq-search-meta {
    margin: 8px 0 14px;
    font-size: 0.95rem;
    color: #6b6b6b;
    font-family: "supermarket", Arial, Helvetica, sans-serif !important;
}

#faqNoResults {
    padding: 12px 14px;
    border: 1px solid #e9e9e9;
    background: #fafafa;
    border-radius: 4px;
    color: #666;
    margin-bottom: 16px;
    font-family: "supermarket", Arial, Helvetica, sans-serif !important;
}

.faq-highlight {
    background: rgba(255, 230, 120, 0.85);
    padding: 0 2px;
    border-radius: 2px;
    font-family: "supermarket", Arial, Helvetica, sans-serif !important;
}

/* =========================================
   GLOBAL FAQ SEARCH FONT FIX
   ใช้กับระบบค้นหาใหม่
========================================= */
body #__DIV1 #boiFaqGlobalSearch,
body #__DIV1 #boiFaqGlobalSearch *,
body #__DIV1 #boiFaqGlobalSearch input,
body #__DIV1 #boiFaqGlobalSearch button,
body #__DIV1 #boiFaqGlobalSearch a,
body #__DIV1 #boiFaqGlobalSearch span,
body #__DIV1 #boiFaqGlobalSearch div,
body #__DIV1 #boiFaqGlobalSearch label,
body #__DIV1 #boiFaqGlobalSearch p,
body #__DIV1 #boiFaqGlobalSearch small,
body #__DIV1 #boiFaqGlobalSearch strong,
body #__DIV1 #boiFaqGlobalSearch input::placeholder {
    font-family: "supermarket", Helvetica, sans-serif !important;
}