/**
 * Header quick access — ทางลัดแทนแบนเนอร์เมื่อปิด Header Ads
 * การ์ดโปร่ง (glass) + กล่องไอคอน โทนเข้มดิบ (ดิน-ป่า-สนิม) ตามปุ่ม
 */

/* ใต้แถวเมนู (มือถือ) — กว้างเต็มคอนเทนเนอร์ */
.header-quick-access-wrap.header-quick-access-wrap--below-menu {
    width: 100%;
    max-width: 100%;
}

.header-quick-access-wrap {
    width: 880px;
    max-width: 100%;

    --hqa-text: #0f172a;
    --hqa-text-label: #334155;
    --hqa-intro: #64748b;
    --hqa-intro-kicker: #334155;
    --hqa-intro-lede: #64748b;
    --hqa-rule: rgba(15, 23, 42, 0.12);
    --hqa-focus: #475569;

    /* 0 เลขเด็ด · ทองแดง */
    --hqa-glyph-0: #b45309;
    /* 1 คำนวณหวย · น้ำเงิน */
    --hqa-glyph-1: #0369a1;
    /* 2 ผลหวย · สนิมแดง */
    --hqa-glyph-2: #9a3412;
    /* 3 ทำนายฝัน · คราม */
    --hqa-glyph-3: #4f46e5;
    /* 4 หมู่บ้าน · เขียวป่า */
    --hqa-glyph-4: #166534;
    /* 5 ตลาด · สารหลั่ง */
    --hqa-glyph-5: #854d0e;
    /* 6 เช่ายืม · มรกต */
    --hqa-glyph-6: #0f766e;
    --hqa-glyph-radius: 0.6rem;

    --hqa-card-bg: rgba(255, 255, 255, 0.28);
    --hqa-card-bg-hover: rgba(255, 255, 255, 0.46);
    --hqa-card-border: rgba(255, 255, 255, 0.38);
    --hqa-card-border-outer: rgba(15, 23, 42, 0.05);
    --hqa-card-border-hover: rgba(255, 255, 255, 0.52);
    --hqa-card-border-hover-outer: rgba(15, 23, 42, 0.09);
    --hqa-card-shadow:
        0 1px 2px rgba(15, 23, 42, 0.03),
        0 6px 18px rgba(15, 23, 42, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
    --hqa-card-shadow-hover:
        0 3px 10px rgba(15, 23, 42, 0.05),
        0 12px 28px rgba(15, 23, 42, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.58);
    --hqa-card-blur: 16px;
    --hqa-card-radius: 0;
}

.header-quick-access-wrap .hqa-strip {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.55rem;
    width: 100%;
}

.header-quick-access-wrap .hqa-strip__head {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
}

.header-quick-access-wrap .hqa-strip__intro-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    width: 100%;
    max-width: 100%;
}

.header-quick-access-wrap .hqa-strip__rule--right {
    flex: 0 1 3.5rem;
    max-width: 5rem;
    min-width: 1.5rem;
    height: 1px;
    background: linear-gradient(90deg, var(--hqa-rule) 0%, transparent 100%);
}

.header-quick-access-wrap .hqa-strip__intro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem 0.5rem;
    margin: 0;
    max-width: min(100%, 26rem);
    line-height: 1.45;
    text-align: right;
}

.header-quick-access-wrap .hqa-strip__intro-kicker {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--hqa-intro-kicker);
}

.header-quick-access-wrap .hqa-strip__intro-divider {
    width: 1px;
    height: 0.85em;
    background: rgba(15, 23, 42, 0.14);
    flex-shrink: 0;
}

.header-quick-access-wrap .hqa-strip__intro-lede {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--hqa-intro-lede);
}

.header-quick-access-wrap .hqa-strip__head-line {
    width: 100%;
    max-width: 42rem;
    height: 2px;
    background: linear-gradient(
        to left,
        transparent 0%,
        #0ca170 15%,
        #097b55 50%,
        #0c7351 85%,
        transparent 100%
    );
    margin-left: auto;
}

.header-quick-access-wrap .hqa-strip__nav {
    width: 100%;
}

.header-quick-access-wrap .hqa-strip__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: stretch;
    gap: 0.6rem 0.55rem;
}

.header-quick-access-wrap .hqa-strip__item {
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
}

.header-quick-access-wrap .hqa-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-width: 6.5rem;
    max-width: 7.85rem;
    padding: 0.72rem 0.6rem 0.78rem;
    text-decoration: none;
    color: var(--hqa-text);
    background: var(--hqa-card-bg);
    border: 1px solid var(--hqa-card-border-outer);
    box-shadow:
        var(--hqa-card-shadow),
        0 0 0 1px var(--hqa-card-border) inset;
    border-radius: var(--hqa-card-radius);
    -webkit-backdrop-filter: blur(var(--hqa-card-blur)) saturate(1.15);
    backdrop-filter: blur(var(--hqa-card-blur)) saturate(1.15);
    transition:
        background 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease,
        transform 0.22s ease;
}

.header-quick-access-wrap .hqa-chip:hover {
    background: var(--hqa-card-bg-hover);
    border-color: var(--hqa-card-border-hover-outer);
    box-shadow:
        var(--hqa-card-shadow-hover),
        0 0 0 1px var(--hqa-card-border-hover) inset;
    transform: translateY(-2px);
}

.header-quick-access-wrap .hqa-chip:focus-visible {
    outline: 2px solid var(--hqa-focus);
    outline-offset: 2px;
}

.header-quick-access-wrap .hqa-chip__glyph {
    width: 3.45rem;
    height: 3.45rem;
    border-radius: var(--hqa-glyph-radius);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: #ffffff;
    background: #94a3b8;
    box-shadow: none;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.header-quick-access-wrap .hqa-chip__glyph > i {
    font-family: "Font Awesome 6 Pro", "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
    font-weight: 900 !important;
    font-style: normal;
    line-height: 1;
}

.header-quick-access-wrap .hqa-chip:hover .hqa-chip__glyph {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.header-quick-access-wrap .hqa-chip--0 .hqa-chip__glyph {
    background: var(--hqa-glyph-0);
}

.header-quick-access-wrap .hqa-chip--1 .hqa-chip__glyph {
    background: var(--hqa-glyph-1);
}

.header-quick-access-wrap .hqa-chip--2 .hqa-chip__glyph {
    background: var(--hqa-glyph-2);
}

.header-quick-access-wrap .hqa-chip--3 .hqa-chip__glyph {
    background: var(--hqa-glyph-3);
}

.header-quick-access-wrap .hqa-chip--4 .hqa-chip__glyph {
    background: var(--hqa-glyph-4);
}

.header-quick-access-wrap .hqa-chip--5 .hqa-chip__glyph {
    background: var(--hqa-glyph-5);
}

.header-quick-access-wrap .hqa-chip--6 .hqa-chip__glyph {
    background: var(--hqa-glyph-6);
}

.header-quick-access-wrap .hqa-chip__label {
    margin-top: 0.48rem;
    font-size: 0.84375rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    letter-spacing: -0.02em;
    color: var(--hqa-text-label);
}

/*
 * มือถือ / แท็บ / iPad — ต่ำกว่า Bootstrap xl (1200px):
 * แถวเดียว + เลื่อนแนวนอน + การ์ด/ไอคอนกะทัดรัด
 * (ที่ 992–1199px ยังใช้ header-middle — เดิม wrap 2 แถวเพราะช่องแคบ)
 */
@media (max-width: 1199.98px) {
    .header-quick-access-wrap {
        --hqa-glyph-radius: 0.5rem;
        /* ให้คอลัมน์ Bootstrap (flex) ยอมให้แถบเลื่อนแนวนอนทำงาน */
        min-width: 0;
    }

    .header-quick-access-wrap .hqa-strip__head {
        display: none;
    }

    .header-quick-access-wrap .hqa-strip {
        flex-direction: row;
        align-items: stretch;
        gap: 0;
    }

    .header-quick-access-wrap .hqa-strip__nav {
        width: 100%;
        min-width: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
    }

    .header-quick-access-wrap .hqa-strip__list {
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: stretch;
        gap: 0.4rem;
        padding: 0.1rem 0 0.28rem;
    }

    .header-quick-access-wrap .hqa-chip {
        min-width: 4.35rem;
        max-width: 5rem;
        flex-shrink: 0;
        padding: 0.4rem 0.32rem 0.42rem;
    }

    .header-quick-access-wrap .hqa-chip__glyph {
        width: 2.35rem;
        height: 2.35rem;
        font-size: 0.9375rem;
    }

    .header-quick-access-wrap .hqa-chip__label {
        margin-top: 0.28rem;
        font-size: 0.6875rem;
    }

    /*
     * ใต้แถวเมนู (มือถือเท่านั้น — มี class --below-menu) : การ์ดพื้นขาว ขอบมน ไม่ใช้กระจกโปร่ง
     * ใช้ !important — theme-variables บังคับ .menu-area * / .menu-area a เป็นสีเมนูแบบ !important
     */
    .header-layout1 .menu-area .header-quick-access-wrap--below-menu .hqa-chip,
    .header-quick-access-wrap--below-menu .hqa-chip {
        background: #ffffff !important;
        /* เหมือน Desktop: .hqa-chip ใช้ --hqa-text */
        color: var(--hqa-text) !important;
        border: 1px solid rgba(15, 23, 42, 0.1);
        border-radius: 0.62rem;
        box-shadow:
            0 1px 2px rgba(15, 23, 42, 0.04),
            0 4px 12px rgba(15, 23, 42, 0.06);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .header-layout1 .menu-area .header-quick-access-wrap--below-menu .hqa-chip__label,
    .header-quick-access-wrap--below-menu .hqa-chip__label {
        /* เหมือน Desktop: .hqa-chip__label ใช้ --hqa-text-label */
        color: var(--hqa-text-label) !important;
    }

    .header-layout1 .menu-area .header-quick-access-wrap--below-menu .hqa-chip:hover,
    .header-quick-access-wrap--below-menu .hqa-chip:hover {
        background: #ffffff !important;
        color: var(--hqa-text) !important;
        border-color: rgba(15, 23, 42, 0.14);
        box-shadow:
            0 2px 4px rgba(15, 23, 42, 0.06),
            0 8px 20px rgba(15, 23, 42, 0.08);
    }

    .header-layout1 .menu-area .header-quick-access-wrap--below-menu .hqa-chip:hover .hqa-chip__label,
    .header-quick-access-wrap--below-menu .hqa-chip:hover .hqa-chip__label {
        color: var(--hqa-text-label) !important;
    }

    .header-layout1 .menu-area .header-quick-access-wrap--below-menu .hqa-chip:focus-visible,
    .header-quick-access-wrap--below-menu .hqa-chip:focus-visible {
        outline-color: #0f766e;
    }

    /* ไอคอนในช่องสียังใช้สีขาว (override .menu-area i … !important ของธีม) */
    .header-layout1 .menu-area .header-quick-access-wrap--below-menu .hqa-chip__glyph,
    .header-layout1 .menu-area .header-quick-access-wrap--below-menu .hqa-chip__glyph i,
    .header-quick-access-wrap--below-menu .hqa-chip__glyph,
    .header-quick-access-wrap--below-menu .hqa-chip__glyph i {
        color: #ffffff !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .header-quick-access-wrap .hqa-chip,
    .header-quick-access-wrap .hqa-chip__glyph {
        transition: none;
    }

    .header-quick-access-wrap .hqa-chip:hover {
        transform: none;
    }

    .header-quick-access-wrap .hqa-chip:hover .hqa-chip__glyph {
        transform: none;
        filter: none;
    }
}

/* ไม่รองรับ backdrop-filter: ให้พื้นทึบขึ้นเล็กน้อย อ่านง่าย (ยกเว้นการ์ดใต้เมนูมือถือที่กำหนดพื้นขาวแล้ว) */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .header-quick-access-wrap:not(.header-quick-access-wrap--below-menu) .hqa-chip {
        background: rgba(255, 255, 255, 0.88);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .header-quick-access-wrap:not(.header-quick-access-wrap--below-menu) .hqa-chip:hover {
        background: rgba(255, 255, 255, 0.94);
    }
}
