/*
1. header 
2. header-bar
3. nav
4. logo
*/

/* header */
header#thaicbn-header {
    font-family: kurious;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 99;
    margin: 15px 0;
}

body.modal-open header#thaicbn-header {
    padding-right: 15px;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
}

@media screen and (min-width: 1516px) {
    #thaicbn-header {
        padding: 0 0;
    }
}

@media screen and (min-width: 1025px) {
    #thaicbn-header {
        padding: 0 60px;
    }
}

@media screen and (max-width: 1025px) {
    header#thaicbn-header {
        margin: 0;
    }

    .header-container {
        padding: 0;
    }
}

@media screen and (max-width: 1025px) {
    header#thaicbn-header.active {
        background: #FFFFFF;
        height: 100vh;
        position: fixed;
        top: 0;
        z-index: 9999;
    }
}

/* header-bar */
header#thaicbn-header .header-bar {
    /* --ccrc-theme_header-bar-height: 140px; */
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 16px 40px;
    border-radius: 82px;
    background: rgba(0, 0, 0, 0.55);
    box-shadow: 0 4px 4px 0 rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(15px);
}

.show-lt {
    display: none;
}
.hidden-lt {
    display: block;
}

@media screen and (max-width: 1025px) {
    header#thaicbn-header .header-bar {
        gap: 60px;
        --ccrc-theme_header-bar-height: 70px;
        gap: 10px;
        justify-content: space-between;
        border-radius: 0px;
        padding: 15.5px 16px;
        background: rgba(0, 0, 0, 0.60);
        box-shadow: 0 4px 4px 0 rgba(255, 255, 255, 0.10);
        backdrop-filter: blur(15px);
        height: var(--ccrc-theme_header-bar-height);
    }

    header#thaicbn-header.active .header-bar {
        background: none;
        box-shadow: none;
    }
    header#thaicbn-header .logo.show-lt .collapsed{
        display: block;
    }
    header#thaicbn-header .logo.show-lt .expand{
        display: none;
    }
    header#thaicbn-header.active .logo.show-lt .collapsed{
        display: none;
    }
    header#thaicbn-header.active .logo.show-lt .expand{
        display: block;
    }
    .show-lt {
        display: block;
    }
    .hidden-lt {
        display: none;
    }
}


.burger {
    width: 24px;
    height: 24px;
    position: relative;
    cursor: pointer;
}

.burger .burger-1,
.burger .burger-2,
.burger .burger-3 {
    position: absolute;
    background: #FFFFFF;
    width: 20px;
    height: 2px;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    transition: 0.35s cubic-bezier(0, 0, 0, 1);
    border-radius: 10px;
}

#thaicbn-header.active .burger .burger-1,
#thaicbn-header.active .burger .burger-2,
#thaicbn-header.active .burger .burger-3 {
    background: #181D27;
}

#thaicbn-header:not(.active) .burger-1 {
    translate: -50% -7px;
}

#thaicbn-header:not(.active) .burger-2 {
    translate: -50% -1px;
}

#thaicbn-header:not(.active) .burger-3 {
    translate: -50% 5px;
}


#thaicbn-header.active .burger-1 {
    rotate: 45deg;
}

#thaicbn-header.active .burger-2 {
    opacity: 0;
}

#thaicbn-header.active .burger-3 {
    rotate: -45deg;
}


header#thaicbn-header .logo {
    max-width: 80px;
}

@media screen and (max-width: 1200px) {
    header#thaicbn-header .logo {
        max-width: 80px;
    }
}

@media screen and (max-width: 1025px) {
    header#thaicbn-header .logo {
        max-width: 64px;
    }
}


/* --- NAV & SCROLL WRAPPER (FULL UPDATE) --- */

/* 1. Custom Scrollbar Styles */
.nav-wrap-scroll::-webkit-scrollbar {
    width: 6px;  
    height: 4px;
    display: block;
}
.nav-wrap-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}
.nav-wrap-scroll::-webkit-scrollbar-thumb {
    background: #99DDBF;
    border-radius: 4px;
    transition: background 0.3s;
}
.nav-wrap-scroll::-webkit-scrollbar-thumb:hover {
    background: #188152;
}


/* 2. Desktop Logic */
.nav-wrap-scroll {
    overflow-x: auto;
}

header#thaicbn-header .nav-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
}

/* 3. Mobile Logic (Max-width 1025px) */
@media screen and (max-width: 1025px) {
    header#thaicbn-header .nav-wrap-scroll {
        display: none;
    }

    header#thaicbn-header.active .header-bar .nav-wrap-scroll {
        display: block;
        position: absolute;
        
        /* จัดตำแหน่ง */
        top: var(--ccrc-theme_header-bar-height);
        left: 0;
        right: 0;
        margin-left: 0;
        margin-right: 0;
        
        padding: 8px 32px 80px 16px;
        
        width: 100%;
        background: #FFFFFF;
        
        height: calc(100vh - var(--ccrc-theme_header-bar-height));
        height: calc(100dvh - var(--ccrc-theme_header-bar-height));
        
        overflow-y: auto;  
        overflow-x: hidden;
    }

    header#thaicbn-header.active .header-bar .nav-bar {
        display: flex;
        flex-direction: column;
        align-items: start;
        gap: 20px;
        width: 100%;
        
        /* Reset Position */
        position: static;
        margin: 0;
        padding: 0;
        
        height: auto;
        min-height: min-content;
    }
}

header#thaicbn-header .nav-list {
    display: flex;
    gap: 12px;
    margin: 0px;
    padding: 0;
    align-items: center;
}

@media screen and (max-width: 1025px) {
    header#thaicbn-header .nav-list {
        width: 100%;
        flex-direction: column;
        gap: 2px;
        align-items: unset;
    }
}

header#thaicbn-header .nav-list li,
header#thaicbn-header .nav-list ul li {
    list-style: none;
    list-style-type: none;
    cursor: pointer;
    padding: 4px 6px;
}

header#thaicbn-header .nav-list li a {
    color: #FFFFFF;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 600;
    display: flex;
    gap: 4px;
    padding-inline: 2px;
}

header#thaicbn-header .nav-list li a.hidden-lg {
    align-items: center;
}

header#thaicbn-header .nav-list li a img{
    width: 16px;
}

header#thaicbn-header .nav-list li a img.c-white {
    display: block;
    rotate: 0deg;
}

header#thaicbn-header .nav-list li a img.c-mint {
    display: none;
    rotate: 180deg;
}

header#thaicbn-header .nav-list li a.expand {
    color: #99DDBF;
}

header#thaicbn-header .nav-list li a.expand img.c-white {
    display: none;
}
header#thaicbn-header .nav-list li a.expand img.c-mint {
    display: block;
    rotate: 0deg;
}

header#thaicbn-header .nav-list li a.climate-toggle-mb img {
    width: 12px;
    rotate: 90deg;
}

header#thaicbn-header .nav-list li a.climate-toggle-mb.expand img {
    rotate: 270deg;
}

header#thaicbn-header .nav-list li a:hover {
    color: #99DDBF;
    text-decoration: underline;
    text-underline-offset: 4px;
}

header#thaicbn-header .nav-list li a:hover img.c-white {
    display: none;
}

header#thaicbn-header .nav-list li a:hover img.c-mint {
    display: block;
}

header#thaicbn-header .nav-list li a.active {
    color: #99DDBF; 
    font-weight: 600;
}

header#thaicbn-header .nav-list li a.active .c-white {
    display: none; 
}
header#thaicbn-header .nav-list li a.active .c-mint {
    display: inline-block; 
}

header#thaicbn-header .nav-bar .contact {
    display: flex;
    gap: 17px;
}

header#thaicbn-header .nav-bar .contact .icon-contact {
    width: 35px;
    height: 35px;
}

@media screen and (max-width: 1290px) and (min-width: 1212px) {
    header#thaicbn-header .nav-list li a {
        font-size: 13px;
    }

    header#thaicbn-header .logo {
        max-width: 60px;
    }

}

@media screen and (max-width: 1212px) and (min-width: 1133px) {
    header#thaicbn-header .nav-list li a {
        font-size: 12px;
    }

    header#thaicbn-header .logo {
        max-width: 50px;
    }
}

@media screen and (max-width: 1133px) and (min-width: 1071px) {
    header#thaicbn-header .nav-list li a {
        font-size: 11px;
    }

    header#thaicbn-header .logo {
        max-width: 45px;
    }
}

@media screen and (max-width: 1071px) and (min-width: 1025px) {
    header#thaicbn-header .nav-list li a {
        font-size: 10px;
    }

    header#thaicbn-header .logo {
        max-width: 40px;
    }
}

@media screen and (max-width: 1025px) {
    header#thaicbn-header .nav-list li a {
        color: #181D27;
        text-overflow: ellipsis;
        font-size: 16px;
        line-height: 1.5;
        font-weight: 600;
        gap: 2px;
        padding: 12px;
    }
    header#thaicbn-header .nav-list li a.show-lg {
        display: flex !important;
        justify-content: space-between;
    }
    header#thaicbn-header .nav-list li .dropdown-climate-mb .nav-climate {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    header#thaicbn-header .nav-list li .dropdown-climate-mb .nav-climate a{
        color: #181D27;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.2;
        gap: 8px;
        padding: 0 0 0 28px;
    }
    header#thaicbn-header .nav-list li .dropdown-climate-mb .nav-climate .view-more-mb p{
        color: #188152;
    }
    header#thaicbn-header .nav-list li .dropdown-climate-mb .nav-climate a p{
        color: #181D27;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.2;
    }
    header#thaicbn-header .nav-list li .dropdown-climate-mb .nav-climate a:last-child{
        padding-left: 12px;
    }
}


/* Header Detail */
#thaicbn-header.thaicbn-header-detail {
    margin: 0;
    background-color: #1C3B51;
}

#thaicbn-header.thaicbn-header-detail .header-container {
    max-width: 1200px;
}

#thaicbn-header.thaicbn-header-detail .header-bar {
    background: none;
    backdrop-filter: blur(0px);
    box-shadow: none;
    gap: 225px;
}

#thaicbn-header.thaicbn-header-detail .logo {
    max-width: 80px;
}

@media screen and (min-width: 1025px) {
    #thaicbn-header.thaicbn-header-detail .header-bar {
        padding: 24.5px 0;
    }
}

/* Dropdown Header */
header#thaicbn-header .nav-list li .dropdown-climate {
    display: none;
    position: absolute;
    top: 68px;
    right: 224px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #FFF;
    box-shadow: 0 12px 16px -4px rgba(10, 13, 18, 0.08), 0 4px 6px -2px rgba(10, 13, 18, 0.03), 0 2px 2px -1px rgba(10, 13, 18, 0.04);
    border-radius: 16px;
}
header#thaicbn-header .nav-list li .dropdown-climate.active {
    display: block;
}
header#thaicbn-header .nav-list li .dropdown-climate .dropdown-climate-container {
    padding: 16px 16px 20px 16px;
}
header#thaicbn-header .nav-list li .dropdown-climate .dropdown-climate-container .view-all-climate {
    display: flex;
    justify-content: flex-end;
    cursor: unset;
    margin-bottom: 16px;
}
header#thaicbn-header .nav-list li .dropdown-climate .dropdown-climate-container .view-all-climate a {
    color: #188152;
    justify-content: flex-end;
    padding: 0;
    font-size: 13px;
}
header#thaicbn-header .nav-list li .dropdown-climate .dropdown-climate-container .view-all-climate a img,
header#thaicbn-header .nav-list li .dropdown-climate-mb .nav-climate a.view-more-mb  img {
    rotate: 0deg;
    transition: rotate 0.3s ease;
}
header#thaicbn-header .nav-list li .dropdown-climate .dropdown-climate-container .view-all-climate a:hover img,
header#thaicbn-header .nav-list li .dropdown-climate-mb .nav-climate a:hover.view-more-mb  img {
    rotate: 45deg;
}
header#thaicbn-header .nav-list li .dropdown-climate {
    /* max-width: 800px; */
    width: 100%;
}
header#thaicbn-header .nav-list li .dropdown-climate .dropdown-climate-container .nav-climate {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
header#thaicbn-header .nav-list li .dropdown-climate .dropdown-climate-container .nav-climate a {
    flex-direction: column;
    border-radius: 8px;
    border: 1px solid #EBEBEB;
    padding: 12px ;
    transition: background 0.3s ease;
}
header#thaicbn-header .nav-list li .dropdown-climate .dropdown-climate-container .nav-climate a:hover {
    background: #BAE8D4;
}
header#thaicbn-header .nav-list li .dropdown-climate .dropdown-climate-container .nav-climate a img {
    width: 18px;
    margin-bottom: 6px;
}
header#thaicbn-header .nav-list li .dropdown-climate .dropdown-climate-container .nav-climate a .climate-title {
    color: #181D27;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}
header#thaicbn-header .nav-list li .dropdown-climate .dropdown-climate-container .nav-climate a .climate-desc {
    color: #535862;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
}
header#thaicbn-header .nav-list li .dropdown-climate .dropdown-climate-container .view-all-climate a:hover {
    text-decoration: none;
}
header#thaicbn-header .nav-list li .dropdown-climate .dropdown-climate-container .nav-climate a:hover {
    text-decoration: none;
}

/* Back to Top Button Styles */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: rgba(34, 181, 115, 0.60);
    border: none;
    border-radius: 11998.801px;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; 
}

.back-to-top img {
    width: 40px;
    height: 40px;
    rotate: 270deg;
}

.back-to-top:hover {
    background: rgba(34, 181, 115, 0.90);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Responsive (Mobile) */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
    
    .back-to-top img {
        width: 25px;
        height: 25px;
    }
}