/* Algolia Custom Search Overlay Styles */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    align-items: self-start;
    justify-content: center;
    display: flex;

    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.search-overlay.show {

    opacity: 1;
    visibility: visible;
    transform: scale(1);
}


.search-container {
    width: 100%;
    max-width: 100%;
    height: 95vh;
    background: white;
    /*border-radius: 8px;*/
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 44px 16px 0;
}

.search-header {
    padding: 16px 0;
    max-width: 1024px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

#search-input {
    flex: 1;
    padding: 16px;
    line-height: 1.5;
    border-radius: 100px;
    border: 1px solid #D5D5D5;
    background: #F0F0F0;
    font-size: 16px;
}

#search-button {
    padding: 0;
    background: transparent;
    color: #393433;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    line-height: 0;
    font-weight: 500;
    text-transform: uppercase;
    transition: background-color 0.2s ease;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

#search-button:hover {
    background: transparent;
    color: #393433;
}

#search-close {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    position: absolute;
    right: -60px;
    top: 50%;
    background: transparent;
    border: 0;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
    color: #393433;
    transform: translateY(-50%);
}

#search-close:hover {
    transform: translateY(-50%);
}

#search-clear {
    background: transparent;
    border: 0;
    color: #393433;
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    line-height: 1.5;
    text-decoration: underline;
    letter-spacing: 0;
}

.search-body {
    /* flex: 1; */
    display: flex;
    overflow: hidden;
    max-width: 1024px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-top: 12px;
    padding-bottom: 68px;
}

.sidebar {
    /* flex: 1; */
    /*background: #f8f9fa;*/
    padding: 24px;
    overflow-y: auto;
    border-right: 1px solid rgba(123, 123, 123, 0.35);
    width: 100%;
}

.sidebar.no-border {
    border-right: 0;
}

/* Scrollbar track */
.sidebar::-webkit-scrollbar {
    width: 19px;
    height: 3px;
    /* for horizontal scroll */
}

.sidebar::-webkit-scrollbar-track {
    /*background: #f0f0f0;*/
    /*border-radius: 2px;*/
}

/* Scrollbar thumb */
.sidebar::-webkit-scrollbar-thumb {
    background-color: #181716;
    border-right: 16px solid transparent;
    background-clip: content-box;
}

/* On hover */
.sidebar::-webkit-scrollbar-thumb:hover {
    /*background-color: #666;*/
}

.sidebar-group {
    margin-bottom: 18px;
}

.sidebar-group h4 {
    text-transform: uppercase;
    margin: 0 0 10px 0;
    font-family: var(--e-global-typography-text-font-family, "Poppins"), Sans-serif;
    font-weight: 700;
    font-size: 11.2px;
    line-height: 1.5;
    letter-spacing: 1px;
}

.sidebar-link {
    display: block;
    padding: 10px 12px;
    text-decoration: none;
    font-size: 16px;
    line-height: 1.5;
}

.sidebar-group .sidebar-link:hover {
    /* color: #007cba; */
    text-decoration: underline;
}

.results-area {
    /* flex: 1; */
    padding: 0 10px 0 36px;
    overflow-y: auto;
    width: 100%;
}

.results-area.grid-4-columns #results-grid {
    gap: 16px;
}

.results-area.grid-4-columns .product-card {
    width: calc(25% - 12px);
}

/* Scrollbar track */
.results-area::-webkit-scrollbar {
    width: 3px;
    height: 3px;
    /* for horizontal scroll */
}

.results-area::-webkit-scrollbar-track {
    /*background: #f0f0f0;*/
    border-radius: 2px;
}

/* Scrollbar thumb */
.results-area::-webkit-scrollbar-thumb {
    background-color: #181716;
    /*border-radius: 4px;*/
    /*border: 1px solid transparent;*/
    background-clip: content-box;
}

/* On hover */
.results-area::-webkit-scrollbar-thumb:hover {
    background-color: #666;
}

#results-header {
    color: #393433;
    font-size: 14px;
    line-height: 1.5;
    text-decoration: underline;
    padding: 10px 0;
    margin-bottom: 24px;
}

#results-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    /* justify-content: space-between; */
    gap: 26px;
    height: calc(100% - 65px);
    overflow-y: auto;
    padding-right: 87px;
}

/* Scrollbar track */
#results-grid::-webkit-scrollbar {
    width: 19px;
    height: 3px;
    /* for horizontal scroll */
}

#results-grid::-webkit-scrollbar-track {
    border-radius: 2px;
}

/* Scrollbar thumb */
#results-grid::-webkit-scrollbar-thumb {
    background-color: #181716;
    background-clip: content-box;
    border-right: 16px solid transparent;
}

/* On hover */
#results-grid::-webkit-scrollbar-thumb:hover {
    background-color: #666;
}

.product-card {
    overflow: hidden;
    transition: transform 0.2s;
    width: calc(50% - 13px);
}

.product-card:hover {
    /*transform: translateY(-2px);*/
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-card svg {
    width: 100%;
    height: auto;
}

.product-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
}

.card-content {
    padding: 8px;
}

.card-content h5 {
    margin: 0 0 8px 0;
    font-size: 18px;
    line-height: 1.5;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: inherit;
    font-weight: 400;
}

.card-content h5 span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* số dòng tối đa */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-content p {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.card-content button {
    width: 100%;
    background: #fff;
    border: 1px solid #181716;
    color: #181716;
    cursor: pointer;
    text-transform: uppercase;
    padding: 7px;
    font-weight: 400;
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: 1px;
    text-align: center;

}

.card-content button:hover {
    background: #181716;
    color: #FFF;
}

.no-results,
.default-msg {
    text-align: center;
    padding: 40px;
    color: #666;
    grid-column: 1 / -1;
}

.card-content mark {
    /*background: #fff3cd;*/
    /*padding: 1px 3px;*/
    font-weight: 700;
    background: transparent;
}

#portfolio-group {}

/* Responsive Design */
@media (max-width: 768px) {
    .search-header {
        display: flex;
        text-align: center;
        justify-content: space-between;
        gap: 12px;
    }

    #search-close {
        position: inherit;
        right: 0;
    }

    .search-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        padding-top: 0;
    }

    .search-body {
        display: flex;
        flex-wrap: wrap;
        padding: 0 0 30px;
        margin-right: -16px;
        margin-left: -16px;
        width: calc(100% + 32px);
        flex-direction: column-reverse;
        justify-content: center;
    }

    #search-button {
        right: 68px;
    }

    #search-clear {
        right: 102px;
        padding: 10px;
    }

    #search-input {
        padding: 11px 16px;
        border-color: #F2F0ED;
    }

    #search-input:focus {
        border-color: #F2F0ED
    }

    .sidebar {
        padding: 24px 0 0;
        margin-top: 24px;
        border-top: 1px solid #F2F0ED;
        border-right-color: transparent;
        overflow: inherit;
    }

    .sidebar:after {
        content: '';
        position: absolute;
        left: 0;
        right: 16px;
        height: 1px;
        bottom: 0;
        background: #F2F0ED;
    }

    .sidebar-content {
        width: 100%;
        max-height: calc(50vh - 120px);
        overflow-y: auto;
        flex: revert;
        padding: 0 16px;
        /*display: none !important;*/
    }

    /* Scrollbar track */
    .sidebar-content::-webkit-scrollbar {
        width: 19px;
        height: 3px;
        /* for horizontal scroll */
    }

    .sidebar-content::-webkit-scrollbar-track {
        border-radius: 2px;
    }

    /* Scrollbar thumb */
    .sidebar-content::-webkit-scrollbar-thumb {
        background-color: #181716;
        background-clip: content-box;
        border-right: 16px solid transparent;
    }

    /* On hover */
    .sidebar-content::-webkit-scrollbar-thumb:hover {
        background-color: #666;
    }

    #results-grid {
        gap: 26px 8px;
        height: calc(50vh - 100px);
        padding-right: 16px;
        overflow-y: auto;
    }

    .results-area {
        padding: 0 0 0 16px;
        /* flex: revert; */
        flex: 1;
        overflow: inherit;
        width: 100%;
    }

    .results-area.grid-4-columns #results-grid {
        gap: 8px;
    }

    .results-area.grid-4-columns .product-card,
    .product-card {
        width: calc(50% - 4px);
    }


}

/* Portfolio Item Styles */
.portfolio-item {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.portfolio-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.portfolio-link {
    display: flex;
    align-items: center;
    gap: 18px;
    text-decoration: none;
    color: inherit;
}

.portfolio-link:hover {
    text-decoration: none;
}

.portfolio-thumbnail {
    width: 75px;
    height: 75px;
    object-fit: cover;
    flex-shrink: 0;
}

.portfolio-content {
    flex: 1;
    min-width: 0;
}

.portfolio-categories {
    font-size: 12px;
    color: rgba(57, 52, 51, 1);
    margin-bottom: 3px;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.portfolio-title {
    font-size: 18px;
    line-height: 1.3;
    color: rgba(24, 23, 22, 1);
    font-weight: 300;
    display: block;
    font-family: "Merriweather", Sans-serif;
}

.portfolio-link:hover .portfolio-title {
    text-decoration: underline;
}

/* Mobile portfolio adjustments */
@media (max-width: 768px) {
    .portfolio-item {
        padding: 10px 12px;
    }

    .portfolio-thumbnail {
        width: 50px;
        height: 38px;
    }

    .portfolio-categories {
        font-size: 9px;
    }

    .portfolio-title {
        font-size: 13px;
    }
}

/* knowledge-group */

#knowledge-group .sidebar-link {
    font-family: "Merriweather", Sans-serif;
}