/* Reusable landing search box used by ThongTinCanhan and compatible screens. */

.cn-page-header {
    overflow: visible;
    position: relative;
    z-index: 50;
}

.cn-page-header:focus-within {
    z-index: 200;
}

.cn-search-box {
    --cn-control-height: 52px;
    align-items: flex-end;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(80, 108, 215, .10);
    border-radius: 18px;
    box-shadow: 0 16px 38px rgba(80, 108, 215, .12);
    display: grid;
    gap: 14px 48px;
    grid-template-columns: minmax(280px, .9fr) minmax(360px, 1.35fr) minmax(170px, auto);
    margin-left: auto;
    margin-right: auto;
    max-width: 1120px;
    overflow: visible;
    padding: 16px 18px;
    position: relative;
    width: min(100%, 1120px);
    z-index: 15;
}

.cn-search-box:focus-within {
    box-shadow: 0 18px 42px rgba(80, 108, 215, .16);
    z-index: 120;
}

.cn-search-box.has-ksk-filter {
    grid-template-columns: minmax(235px, .9fr) minmax(300px, 1.2fr) minmax(230px, .95fr) minmax(150px, auto);
    max-width: 1280px;
    width: min(100%, 1280px);
}

.cn-search-box.has-extra-field {
    grid-template-columns: minmax(230px, .85fr) minmax(280px, 1.1fr) minmax(230px, .9fr) minmax(150px, auto);
    max-width: 1280px;
    width: min(100%, 1280px);
}

.cn-search-box .search-field {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-width: 220px;
    overflow: visible;
    position: relative;
    width: 100%;
}

.cn-search-box .search-field:first-child::after {
    background: rgba(15, 23, 42, .14);
    bottom: 0;
    content: "";
    position: absolute;
    right: -24px;
    top: 0;
    width: 1px;
}

.cn-search-box.has-ksk-filter .ksk-filter-group::before {
    background: rgba(15, 23, 42, .14);
    bottom: 0;
    content: "";
    left: -24px;
    position: absolute;
    top: 0;
    width: 1px;
}

.cn-search-box.has-extra-field .search-field:nth-of-type(3)::before {
    background: rgba(15, 23, 42, .14);
    bottom: 0;
    content: "";
    left: -24px;
    position: absolute;
    top: 0;
    width: 1px;
}

.cn-search-action {
    align-items: flex-end;
    display: flex;
    height: 100%;
    position: relative;
}

.cn-search-action::before {
    background: rgba(15, 23, 42, .14);
    bottom: 0;
    content: "";
    left: -24px;
    position: absolute;
    top: 0;
    width: 1px;
}

.cn-search-box .value {
    color: #172554;
    font-weight: 700;
    line-height: 20px;
    margin-bottom: 8px;
    min-height: 20px;
}

.cn-search-box .input-label {
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
    border: 1px solid rgba(80, 108, 215, .20);
    border-radius: 9px;
    box-shadow: 0 0 5px rgba(80, 108, 215, .08);
    color: #1e293b;
    font-weight: 600;
    height: var(--cn-control-height);
    line-height: 1.35;
    min-height: var(--cn-control-height);
    padding: 0 14px;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
    width: 100%;
}

.cn-search-box .input-label:hover,
.cn-search-box .input-label:focus {
    border-color: rgba(80, 108, 215, .42);
    box-shadow: 0 6px 18px rgba(80, 108, 215, .14);
    outline: 0;
    transform: translateY(-1px);
}

.cn-search-box .form-select.cn-native-select {
    height: 1px;
    left: 0;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 100%;
    width: 1px;
}

.cn-select-menu {
    position: relative;
    width: 100%;
    z-index: 12;
}

.cn-select-menu.active {
    z-index: 140;
}

.cn-select-btn {
    align-items: center;
    background: linear-gradient(135deg, #ffffff 0%, #f5f7ff 58%, #eef2ff 100%);
    border: 1px solid rgba(80, 108, 215, .22);
    border-radius: 9px;
    box-shadow: 0 0 5px rgba(80, 108, 215, .10);
    color: #263b88;
    cursor: pointer;
    display: flex;
    font-size: 14px;
    font-weight: 700;
    gap: 12px;
    height: var(--cn-control-height);
    justify-content: space-between;
    min-height: var(--cn-control-height);
    padding: 0 14px 0 16px;
    text-align: left;
    transition: border-color .2s ease, box-shadow .2s ease, color .2s ease, transform .2s ease;
    width: 100%;
}

.cn-select-btn:hover,
.cn-select-menu.active .cn-select-btn {
    background: linear-gradient(135deg, #fbfcff 0%, #eef2ff 56%, #e8edff 100%);
    border-color: rgba(80, 108, 215, .46);
    box-shadow: 0 8px 20px rgba(80, 108, 215, .17);
    color: #263b88;
    transform: translateY(-1px);
}

.cn-select-btn:focus-visible {
    border-color: rgba(80, 108, 215, .58);
    box-shadow: 0 0 0 3px rgba(80, 108, 215, .18), 0 8px 20px rgba(80, 108, 215, .15);
    outline: 0;
}

.cn-select-text {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cn-select-chevron {
    align-items: center;
    background: #eef2ff;
    border-radius: 9px;
    color: #506cd7;
    display: inline-flex;
    flex: 0 0 28px;
    height: 28px;
    justify-content: center;
    transition: transform .25s ease, background-color .2s ease, color .2s ease;
    width: 28px;
}

.cn-select-chevron::before {
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    content: "";
    display: block;
    height: 7px;
    transform: rotate(45deg) translate(-1px, -1px);
    width: 7px;
}

.cn-select-menu.active .cn-select-chevron {
    background: #dfe6ff;
    color: #3f55c1;
    transform: rotate(-180deg);
}

.cn-select-options {
    background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
    border: 1px solid rgba(80, 108, 215, .20);
    border-radius: 12px;
    box-shadow: 0 14px 35px rgba(15, 23, 42, .14);
    display: none;
    left: 0;
    list-style: none;
    margin: 10px 0 0;
    max-height: 260px;
    overflow-y: auto;
    padding: 8px;
    position: absolute;
    right: 0;
    scrollbar-color: #a8b6f0 #f8faff;
    scrollbar-width: thin;
    top: 100%;
    z-index: 150;
}

.cn-select-menu.active .cn-select-options {
    display: block;
}

.cn-select-options::-webkit-scrollbar {
    width: 7px;
}

.cn-select-options::-webkit-scrollbar-track {
    background: #f8faff;
}

.cn-select-options::-webkit-scrollbar-thumb {
    background: #a8b6f0;
    border-radius: 999px;
}

.cn-select-option {
    align-items: center;
    background: #fff;
    border: 0;
    border-radius: 10px;
    color: #334155;
    cursor: pointer;
    display: flex;
    font-size: 14px;
    font-weight: 600;
    gap: 10px;
    min-height: 44px;
    padding: 9px 10px;
    text-align: left;
    transition: background-color .15s ease, color .15s ease, transform .15s ease;
    width: 100%;
}

.cn-select-option:hover,
.cn-select-option:focus-visible {
    background: #f1f4ff;
    color: #3249b8;
    outline: 0;
    transform: translateX(2px);
}

.cn-select-option.is-selected {
    background: linear-gradient(135deg, #eef2ff 0%, #e4eaff 100%);
    color: #263b88;
}

.cn-select-option.is-selected::before {
    color: #506cd7;
    content: "\f00c";
    flex: 0 0 16px;
    font-family: "Font Awesome 5 Free", "FontAwesome";
    font-size: 12px;
    font-weight: 900;
}

.cn-select-option:not(.is-selected)::before {
    background: #c8d2ff;
    border-radius: 50%;
    content: "";
    flex: 0 0 7px;
    height: 7px;
    margin-left: 4px;
    margin-right: 5px;
    width: 7px;
}

.cn-search-button {
    align-items: center;
    background: linear-gradient(135deg, #506cd7 0%, #4058ca 50%, #3149b8 100%);
    border: 0;
    border-radius: 9px;
    box-shadow: 0 12px 24px rgba(80, 108, 215, .28);
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    gap: 8px;
    height: var(--cn-control-height);
    justify-content: center;
    min-height: var(--cn-control-height);
    min-width: 140px;
    overflow: hidden;
    padding: 0 22px;
    position: relative;
    transition: box-shadow .22s ease, transform .22s ease, filter .22s ease;
    white-space: nowrap;
    width: 100%;
}

.cn-search-button::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .36), transparent);
    content: "";
    height: 140%;
    left: -85%;
    position: absolute;
    top: -20%;
    transform: skewX(-22deg);
    transition: left .55s ease;
    width: 52%;
}

.cn-search-button::after {
    background: rgba(255, 255, 255, .18);
    border-radius: 999px;
    content: "";
    height: 0;
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    transition: height .25s ease, width .25s ease, opacity .25s ease;
    width: 0;
}

.cn-search-button:hover,
.cn-search-button:focus-visible {
    box-shadow: 0 16px 32px rgba(80, 108, 215, .38);
    color: #fff;
    filter: saturate(1.08);
    outline: 0;
    transform: translateY(-3px);
}

.cn-search-button:hover::before,
.cn-search-button:focus-visible::before {
    left: 125%;
}

.cn-search-button:hover::after,
.cn-search-button:focus-visible::after {
    height: 110px;
    opacity: .55;
    width: 110px;
}

.cn-search-button i {
    position: relative;
    transition: transform .22s ease;
    z-index: 1;
}

.cn-search-button span {
    position: relative;
    z-index: 1;
}

.cn-search-button:hover i,
.cn-search-button:focus-visible i {
    transform: scale(1.14) rotate(-8deg);
}

@media (max-width: 991.98px) {
    .cn-search-box {
        align-items: stretch;
        grid-template-columns: 1fr;
        max-width: 720px;
    }

    .cn-search-box .search-field,
    .cn-search-action,
    .cn-search-button {
        width: 100%;
    }

    .cn-search-box .search-field {
        padding-right: 0;
    }

    .cn-search-action {
        padding-left: 0;
    }

    .cn-search-box .search-field:first-child::after,
    .cn-search-box.has-ksk-filter .ksk-filter-group::before,
    .cn-search-box.has-extra-field .search-field:nth-of-type(3)::before,
    .cn-search-action::before {
        display: none;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .cn-search-box {
        grid-template-columns: minmax(250px, .95fr) minmax(320px, 1.25fr) minmax(160px, auto);
        max-width: 1000px;
    }

    .cn-search-box.has-ksk-filter {
        grid-template-columns: minmax(220px, .9fr) minmax(280px, 1.1fr) minmax(210px, .9fr) minmax(140px, auto);
        max-width: 1120px;
    }

    .cn-search-box.has-extra-field {
        grid-template-columns: minmax(210px, .85fr) minmax(250px, 1fr) minmax(210px, .85fr) minmax(140px, auto);
        max-width: 1120px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cn-select-btn,
    .cn-select-chevron,
    .cn-select-option,
    .cn-search-button,
    .cn-search-button::before,
    .cn-search-button::after,
    .cn-search-button i {
        transition: none;
    }
}
