/* ---------------------------------------------------------------
   Frontend: Custom Search Bar
---------------------------------------------------------------- */

/* Hide FiboSearch + default Divi search icon */
.et_search_outer,
.et_pb_search_button,
.dgwt-wcas-search-wrapp,
.dgwt-wcas-search-form,
.dgwt-wcas-ico-magnifier,
[class*="fibosearch"],
[class*="dgwt-wcas"] { display: none !important; }

/* Make Divi header container flex so our bar slots in */
#main-header .et_menu_container {
    display: flex !important;
    align-items: center !important;
}

/* Search bar */
#clipon-search-bar {
    display: flex;
    align-items: center;
    position: relative;
    flex: 1;
    max-width: 800px;
    margin: 0 0 0 100px;
}
#clipon-search-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1.5px solid #d0d0d0;
    border-radius: 23px;
    font-size: 14px;
    color: #333;
    background: #f8f8f8;
    outline: none;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
#clipon-search-input:focus {
    border-color: #29aae1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(41,170,225,.12);
}
#clipon-search-input::placeholder { color: #bbb; }
#clipon-search-icon { display: none; }
#clipon-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: 340px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,.15);
    z-index: 99999;
    overflow: hidden;
    display: none;
}
#clipon-search-results.visible { display: block; animation: csr-in .15s ease; }
@keyframes csr-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.csr-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none !important;
    color: inherit !important;
    border-bottom: 1px solid #f2f2f2;
    transition: background .12s;
}
.csr-item:last-child { border-bottom: none; }
.csr-item:hover { background: #f5fbff; }
.csr-thumb {
    width: 46px; height: 46px;
    object-fit: contain;
    border-radius: 6px;
    background: #f5f5f5;
    flex-shrink: 0;
}
.csr-info { flex: 1; min-width: 0; }
.csr-title {
    font-size: 13px; font-weight: 600;
    color: #1a1a1a; line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.csr-title mark { background: #fff3a3; color: inherit; padding: 0 2px; border-radius: 2px; }
.csr-price { font-size: 12px; color: #29aae1; font-weight: 600; margin-top: 2px; }
.csr-price del { color: #bbb; font-weight: 400; margin-right: 4px; }
.csr-empty { padding: 18px 14px; font-size: 13px; color: #888; text-align: center; }
.csr-redirect {
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}
.csr-redirect-icon { font-size: 32px; line-height: 1; }
.csr-redirect-msg { font-size: 14px; color: #333; line-height: 1.5; }
.csr-redirect-msg span { font-size: 13px; color: #888; }
.csr-redirect-btn {
    display: inline-block;
    margin-top: 4px;
    padding: 9px 22px;
    background: #29aae1;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    transition: background .15s;
}
.csr-redirect-btn:hover { background: #1a8dbf; }
.csr-footer {
    padding: 9px 14px; text-align: center;
    background: #fafafa; border-top: 1px solid #f0f0f0;
    font-size: 12px;
}
.csr-footer a { color: #29aae1; text-decoration: none; font-weight: 600; }

/* Mobile portrait */
@media (max-width: 767px) and (orientation: portrait) {
    #clipon-search-bar {
        max-width: 120%;
        margin-left: 50px;
    }
    #clipon-search-results {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100vw - 24px);
        min-width: unset;
        max-width: calc(100vw - 24px);
    }
}
