/* =============================================
   CED-633 — Site-wide Header Search Bar
   Own row between header-upper and header-lower
   ============================================= */

/* Search row — sits between header-upper and header-lower */
.header-search-row {
    background: #f5f5f5;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 8px 0;
}

/* Centered search container */
.header-search-box {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    max-width: 480px;
    margin: 0 auto;
}

/* Form wrapper */
.ct-search-form {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
}

/* Search icon inside input */
.ct-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
    pointer-events: none;
    z-index: 2;
}

/* Always-visible input */
#ct-search-input {
    width: 100%;
    border: 2px solid #ddd;
    border-radius: 25px;
    background: #fff;
    color: #333;
    padding: 10px 16px 10px 38px;
    font-size: 14px;
    font-family: 'Open Sans', sans-serif;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
#ct-search-input::placeholder {
    color: #aaa;
}
#ct-search-input:focus {
    border-color: #2a4a3e;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(42,74,62,0.1);
}

/* Results dropdown */
.ct-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    width: 100%;
    min-width: 320px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.15);
    max-height: 420px;
    overflow-y: auto;
    z-index: 99999;
    display: none;
}
.ct-search-results.has-results {
    display: block;
}

/* Group heading */
.ct-results-group-heading {
    padding: 8px 14px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #888;
    background: #f5f5f5;
    border-top: 1px solid #eee;
}
.ct-results-group-heading:first-child {
    border-top: none;
    border-radius: 8px 8px 0 0;
}

/* Individual result */
.ct-result-item {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}
.ct-result-item:last-child {
    border-bottom: none;
}
.ct-result-item:hover,
.ct-result-item:focus {
    background: #f8f4ee;
    outline: none;
    text-decoration: none;
    color: #333;
}
.ct-result-title {
    font-size: 14px;
    font-weight: 600;
    color: #2a4a3e;
    line-height: 1.3;
}
.ct-result-excerpt {
    font-size: 12px;
    color: #777;
    margin-top: 2px;
    line-height: 1.4;
}

/* Status messages */
.ct-search-status {
    padding: 14px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

/* "View all results" link at bottom */
.ct-view-all {
    display: block;
    padding: 10px 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #2a4a3e;
    text-decoration: none;
    border-top: 1px solid #eee;
    background: #fafafa;
    border-radius: 0 0 8px 8px;
    transition: background 0.15s;
}
.ct-view-all:hover {
    background: #f0ede8;
    text-decoration: none;
    color: #2a4a3e;
}

/* ---- Responsive ---- */

/* Mobile */
@media (max-width: 767px) {
    .header-search-row {
        padding: 6px 0;
    }
    .header-search-box {
        margin: 0 15px;
        max-width: none;
    }
    .ct-search-results {
        min-width: 0;
        border-radius: 0 0 8px 8px;
    }
}

/* CED-633 visual hardening: ensure centering and preserve logo visibility */
.header-search-row .auto-container {
    display: flex;
    justify-content: center;
}

.header-search-row .header-search-box {
    width: 100%;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.header-upper .upper-inner {
    display: block !important;
}

.header-upper .logo-box {
    float: left !important;
    display: block !important;
    padding: 6px 0;
}

.header-upper .logo-box .logo,
.header-upper .logo-box .logo svg {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@media (max-width: 767px) {
    .header-search-row .auto-container {
        display: block;
    }

    .header-search-row .header-search-box {
        max-width: none;
        margin: 0;
    }
}
