/* MCS site-search widget */

/* --- Navbar input --------------------------------------------------------- */
.mcs-search {
    position: relative;
    display: block;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

input.mcs-search-input {
    width: 100%;
    max-width: 350px;
    height: 38px;
    padding: 0 14px;
    font-size: 14px;
    border: 2px solid #0d6efd;
    border-radius: 6px;
    background: #fff;
    color: #212529;
    box-sizing: border-box;
    outline: none;
    box-shadow: 0 1px 3px rgba(13, 110, 253, .12);
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

input.mcs-search-input:hover {
    border-color: #0a58ca;
}

input.mcs-search-input:focus {
    border-color: #0a58ca;
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .25);
}

input.mcs-search-input::placeholder {
    color: #6c757d;
}

.navbar .mcs-search {
    margin-left: 8px;
}

@media (max-width: 1199.98px) {
    .navbar .mcs-search {
        max-width: none;
        margin: 8px 0;
    }
}

/* --- Off-canvas results panel -------------------------------------------- */
.mcs-search-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 1090;
    opacity: 0;
    transition: opacity .2s ease-in-out;
}
.mcs-search-backdrop.open { opacity: 1; }

.mcs-search-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 400px;
    max-width: 100vw;
    background: #fff;
    box-shadow: -6px 0 24px rgba(0, 0, 0, .18);
    z-index: 1095;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .22s ease-in-out;
}
.mcs-search-panel.open { transform: translateX(0); }

.mcs-search-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(90deg, #4dabf7 0%, #0d6efd 50%, #0a58ca 100%);
    color: #fff;
    flex: 0 0 auto;
}
.mcs-search-panel-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .2px;
}
.mcs-search-close {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
    opacity: .85;
}
.mcs-search-close:hover { opacity: 1; }

.mcs-search-panel-input-row {
    padding: 12px 16px;
    border-bottom: 1px solid #eef1f4;
    flex: 0 0 auto;
    background: #f8f9fb;
}
.mcs-search-panel-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    font-size: 15px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: #fff;
    color: #212529;
    outline: none;
    box-sizing: border-box;
}
.mcs-search-panel-input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .25);
}

.mcs-search-status {
    padding: 10px 18px;
    border-bottom: 1px solid #f0f0f0;
    color: #6c757d;
    font-size: 12px;
    background: #fff;
    flex: 0 0 auto;
}

.mcs-search-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1 1 auto;
    background: #fff;
}

.mcs-search-item > a {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    color: #212529;
    text-decoration: none;
    border-bottom: 1px solid #f2f4f7;
    cursor: pointer;
}
.mcs-search-item:last-child > a { border-bottom: none; }

.mcs-search-item:hover > a,
.mcs-search-item.active > a {
    background: #f2f6ff;
}

.mcs-search-item-body { flex: 1 1 auto; min-width: 0; }

.mcs-search-title {
    font-weight: 600;
    color: #0d6efd;
    line-height: 1.3;
    margin-bottom: 2px;
    word-break: break-word;
}

.mcs-search-location {
    font-size: 11px;
    color: #6c757d;
    margin-bottom: 3px;
    word-break: break-word;
}

.mcs-search-snippet {
    color: #495057;
    line-height: 1.35;
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mcs-search-item mark {
    background: #fff3a3;
    padding: 0 1px;
    color: inherit;
}

/* --- Type badges --------------------------------------------------------- */
.mcs-badge {
    display: inline-block;
    flex: 0 0 auto;
    min-width: 44px;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    letter-spacing: .5px;
    color: #fff;
    background: #6c757d;
    text-transform: uppercase;
    margin-top: 2px;
}
.mcs-badge-page { background: #0d6efd; }
.mcs-badge-pdf  { background: #dc3545; }
.mcs-badge-doc, .mcs-badge-docx { background: #2b579a; }
.mcs-badge-xls, .mcs-badge-xlsx { background: #217346; }
.mcs-badge-ppt, .mcs-badge-pptx,
.mcs-badge-pps, .mcs-badge-ppsx { background: #b7472a; }
.mcs-badge-zip  { background: #6c5ce7; }
.mcs-badge-dwg, .mcs-badge-dxf,
.mcs-badge-step, .mcs-badge-stp,
.mcs-badge-iges, .mcs-badge-igs,
.mcs-badge-xt   { background: #495057; }

/* Prevent page scroll while panel is open */
body.mcs-search-open { overflow: hidden; }

@media (max-width: 575.98px) {
    .mcs-search-panel { width: 100vw; }
}
