/* Header */
.header {
    background-color: #fff;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo img {
    height: 30px;
    display: block;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 5px 0;
    transition: 0.3s;
}

.nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 30px;
}

.nav li {
    position: relative;
   line-height: 51px;
}

.nav a {
    text-decoration: none;
  color: #231816;
    font-family: 'Alibaba PuHuiTi-Medium';
    font-weight: 500;
    font-size: 20px; 
    transition: color 0.3s;
    position: relative;
    white-space: nowrap;

}

.nav a:hover,
.nav a.active {
    color: var(--primary-color);
}

.nav > ul > li > a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

.nav > ul > li > a:hover::after,
.nav > ul > li > a.active::after {
    width: 100%;
}

/* Dropdown Menu */
.dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 160px;

    background-color: transparent;
    box-shadow: none;
    border-radius: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    flex-direction: column !important;
    gap: 0 !important;
    padding: 10px 0 !important;
    z-index: 999;
    align-items: stretch;
    white-space: nowrap;
        margin-top: 20px !important;
}

.dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -100vw;
    width: 200vw;
    height: 100%;
  background-color: #005eac;
	opacity: 0.9;
    z-index: -1;
    padding-bottom: 20px;
}

.has-dropdown:hover .dropdown {
    opacity: 1;
    visibility: visible;
}

.dropdown li {
    padding: 0;
    width: 100%;
    padding-left: 90px;
}

.dropdown a {
    color: #fff;
    font-size: 20px;
    display: block;
    line-height: 36px;
    padding-left: 3px;
    opacity: 0.9;
    white-space: nowrap;
    position: relative;
}

.dropdown a::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: #fff;
    transition: width 0.3s;
}

.dropdown a:hover::after,
.dropdown a.active::after {
    width: calc(100% - 3px);
}

.dropdown a:hover,
.dropdown a.active {
    color: #fff !important; /* Force white text to override .nav a.active */
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-container {
    display: flex;
    align-items: center;
    position: relative;
}

#search-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 15px 5px 5px;
    /* Added right padding to move icon away from edge */
    display: flex;
    align-items: center;
    color: var(--text-color);
    position: relative;
    z-index: 1002;
}

#search-btn:hover {
    color: var(--primary-color);
}
#search-sub {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 15px 5px 5px;
    /* Added right padding to move icon away from edge */
    display: flex;
    align-items: center;
    color: var(--text-color);
    position: relative;
    z-index: 1002;
}

#search-sub:hover {
    color: var(--primary-color);
}

#search-input {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    opacity: 0;
    visibility: hidden;
    border: 0;
    border-radius: 30px;
    padding: 0;
    margin-right: 0;
    padding-right: 50px;
    /* Increased space for the search icon inside */
    transition: all 0.3s ease;
    outline: none;
    background-color: #fff;
    font-size: 14px;
    z-index: 1001;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.search-container.active #search-input {
    width: 200px;
    opacity: 1;
    height: 40px;
    visibility: visible;
    border: 1px solid #ddd;
    padding: 5px 50px 5px 15px;
    /* Adjust padding to keep text from overlapping icon */
}

/* Search Mode Styles - Desktop Only */
@media (min-width: 769px) {
    .header.search-active .nav {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.2s, visibility 0.2s;
    }

    .header.search-active .search-container.active #search-input {
        width: 800px;
        max-width: 60vw;
    }
}

.lang-switch a {
    text-decoration: none;
    color: var(--text-color);
    font-family: 'Alibaba PuHuiTi-Regular';
    font-weight: 400;
    font-size: 20px; 
    padding: 5px 10px;
    transition: all 0.3s;
}

.lang-switch a:hover {
    color: var(--primary-color);
}

/* Header Responsive Styles */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
        z-index: 1001;
        order: 3; /* Ensure it's on the right if needed, but flex order depends on HTML */
    }

    .nav {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: #fff;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 999;
        overflow-y: auto;
        padding-bottom: 20px;
        border-top: 1px solid #eee;
    }

    .nav.active {
        transform: translateX(0);
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }

    .nav ul {
        flex-direction: column;
        gap: 0;
    }

    .nav li {
        width: 100%;
        padding: 0;
        border-bottom: 1px solid #f5f5f5;
    }

    .nav a {
        display: block;
        padding: 15px 20px;
        font-size: 16px;
    }

    /* Mobile Dropdown */
    .dropdown {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        background-color: #f9f9f9;
        padding: 0 !important;
        min-width: auto;
        box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
    }

    .dropdown::before {
        display: none;
    }

    .has-dropdown.active .dropdown {
        display: flex;
    }

    .dropdown a {
        padding-left: 40px;
        color: #666;
        font-family: 'Alibaba PuHuiTi-Regular';
        font-weight: 400;
        font-size: 20px;
        border-bottom: 1px solid #eee;
    }
    
    .dropdown a:hover,
    .dropdown a.active {
        background-color: #eee;
        color: var(--primary-color);
    }

    .dropdown a::after {
        background-color: var(--primary-color);
        bottom: 0;
    }

    .dropdown a:hover::after,
    .dropdown a.active::after {
        width: calc(100% - 60px);
    }

    .header-actions {
        margin-right: 5px;
        margin-left: auto; /* Push to the right */
        gap: 0;
    }

    #search-btn {
        padding-right: 5px;
        padding-left: 5px;
    }
    #search-sub {
        padding-right: 5px;
        padding-left: 5px;
    }

    /* Mobile Search Input Expansion Direction (Below Header) */
    #search-input {
        position: fixed;
        top: 80px; /* Header height */
        left: 0;
        width: 100%;
        height: 0; /* Start with 0 height */
        padding: 0 20px;
        opacity: 0;
        visibility: hidden;
        border: none;
        border-radius: 0;
        border-bottom: 1px solid #eee;
        background-color: #fff;
        transition: all 0.3s ease;
        z-index: 998;
        transform: none; /* Reset desktop transform */
        margin: 0;
    }

    .search-container.active #search-input {
        height: 60px; /* Expanded height */
        padding: 0 20px;
        opacity: 1;
        visibility: visible;
        width: 100%;
        border: none;
        border-bottom: 1px solid #eee;
    }
    
    .logo img{
        height: 25px;
    }
}

/* Footer */
.site-footer {

    padding-bottom: 50px;
}

.footer-divider-top,
.footer-divider-middle {
    width: 100%;
    margin-bottom: 30px;
}

.footer-divider-top img,
.footer-divider-middle img {
    width: 100%;
    height: auto;
    display: block;
}

.footer-upper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-top: 10px;
}

.footer-branding {
    display: flex;
    align-items: center;
}

.footer-logo {
    width: 155px;
    height: auto;
    margin-right: 30px;
}

.copyright {
    font-family: 'Alibaba PuHuiTi-Regular';
    font-size: 16px;
    font-weight: 400;
    color: #231816;
}

.footer-nav {
    display: flex;
    gap: 20px;
}

.footer-nav a {
    font-size: 16px;
    color: #231816;
    font-weight: bold;
    font-family: 'Alibaba PuHuiTi-Medium';
    text-decoration: none;
    font-weight: 500;
}

.footer-nav a:hover {
    text-decoration: underline;
}

.footer-lower {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}
.footer-col h4 {
  
    font-size: 16px;
    font-weight: 900;
    font-family: 'Alibaba PuHuiTi-Heavy';

    color: #231816;
    margin-bottom: 10px;
}

.footer-col p {
    font-size: 14px;
    line-height: 1.5;
    font-weight: 400;
    color: #231816;
    font-family: 'Alibaba PuHuiTi-Regular';
}
.products-header  h2{
    font-size: 32px;
    font-weight: 700;
    font-family: 'Alibaba PuHuiTi-Bold';
    color: #231816;
    margin-bottom: 50px;
}
@media (max-width: 1024px) {
    .footer-upper {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        margin-bottom: 0px;
    }
    
    .footer-nav {
        flex-wrap: wrap;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .footer-lower {
        grid-template-columns: 1fr;
        gap: 40px;
        display:none;
    }
    .footer-nav{
        display:none;
    }
    .footer-divider-middle{
        display:none;
    }
    .footer-branding {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}
