.custom-search-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
}

.custom-search-trigger:hover {
    opacity: 0.7;
    transform: scale(1.1);
}

.custom-search-overlay-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-search-overlay-bg.active {
    display: block;
    opacity: 1;
}

.custom-search-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

.custom-search-drawer.active {
    transform: translateX(0);
}

.custom-search-drawer-header {
    padding: 20px;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.custom-search-close {
    background: #fff;
    border: 1px solid #000;
    cursor: pointer;
    padding: 8px;
    color: #000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.custom-search-close:hover {
    background: #000;
    color: #fff;
    transform: rotate(90deg);
}

.custom-search-input-wrapper {
    padding: 20px;
    border-bottom: 1px solid #eaeaea;
    position: relative;
}

.custom-search-input {
    width: 100%;
    font-size: 18px;
    font-weight: 400;
    border: none;
    border-bottom: 2px solid #000;
    background: transparent;
    padding: 12px 0 12px 50px;
    outline: none;
    transition: border-color 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
    color: #000;
}

.custom-search-input:focus {
    border-color: #000;
}

.custom-search-input::placeholder {
    color: #999;
    font-weight: 400;
}

.custom-search-input-wrapper::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='m21 21-4.35-4.35'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    pointer-events: none;
}

.custom-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.custom-search-result-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eaeaea;
    text-decoration: none;
    color: #000;
    transition: all 0.3s ease;
    cursor: pointer;
}

.custom-search-result-item:hover {
    background: #f9f9f9;
    transform: translateX(-5px);
}

.custom-search-result-item:last-child {
    border-bottom: none;
}

.custom-search-result-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    margin-right: 16px;
    border-radius: 4px;
    background: #f5f5f5;
}

.custom-search-result-content {
    flex: 1;
    min-width: 0;
}

.custom-search-result-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.4;
    color: #000;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-search-result-price {
    font-size: 13px;
    color: #666;
    font-weight: 400;
}

.custom-search-loading {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.custom-search-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #eaeaea;
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.custom-search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

@media (max-width: 768px) {
    .custom-search-drawer {
        width: 100%;
    }

    .custom-search-drawer-header {
        padding: 15px;
    }

    .custom-search-input-wrapper {
        padding: 15px;
    }

    .custom-search-input {
        font-size: 16px;
        padding: 10px 0;
    }

    .custom-search-result-item {
        padding: 12px 15px;
    }

    .custom-search-result-image {
        width: 50px;
        height: 50px;
        margin-right: 12px;
    }

    .custom-search-result-title {
        font-size: 13px;
    }

    .custom-search-result-price {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .custom-search-drawer-header {
        padding: 12px;
    }

    .custom-search-input-wrapper {
        padding: 12px;
    }

    .custom-search-input {
        font-size: 15px;
    }

    .custom-search-result-item {
        padding: 10px 12px;
    }

    .custom-search-result-image {
        width: 45px;
        height: 45px;
        margin-right: 10px;
    }
}
