/* CIR Smart Search — Frontend Styles */

/* Hide the old search overlay completely */
.search-overlay {
    display: none !important;
}

/* Search bar container */
.cir-ss-search {
    display: flex;
    align-items: center;
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: width 0.3s ease, opacity 0.3s ease;
    white-space: nowrap;
}

.cir-ss-search.active {
    width: 196px;
    opacity: 1;
}

/* Form layout */
.cir-ss-form {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
}

/* Input field */
.cir-ss-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #c3c4c7;
    padding: 6px 30px 6px 8px;
    font-size: 14px;
    font-family: inherit;
    color: #1d2327;
    outline: none;
    transition: border-color 0.2s ease;
}

.cir-ss-input:focus {
    border-bottom-color: #1d2327;
}

.cir-ss-input::placeholder {
    color: #646970;
}

/* Hide native browser clear button on search inputs */
.cir-ss-input::-webkit-search-cancel-button,
.cir-ss-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}
.cir-ss-input::-ms-clear {
    display: none;
}

/* Close button */
.cir-ss-close {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #1d2327;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.cir-ss-close:hover {
    opacity: 1;
}

/* Homepage white nav (before sticky) */
.home .main-nav:not(.is-sticky) .cir-ss-input {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.home .main-nav:not(.is-sticky) .cir-ss-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.home .main-nav:not(.is-sticky) .cir-ss-input:focus {
    border-bottom-color: rgba(255, 255, 255, 0.7);
}

.home .main-nav:not(.is-sticky) .cir-ss-close {
    color: #fff;
}

/* Mobile */
@media (max-width: 768px) {
    .cir-ss-search.active {
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        width: 100%;
        background: #fff;
        z-index: 100;
        padding: 0 16px;
        display: flex;
        align-items: center;
    }

    .cir-ss-search.active .cir-ss-input {
        font-size: 16px;
        color: #1d2327;
        border-bottom-color: #c3c4c7;
    }

    .cir-ss-search.active .cir-ss-input::placeholder {
        color: #646970;
    }

    .cir-ss-search.active .cir-ss-close {
        color: #1d2327;
    }

    /* Override homepage white styles on mobile when active */
    .home .main-nav:not(.is-sticky) .cir-ss-search.active .cir-ss-input {
        color: #1d2327;
        border-bottom-color: #c3c4c7;
    }

    .home .main-nav:not(.is-sticky) .cir-ss-search.active .cir-ss-input::placeholder {
        color: #646970;
    }

    .home .main-nav:not(.is-sticky) .cir-ss-search.active .cir-ss-close {
        color: #1d2327;
    }
}
